---
title: 'CatRAG: Category-Aware RAG Frameworks'
url: https://www.emergentmind.com/topics/catrag
type: topic
---

# CatRAG: Category-Aware RAG Frameworks

CatRAG refers to several distinct but conceptually convergent frameworks that integrate retrieval-augmented generation (RAG) architectures with category-theoretic, structural, or context-aware mechanisms to address challenges in fair generation, multi-hop retrieval, and hybrid knowledge reasoning. CatRAG models have been developed in multiple research lines, most notably for (1) structural debiasing via functor-guided projections [2603.21524], (2) context-adaptive knowledge graph traversal [2602.01965], and (3) fusion of dense retrieval and hierarchical graph reasoning [2510.01800]. Each variant instantiates "CatRAG" with domain-specific objectives but shares the guiding principle of augmenting retrieval and generation via principled, structured adaptation to the input context or controlled semantic constraints.

## 1. CatRAG for Functor-Guided Structural Debiasing

CatRAG in the context of LLM fairness introduces a dual-pronged debiasing framework combining category-theoretic projections with retrieval-augmented generation [2603.21524]. The central innovation is a functorial projection $P$ acting on the embedding space, defined as a linear map that collapses protected-attribute subspaces (e.g., gender, race, nationality) while preserving task-relevant (occupation) distinctions.

**Key components:**
- Source category $\mathcal{C}$ with objects as tokens (e.g., "man," "engineer") and morphisms as attention-based associations.
- Target category $\mathcal{U}$ where objects aggregate demographic terms and preserve occupational distinctions.
- Functor $F: \mathcal{C} \to \mathcal{U}$ acts as $F(X) = u_{\mathrm{Person}}$ if $X$ is a demographic anchor; $F(X) = u_{\phi(X)}$ for occupation anchors.
- The structural debiasing projector $P = UU^\top$ is derived by solving a trace-ratio maximization problem between occupational and demographic scatter matrices:
  $$
  \max_U \frac{\mathrm{Tr}(U^\top S_O U)}{\mathrm{Tr}(U^\top S_D U)+\epsilon}
  $$
- Inference-time RAG module retrieves a balanced set of evidence snippets, constructing the LLM prompt as: $\text{Prompt}(q) = \mathrm{Instr} \| \text{[Evidence}_1] \cdots [\text{Evidence}_K] \| q$.

**Empirical findings (BBQ dataset, Llama-3 1B):**
- Accuracy improved from 48.9% (base) to 80.7% (CatRAG); bias score reduced from 0.63 to 0.01.
- Functor-only: accuracy ≈ 70.5%, bias score ≈ 0.15.
- RAG-only: accuracy ≈ 65.3%, bias score ≈ 0.24.
- Full CatRAG: accuracy ≈ 81.2%, bias score ≈ 0.01.

## 2. CatRAG as Context-Aware Knowledge Graph Traversal for Robust RAG

Another CatRAG instantiation addresses multi-hop retrieval failures due to "Static Graph Fallacy" in graph-augmented RAG systems [2602.01965]. Traditional structure-aware RAG approaches, such as HippoRAG 2, rely on static knowledge graphs with fixed transition matrices, leading to semantic drift and hub bias in personalized PageRank (PPR) retrieval.

**Core CatRAG innovations:**
- The static transition matrix $\mathbf{T}$ is replaced by a query-conditioned matrix $\widehat{\mathbf{T}_q}$ using three techniques:
  1. **Symbolic Anchoring:** Weakly anchors the random walk to query-named entities by augmenting the restart vector $\mathbf{e}_s$ with a portion reserved for entities mentioned in the query, encouraging visits to semantically relevant nodes.
  2. **Query-Aware Dynamic Edge Weighting:** Prunes candidate neighbors by vector-similarity and uses LLM-based scoring to align edge weights with query intent (tiered scaling of edges by relevance).
  3. **Key-Fact Passage Weight Enhancement:** Boosts weights of passages directly overlapping with seed facts from the query, structurally anchoring the walk to likely evidence.

**High-level pseudocode for CatRAG traversal:**
- Extract symbolic anchors, compute personalized restart vector, initialize edge weights.
- Prune and re-weight edges using LLM-based semantic alignment.
- Iteratively update node scores with query-adaptive transitions and output top evidence passages.

| Benchmark    | Recall@5 Δ | FCR Δ   | JSR Δ   |
| ------------ | ---------- | ------- | ------- |
| MuSiQue      | +3.5%      | +4.1%   | +2.8%   |
| HotpotQA     | +2.4%      | +4.9%   | +3.4%   |
| HoVer        | +5.6%      | +7.7%   | +4.9%   |

(*Δ values denote gains over HippoRAG 2 baseline. FCR: Full Chain Retrieval, JSR: Joint Success Rate*)

## 3. CatRAG for Semantic Enrichment and Graph Routing in Hybrid RAG Systems

CatRAG also denotes a hybrid RAG framework that fuses dense vector retrieval and graph-based reasoning with routing mechanisms to enhance factual accuracy and contextual depth, especially in complex, regulation-driven question answering [2510.01800]. CatRAG, as used in REBot for academic advising, integrates:

- **Intent classifier** $\Phi$ to route queries to either vector-based or graph-based retrieval modules.
- **Dense retrieval** using embedding models (e.g., PhoBERTv2), selecting chunks by cosine similarity.
- **Hierarchical, category-labeled knowledge graph (REG):** Nodes store text, POS, NER, and LLM-extracted relation tuples, organized by regulation categories.
- **Graph reasoning** is performed in subgraphs filtered by predicted intent/category, optionally refined by GNN propagation.
- **RAG pipeline** concatenates text from dense retrieval, graph paths, entities, and relations to drive LLM generation.

**Pseudocode for query execution:**
```python
# CatRAG-Query
v_q ← f_emb(q)
y ← Φ(q)
C_vec ← TopK(V, v_q, k_vec)
g_y ← G.subgraph(category=y)
C_graph ← TopK(g_y.chunks, v_q, k_graph)
E_graph ← union of entities from C_graph
R_graph ← union of relations from E_graph
Context ← concat(C_vec, C_graph, E_graph, R_graph)
rep ← LLM_gen.generate(prompt=(q, Context))
return rep
```

**Evaluation (REBot, regulation QA, model=gpt-4o-mini):**
- F1: RAG baseline 98.67%, CatRAG 98.89% (τ=0.6).
- Consistent improvement across thresholds and categories; negligible latency overhead for hybrid routing.

## 4. Comparative Summary of CatRAG Applications

The CatRAG discipline comprises diverse methods unified by the goal of structured, context- or category-aware enhancement within RAG architectures. The following table summarizes core technical axes:

| Application Domain      | Principal Mechanism           | Empirical Impact                        | Source         |
|------------------------|------------------------------|-----------------------------------------|---------------|
| LLM Fairness           | Functorial debiasing + RAG   | +32.3% accuracy, bias score 0.01        | [2603.21524]  |
| Multi-hop Retrieval    | Query-adaptive PPR on KG      | +4.9% FCR, hub bias reduction           | [2602.01965]  |
| Hybrid QA, Advising    | Dense+graph fusion, routing   | +0.2 F1 points, structurally explainable| [2510.01800]  |

CatRAG’s implementations differ in pipeline complexity, objective function, and degree of inductive bias (from explicit category functors to adaptive graph transition matrices), but all yield measurable fidelity or efficiency gains over non-category-aware RAG baselines.

## 5. Analysis, Limitations, and Future Directions

Ablation experiments demonstrate that CatRAG's hybrid or dual mechanisms are synergistic: for example, functor-only or RAG-only variants each underperform the full framework in bias mitigation or utility. CatRAG’s debiasing explicitness (through trace-ratio projections) allows direct tradeoff tuning between fairness (collapse of protected subspaces) and utility (preservation of occupation variance) [2603.21524]. In the retrieval context, symbolic anchoring and adaptive edge weighting ameliorate multi-hop dropoff due to semantic drift or hub bias [2602.01965].

**Known limitations:**
- The core projection is linear; further efficacy may come from non-linear functorial or kernelized extensions.
- Anchor set specification and external evidence construction remain partially manual and impact outcome.
- For query-adaptive graph RAG, LLM-based edge scoring introduces runtime latency.
- Generalization to larger models, open-domain retrieval, and multimodal inputs remains open for further research.

A plausible implication is that the CatRAG approach—unifying structured semantic adaptation and external evidence fidelity—offers a generalizable blueprint for future RAG systems demanding principled reasoning and fairness guarantees across diverse application domains.

Source: https://www.emergentmind.com/topics/catrag