RAG vs CAG vs KAG — Three Ways to Give an LLM Knowledge It Never Saw, and When to Use Each
RAG vs CAG vs KAG: Search It, Preload It, or Reason Over a Graph
An LLM knows nothing about data from after its training cutoff or about your company's internal documents. An infographic from GenAI.works that sorts the fixes for this gap into three approaches has been widely shared lately: "RAG vs CAG vs KAG — How LLMs use knowledge they were never trained on".
Search it → RAG · Preload it → CAG · Reason over it → KAG
It is an easy summary to remember. But do those three lines match the original papers? And what has research since 2025 added? This post checks the infographic against the original CAG and KAG papers and against papers, official docs, and engineering blogs from 2025 onward, and fills in the conditions and pitfalls the infographic leaves out.
✍️ TL;DR
The infographic's split is a fine starting point, but the three approaches are parts you combine, not rivals. And the benefits it lists ("answer instantly", "every step can be explained") come with conditions the infographic doesn't mention.
Summary
- RAG: The infographic's "chunk → vector top-k → insert into prompt" is the most basic (naive) RAG. Production RAG in 2025 adds hybrid search (vectors + BM25), reranking, adding context to chunks, and agentic routing. The "RAG is dead" claim also targets this basic form, not retrieval itself.
- CAG: The original paper (a WWW '25 short paper) matches the infographic's definition and steps. But its experiments cover one model, Llama 3.1 8B, and corpora of 21k–85k tokens. On the largest set CAG scored below BM25 RAG, and its dramatic speedups are measured against "feeding the whole document every time without a cache", not against RAG. The authors limit CAG to small knowledge bases like FAQs and call centers, and their conclusion proposes a cache + retrieval hybrid.
- KAG: Not a generic term for "knowledge-graph-based generation" but the name of a specific framework Ant Group built on OpenSPG. It doesn't use the graph alone: it cross-indexes the graph with the source text chunks and uses vector retrieval alongside it. The generic category is better called GraphRAG.
- What independent benchmarks since 2025 agree on: There is no universal winner. RAG does better on single facts, long context or graphs on multi-hop, comparison, and reasoning, and every model gets worse as the input grows (context rot). Graphs pay for their gains with construction cost and missed extractions.
- Practical takeaway: Default to well-built RAG, preload small and stable shared knowledge with prompt caching, and add a graph only when many questions have to hop across relationships between entities. That order is the safest for the cost.
| Approach | The infographic's line | What the original sources show | Conditions the infographic omits |
|---|---|---|---|
| RAG | Search large, changing knowledge and insert it | Correct, but it shows the basic form | Chunks lose context; weak on comparison and multi-hop questions |
| CAG | Preload small, stable knowledge and answer instantly from the KV cache | Definition is correct; the Cache Reset step is missing | Quality drops as context grows; cache invalidation, TTL, cost |
| KAG | Reason step by step over a graph of connected expert knowledge | A specific framework; a graph + vector hybrid | Graph construction cost, missed extractions, mostly vendor-reported numbers |
📌 How to read the numbers: Every figure in this post comes with its source and experimental setup. "Vendor-reported" means the company or authors behind a technique measured it themselves; "independent benchmark" means a third party compared several methods under the same conditions. Trust the former for direction and the latter for magnitude.
The details follow.
📋 Contents
- Why three approaches?
- The infographic at a glance
- RAG — search, then insert
- CAG — preload and cache
- KAG — reason over a graph
- What the infographic leaves out
- Which one, when?
- Patterns for combining them
- Wrapping up
Why three approaches?
An LLM's knowledge stops at its training data. There are two broad ways to give it new knowledge.
- Change the weights — fine-tuning. It is expensive, has to be redone every time the knowledge changes, and makes it hard to trace where an answer came from.
- Put it in the input (the context) — leave the model alone and hand it the knowledge it needs along with the question.
RAG, CAG, and KAG all take the second path. They differ in what goes into the context, when, and in what form.
- RAG: find only the pieces you need each time a question arrives
- CAG: load everything before any question arrives, and reuse the processed result
- KAG: structure the knowledge into entities and relations ahead of time, then turn each question into a plan over that structure
All three are context engineering problems: different ways to decide what goes into a limited context window.
The infographic at a glance
The infographic draws all three columns with the same frame: which kind of knowledge each fits, then three steps.
| RAG | CAG | KAG | |
|---|---|---|---|
| Fits | Large, changing knowledge too big for the context window, updated often | Stable, bounded knowledge small enough to fit in the context window | Expert, connected knowledge facts linked by entities and relationships |
| 01 | Chunk & embed documents split into chunks, stored as vectors | Preload everything all documents loaded into the context once | Build a knowledge graph entities and links tied to their source text |
| 02 | Retrieve top matches the question is matched by vector similarity | Save the KV cache the processed state is stored and reused | Reason step by step the question becomes a plan across the graph |
| 03 | Augment & answer the best chunks go into the prompt | Answer instantly no retrieval step, very low latency | Traceable answer every step can be explained |
The axes are clean: size and change rate of the knowledge (RAG ↔ CAG) and how connected it is (KAG). Below, each column is checked against its original sources.
RAG — search, then insert
The infographic shows "basic RAG"
The infographic's three RAG steps aren't wrong. But they describe what LlamaIndex calls "naive top-k retrieval", the most basic form: put chunks in a vector database and fetch the k chunks closest to the question embedding (LlamaIndex, 2025-05).
This basic form has well-known failure modes.
- Chunks lose their context: Split a document into chunks of a few hundred tokens and each chunk no longer knows where it came from. Anthropic's example is the classic one: from the chunk
"The company's revenue grew by 3% over the previous quarter"alone, you can't tell which company or which quarter (Anthropic, Contextual Retrieval). Jina AI's late chunking paper points out the same problem with anaphora: "Its" and "the city" lose their meaning when they are embedded apart from the earlier chunk that names "Berlin" (Günther et al., 2409.04701). - Weak on questions that need several pieces: Comparison questions, which require fetching several distant chunks correctly, are RAG's biggest weakness. On the LaRA benchmark, the accuracy gap between RAG and long context on comparison tasks averaged 15.22% at 32k and 14.30% at 128k, the largest of any task (LaRA, 2502.09977, independent benchmark).
How far RAG has come by 2025
Most of the techniques that patch the basic form's weaknesses are now table stakes.
| Technique | What it does | Evidence |
|---|---|---|
| Hybrid search | Combines vector search with BM25 keyword search | Contextual Retrieval numbers below |
| Reranking | Re-orders a broad candidate set with a separate model | Same |
| Contextual Retrieval | Uses an LLM to prepend each chunk with "where this chunk sits in the document" before embedding and BM25 | Anthropic, 2024-09 |
| Late chunking | Runs the whole long document through the embedding model first and splits into chunks afterwards | Jina AI, 2409.04701 |
| Agentic retrieval | An agent picks the retrieval unit (chunk or file) and index per query | LlamaIndex, 2025-05 |
In Anthropic's own experiments (averaged over codebases, fiction, papers and more; metric is the top-20 retrieval failure rate), failures dropped as follows. These are vendor-reported numbers.
| Setup | Top-20 retrieval failure rate | Reduction |
|---|---|---|
| Baseline embeddings | 5.7% | — |
| + Contextual Embeddings | 3.7% | 35% |
| + Contextual BM25 (hybrid) | 2.9% | 49% |
| + Reranking | 1.9% | 67% |
In the late chunking authors' own experiments (average nDCG@10 over 3 models × 4 BeIR datasets), the gain was modest: 2.7–3.6% relative (1.5–1.9 points absolute). The authors state that it doesn't help on synthetic datasets where a short answer is planted in unrelated text, and that naive chunking with large chunks did better on some reading-comprehension tasks. Treat it as a small gain with no extra LLM calls, not a silver bullet.
The system from this blog's Building a hybrid semantic + keyword search RAG post (Dense + Sparse + RRF, a BGE reranker, contextual chunking) is exactly this "2025-style RAG".
What "RAG is dead" actually rests on
"RAG is dead" comes back every time a longer-context model ships. Read the posts that say it, though, and the target is narrow.
- LlamaIndex's post is titled "RAG is dead, long live agentic retrieval", but the heading of its conclusion reads "Naive RAG is dead": agentic retrieval strategies are now table stakes. It is a product tutorial with no quantitative evidence.
- Hamel Husain's series (2025-07) likewise says the thing that deserves criticism is "the oversimplified version from 2023: chuck documents into a vector database, do cosine similarity". Models are frozen at training time, and a million-token window doesn't change the economics of stuffing everything into every query.
So since 2025 the debate has moved from "do we need retrieval?" to "what kind of retrieval, and how smart?"
CAG — preload and cache
What the original paper says
CAG comes from Chan et al., "Don't Do RAG: When Cache-Augmented Generation is All You Need for Knowledge Tasks" (arXiv 2412.15605, v1 2024-12-20, v2 2025-02-23). It appeared as a 5-page short paper in the ACM Web Conference 2025 (WWW '25) Companion.
The paper's definition matches the infographic: preload all relevant material into a long-context LLM, store the resulting KV cache, and answer at inference time without retrieval. The paper's three phases are:
- External Knowledge Preloading — run all documents through the model to build the KV cache and store it on disk or in memory
- Inference — load the stored cache together with the question and generate an answer
- Cache Reset — truncate the tokens the question appended, returning the cache to its initial state
The infographic's 01 and 02 split phase 1 in two, and its 03 "Answer instantly" corresponds to phase 2. Phase 3, Cache Reset, is missing. It's the operational step that keeps the cache from growing with every question, and real implementations need it.
💡 What is a KV cache? As a transformer processes tokens, each layer computes Key and Value tensors. When the same prefix is processed again, reusing those tensors skips that much computation. CAG applies this reuse to the entire set of knowledge documents.
The experiments are narrower than the title
The title says "Don't Do RAG", but the experimental scope is small (arXiv v2 full text, official implementation).
- Model: Llama 3.1 8B only (up to 128k input tokens). The paper's own introduction cites this model's effective context length as 32K, and the medium and large HotPotQA sets it tested (43k and 85k) are longer than that.
- Data: corpora of 21k–85k tokens drawn from SQuAD 1.0 and HotPotQA. The full HotPotQA set (7,405 documents, about 10 million tokens) doesn't fit in the window, so only subsets were used.
- Metric: BERTScore only. No EM or F1.
- RAG baselines: BM25 (sparse) and OpenAI embeddings (dense) at top-1/3/5/10. No reranker and no hybrid search.
Accuracy: small margins, and a reversal on the largest set
BERTScore from v2 Table 2:
| Dataset (size) | CAG | Best RAG |
|---|---|---|
| HotPotQA Small (21k) | 0.7951 | 0.7676 (sparse top-5) |
| HotPotQA Medium (43k) | 0.7821 | 0.7633 |
| HotPotQA Large (85k) | 0.7407 | 0.7535 (sparse top-5) |
| SQuAD Large (50k) | 0.7734 | 0.7658 |
CAG wins most settings, but by 0.01–0.03. On the largest set, HotPotQA Large, it falls below BM25 RAG top-3 and top-5. The authors attribute the shrinking gap to long-context degradation, and concede that sparse beating dense suggests the datasets may not be hard enough.
Latency: "answer instantly" compared to what?
The infographic's "very low latency" is the phrase to be most careful with. Here is v2 Table 3 (HotPotQA, seconds).
| Size | CAG | Whole documents, no cache | BM25 RAG top-3 (retrieval + generation) |
|---|---|---|---|
| Small (21k) | 0.85 | 9.32 | ~0.74 |
| Medium (43k) | 1.41 | 26.37 | ~0.72 |
| Large (85k) | 2.26 | 92.08 | ~0.67 |
- The dramatic 10–40× speedups are against feeding the whole documents every time without a KV cache, not against RAG (ratios are my arithmetic from the table).
- BM25 RAG top-3 is faster than CAG at every size, about 3.4× at Large. The only baseline CAG consistently beats is dense RAG top-10 (about 3 seconds).
- CAG's own generation time grows with knowledge size: 0.85 → 1.41 → 2.26 seconds.
The abstract's precise wording is that CAG "eliminates retrieval latency". Having no retrieval step is not the same as having the fastest end-to-end response.
The line the authors drew themselves
The paper does not claim to replace RAG outright.
- Scope: knowledge of "limited and manageable size". The examples are internal knowledge bases of small companies, FAQs, and call centers.
- Limitations: because every document has to be in the context, it becomes impractical for significantly larger datasets, and performance may degrade with very long contexts.
- Conclusion: a hybrid that "could preload a foundation context and use retrieval only to augment edge cases or highly specific queries".
The paper also leaves things out. Cache invalidation when documents change, cache staleness, token cost, and API prompt caching do not appear in it. The infographic's "Stable" condition isn't in the abstract either. It follows from the cache being a snapshot of the documents, though, and a follow-up paper (Agrawal et al., 2505.08261) states it outright: a static preload reflects the knowledge base at one point in time, and later updates are invisible until the cache is rebuilt.
Since 2025: "if it fits, it works" is under pressure
CAG's core assumption is that if the knowledge fits in the window, the model will use it well. Research since 2025 attaches conditions to that.
① Context Rot (Chroma, 2025-07-14) — The report evaluated 18 models, including GPT-4.1, Claude 4, Gemini 2.5, and Qwen3. Holding task difficulty fixed and only increasing input length, performance dropped in every experiment.
- In a LongMemEval-based experiment, focused inputs holding only what was needed (about 300 tokens on average) beat full inputs that included irrelevant chat history (about 113k tokens on average) by a significant margin for every model. The gap remained with thinking mode on.
- A single distractor — a sentence on the same topic as the answer that isn't the answer — lowered performance, and the effect grew with input length. The more documents you preload, CAG-style, the higher the risk of "similar but wrong" information mixed in.
- Two caveats. The report did not reproduce a "lost in the middle" position effect (no notable difference across 11 positions), so lumping context rot and lost-in-the-middle together is inaccurate. And its conclusion is not "RAG is better" but "whether relevant information is present matters less than how it is presented". It is also a non-peer-reviewed report from a vector database vendor.
② LaRA (2025-02, independent benchmark) — A benchmark comparing RAG with long context: 2,326 cases, 7 open-source and 4 proprietary models. Its conclusion is in its subtitle: "No Silver Bullet".
- At 32k, long context averaged 2.4% higher; at 128k it reversed, with RAG 3.68% higher.
- The weaker the model, the more RAG helps (at 128k, RAG was 38.12% higher for Mistral-Nemo-12B). Models strong at long context, such as GPT-4o and Claude 3.5 Sonnet, generally did better with the full input.
- Hallucination detection was the only task where RAG clearly won regardless of model size. Long context led on reasoning and comparison.
- Note that the RAG side was a basic setup: 600-token chunks × 5, no reranking.
③ The Token Tax (2026-06, independent academic case study) — A study comparing RAG and long context on manufacturing safety-training manuals (gpt-5.4-mini/nano, 972 answers).
- Feeding the whole document every time scored 73.1% correct versus 65.4% for semantic RAG, 7.7 points higher, and the difference was statistically significant (McNemar p=0.0049).
- But input tokens per query were about 247,754 versus 8,399, roughly 26×. The cost estimate does not include prompt-caching discounts.
- Latency was 4.69 seconds on average for long context and 5.09–5.40 seconds for RAG, with no significant difference. Neither "more tokens means slower" nor "no retrieval means much faster" held up in this measurement.
- The authors recommend a hybrid: cheap RAG as the default, with long context reserved for when RAG confidence is low, multi-hop synthesis is needed, or the document set is small enough.
KV cache vs API prompt caching — same principle, different operating conditions
The paper's KV cache assumes self-hosted inference with direct access to the model's internal state; the official implementation saves the KV cache to a file (--kvcache file). For most teams using Claude, GPT, or Gemini through an API, CAG is implemented with prompt caching instead. The principle is the same: the provider reuses the KV tensors of an identical prefix (Lumer et al., 2601.06007). The operating conditions are not.
| CAG in the paper (self-hosted) | API prompt caching | |
|---|---|---|
| Cache lifetime | You manage it; permanent if saved to disk | Has a TTL. Claude: 5 minutes by default, 1 hour as a paid option, refreshed on each use. OpenAI: from minutes up to 24 hours |
| Invalidation | Recompute when documents change | Any difference in the prefix, even one character, misses everything after it |
| Cost | GPU memory (the size of the cache) | On Claude, writes cost 1.25× (5 min) / 2× (1 hour), reads 0.1×. Cache hits aren't free. Gemini's explicit caching adds a storage-time fee |
| Latency gain | Skips prefill | Only time to first token (TTFT) improves. Claude's docs state caching has no effect on output generation |
| Minimum size | None | Per-provider/model minimum token counts (e.g. 1,024 tokens) |
Sources: Claude prompt caching docs, OpenAI prompt caching guide, Lumer et al., 2601.06007. Prices and TTLs change often, so check the official docs again before adopting.
There is also independent measurement of prompt caching itself. PwC authors' "Don't Break the Cache" (2601.06007, 2026-01, not peer-reviewed) measured agent sessions with a 10,000-token system prompt:
- Prompt caching cut API cost by 41–80% and improved TTFT by 6–31% (the abstract says 13–31%, but Section 4.1 and the table include Gemini at 6.1%).
- Savings grew with the size of the cacheable prefix: at a 50,000-token prompt, 89% for GPT-5.2 and 88% for Claude Sonnet 4.5. This is the data point closest to a CAG-style "large, stable prefix".
- Caching everything was not always faster. With full-context caching, GPT-4o's TTFT got 8.8% worse than no caching, while caching only the system prompt improved it by 30.9%. The authors attribute this to the cost of writing dynamic content that never gets reused. Claude Sonnet 4.5 didn't show the regression, so the effect depends on the provider.
- The study measured only cost and latency, not answer accuracy.
For reference, Anthropic already advised in September 2024 that "if your knowledge base is smaller than 200,000 tokens (about 500 pages of material), you can just include the entire knowledge base in the prompt" (Contextual Retrieval). An official vendor guide stated CAG's selection rule before the CAG paper did. The same company's prompt caching docs present caching and retrieval as complements, not alternatives: give tools, instructions, and retrieved documents their own cache breakpoints, and you can update the RAG documents without breaking the earlier cache.
KAG — reason over a graph
KAG is a proper noun, not a generic term
The infographic puts KAG next to RAG and CAG as if it were a generic technique. But KAG is the name of a specific framework the Ant Group knowledge graph team (with Zhejiang University) built on the OpenSPG engine (Liang et al., arXiv 2409.13731, 2024-09; OpenSPG/KAG, Apache-2.0). The generic category of "using a knowledge graph to help generation" is usually called GraphRAG, which includes Microsoft GraphRAG, LightRAG, HippoRAG 2, and others. Graph RAG benchmark papers also mention KAG as one method within the GraphRAG family (GraphRAG-Bench, 2506.05690).
So the infographic's KAG column is best read as a mix of "the product called KAG" and "the category called GraphRAG".
The real architecture doesn't use the graph alone
The paper defines KAG by five elements:
- LLM-friendly knowledge representation (LLMFriSPG) — a schema aligned with the DIKW hierarchy
- Mutual indexing between the graph and source text chunks — graph nodes point to chunks, and chunks point back to the graph
- A logical-form-guided hybrid reasoning engine
- Knowledge alignment through semantic reasoning
- Model capability enhancement for KAG
As modules, it is KAG-Builder (offline index construction) / KAG-Solver (solving) / KAG-Model. The README still says kag-model will be released later.
The infographic's three steps (build a graph → reason step by step → traceable answer) simplify elements 2 and 3. Two things in particular differ.
- "Walking the graph" isn't the whole story. The Solver uses three kinds of operators — planning, reasoning, and retrieval — to turn a question into a solution process mixing natural language and logical functions. Each step is one of
Retrieval(structured + unstructured retrieval),Math(numeric computation),Deduce(inference), orOutput, and Math and Deduce are not graph traversal (KAG-Thinker, 2506.17728). - It doesn't drop vector retrieval. The paper's stated motivation is to use the strengths of both knowledge graphs and vector retrieval. The infographic's "RAG vs KAG" framing oversimplifies; KAG is closer to a hybrid that contains RAG.
Performance numbers: mostly vendor-reported
F1 from the original paper (DeepSeek-V2 backbone, 1,000 questions each):
| Dataset | IRCoT + HippoRAG | KAG | Relative F1 gain |
|---|---|---|---|
| HotpotQA | 63.7 | 76.2 | 19.6% |
| 2WikiMultiHopQA | 57.1 | 76.2 | 33.5% |
| MuSiQue | 36.5 | 48.7 | — |
⚠️ The abstract on the arXiv listing page says "19.6% on 2wiki and 33.5% on hotpotQA", with the datasets swapped. The version consistent with the table's arithmetic is the one in the paper body (HotpotQA 19.6%, 2Wiki 33.5%). The body's "F1 improvements of 12.5%, 19.1%, 12.2%" are absolute point differences, not relative gains.
The vendor's own 2025 release-note benchmark (10k documents and 1k questions provided by HippoRAG, Qwen2.5-72B, bge-m3) looks like this (KAG 0.8 release notes, 2025-06-27).
| EM / F1 | Naive RAG | HippoRAG 2 | PIKE-RAG | KAG-V0.8 |
|---|---|---|---|---|
| MuSiQue | 0.248 / 0.357 | 0.289 / 0.404 | 0.383 / 0.498 | 0.432 / 0.569 |
| 2Wiki | 0.448 / 0.512 | 0.542 / 0.618 | 0.630 / 0.720 | 0.692 / 0.784 |
| HotpotQA | 0.566 / 0.704 | 0.557 / 0.694 | 0.558 / 0.686 | 0.625 / 0.772 |
Note that on HotpotQA, Naive RAG beats the graph-based HippoRAG 2 and PIKE-RAG on EM and F1. Graph methods don't always beat plain RAG. Microsoft GraphRAG and LightRAG are not in this table.
There are also Ant Group's internal production numbers. On e-government Q&A (492 samples), NaiveRAG had precision 66.5 / recall 52.6 versus KAG at 91.6 / 71.8. Precision rose sharply, but recall is around 70%, so "greatly reduces wrong answers" is more accurate than "solves professional-domain Q&A".
KAG since 2025
| Version | Date | Highlights |
|---|---|---|
| v0.6 | 2025-01-07 | Domain knowledge injection, schema customization, summarization tasks |
| v0.7 | 2025-04-17 | Framework refactor, static/iterative planning, MCP compatibility, lightweight construction mode |
| v0.8.0 | 2025-06-27 | KAG-Thinker model adaptation, full MCP support, multiple index types |
- Lightweight construction (v0.7): The KAG team itself calls graph construction cost "the community's biggest concern". A new mode builds with a 7B model and answers with a 72B model; it cut the token cost of constructing a 100,000-character document from ¥4.63 to ¥0.479 (89%), with accuracy dropping 1.2–3.1% depending on the benchmark (vendor-measured).
- Multiple indexes (v0.8): Instead of a single knowledge graph, KAG now chooses among KnowledgeUnit (an enhanced graph triple), Outline, Summary, Chunk, AtomicQuery, Table, and other index types. The release notes describe choosing an index type as a trade-off between construction cost and effectiveness. That's much broader than the infographic's single line "Build a knowledge graph".
- KAG-Thinker (2025-06): Extends KAG into a multi-turn thinking framework, with a small dedicated LLM (7B) handling question decomposition and solving. Across 7 QA benchmarks it reports average EM 4.1 points above the previous best trained search model (ReSearch) — author-reported, and the training data overlaps two of the test benchmarks. The paper itself says that switching to the 7B Thinker improves stability but lowers average accuracy versus the 72B planner, and that Math and Deduce execution still relies on the 72B model.
- As of 2026-12-05 on GitHub, the latest tagged release is still v0.8.0. Commits continue, but there has been no new tag for nearly a year and a half, so check the maintenance status before adopting it.
What independent benchmarks say about graph RAG
I couldn't find an independent benchmark that includes KAG itself. But two 2025 studies comparing the GraphRAG category as a whole are good yardsticks for reading the KAG column.
① RAG vs. GraphRAG: A Systematic Evaluation (Han et al., 2502.11371, KDD '26)
- A complementary relationship with no universal winner. RAG is better on single-hop and detail-oriented factual queries, GraphRAG on multi-hop and reasoning-heavy ones. The gaps are a few points.
- Extracted graphs are incomplete. Only 65.8% (HotpotQA) and 65.5% (NQ) of answer entities appeared in the LLM-built graph. Retrieving from triples alone cut F1 to about half of RAG's (HotpotQA 25.02 vs 60.04). The biggest pitfall hidden behind "Build a knowledge graph" is missed extractions.
- Construction cost: On MultiHop-RAG, construction took 135 seconds for RAG versus 7,702 seconds for KG-GraphRAG (about 57×). Performance is sensitive to the model that builds the graph (no graph 65.77 → built with GPT-4o-mini 71.17 → built with GPT-4o 75.08), so higher quality costs more.
- Graph summarization (Community-GraphRAG Global) scored 19.27% on queries whose correct answer is "insufficient information" (RAG: 96.01%). Losing fine-grained evidence increases hallucination.
② When to use Graphs in RAG / GraphRAG-Bench (Xiang et al., 2506.05690)
- On simple fact retrieval, basic RAG (with reranking) matches or beats graph methods. On the Novel dataset: RAG 60.92 vs MS-GraphRAG 49.29, LightRAG 58.62, HippoRAG2 60.14.
- Graphs lead on complex reasoning, but unevenly. On Novel, HippoRAG2 scored 53.38 vs RAG 42.93, a clear gap; on Medical the gap was about 3 points, and MS-GraphRAG and others actually scored below RAG.
- Token bloat: average prompt tokens per query were 879 for vector RAG, 1,008 for HippoRAG2, and 38,707 for MS-GraphRAG (local).
- Indexing cost: indexing one book of about 56k tokens took MS-GraphRAG about 650k tokens and HippoRAG2 about 330k tokens (with GPT-4o-mini).
The conditions on "Traceable answer"
Because KAG's solution process is recorded as logical forms, it is genuinely easier to trace which step relied on what. But traceable doesn't mean correct. Section 6 of the paper lists these limitations itself:
- Both construction and solving need multiple LLM calls, and because the planning stage outputs logical functions as well as sub-questions, it generates about twice the tokens of simple decomposition.
- OpenIE lowers the bar for graph construction but makes knowledge alignment harder; expert-schema extraction is rigorous but labor-intensive. Wrongly extracted knowledge turns straight into wrong answers.
What the infographic leaves out
| Approach | Infographic wording | Missing condition or pitfall | Evidence |
|---|---|---|---|
| RAG | Chunk & embed | Chunks lose context; Contextual Retrieval and late chunking address it | Anthropic, Jina AI |
| RAG | Retrieve top matches | Vector top-k alone isn't enough; hybrid + reranking is the production default | Anthropic, LlamaIndex |
| RAG | (multi-hop) | Weakest on comparison questions that need several distant chunks | LaRA |
| CAG | Small enough to fit | Even when it fits, quality drops as it grows; a single distractor hurts | Chroma, the CAG paper itself |
| CAG | Save the KV cache | APIs have a TTL; any prefix change misses the whole cache; write premium | Claude and OpenAI docs |
| CAG | Answer instantly | The big speedup is versus uncached full input; slower than BM25 RAG | CAG paper Table 3 |
| CAG | (three steps) | The Cache Reset step is missing | CAG paper |
| CAG | (cost) | Per-query token cost scales with what you preload; about 26× RAG without caching | Token Tax |
| KAG | (the name) | A specific Ant Group framework, not a category; the category is GraphRAG | KAG paper, GitHub |
| KAG | Build a knowledge graph | Construction cost (tens of times RAG's time), missed extractions (only ~65% of answer entities present), schema labor | RAG vs GraphRAG, KAG paper |
| KAG | Reason step by step | Not just graph traversal: a hybrid of vector retrieval, computation, and inference | KAG paper, KAG-Thinker |
| KAG | Traceable answer | Traceable ≠ correct; most numbers are vendor-reported | KAG paper Section 6 |
Which one, when?
Turned into practical questions, the infographic's "Search it · Preload it · Reason over it" looks like this.
| Question | Leans RAG | Leans CAG (prompt caching) | Leans GraphRAG/KAG |
|---|---|---|---|
| Knowledge size | Larger than the context window | Fits comfortably in part of the window (Anthropic's guide: under 200k tokens) | Structure matters more than size |
| Change rate | Changes often (incremental indexing) | Rarely changes (rewrite the cache when it does) | Changes occasionally (accept rebuild cost) |
| Question type | Single facts, detail lookup | Summaries and comparisons across whole documents | Multi-hop across entities |
| Latency | Adds a retrieval step | Shorter TTFT on a cache hit | Longest, from planning and repeated calls |
| Cost | Low per query, cheap indexing | Per query, scales with preloaded size (cache reads are billed) | Highest construction cost |
| Explainability | Cite the retrieved chunks | Unclear which part the answer relied on | Solution steps recorded as logical forms |
| Model dependence | Helps even weak models a lot | Needs a model strong at long context | Needs a large model good at planning |
As a decision flow:
Does the knowledge fit comfortably in the context window? (tens of thousands of tokens)
├─ Yes → Does it change often?
│ ├─ No → Load it all and use prompt caching (CAG)
│ │ └─ Answers wobble? → Insert only the relevant parts (counter context rot)
│ └─ Yes → Cache the stable part + retrieve the changing part (hybrid)
└─ No → Default to hybrid search + reranking RAG
└─ Many multi-hop / relationship questions, and accuracy matters more than cost?
├─ Yes → Add a graph index (GraphRAG / KAG)
└─ No → Invest in better RAG first (Contextual Retrieval, agentic retrieval)Patterns for combining them
The evidence since 2025 points one way: this isn't a matter of picking one of three, but of combining them.
① Cache + retrieval — the most common pattern, with the most evidence.
- The CAG paper's conclusion: preload a foundation context and use retrieval only for edge cases.
- Anthropic's prompt caching docs: give tools, instructions, and retrieved documents separate cache breakpoints (up to 4), so changing the RAG documents keeps the earlier cache intact.
- The Token Tax paper: cheap RAG by default, long context only when confidence is low or multi-hop synthesis is needed.
- The simplest production form is caching the system prompt plus shared product knowledge (tens of thousands of tokens) and appending only question-specific retrieved details after it. As "Don't Break the Cache" showed, caching only the stable prefix gave the most consistent benefit.
② Graph + vector — KAG itself is this pattern.
- KAG cross-indexes the graph with the source chunks and chooses graph or text retrieval at each solving step.
- The RAG vs GraphRAG paper compared two hybrid strategies: Selection (+1.1%), which classifies the query and sends it one way, and Integration (+6.4%), which merges both sides' results (MultiHop-RAG, Llama 3.1-70B, versus the best baseline). Integration does better but has to run both pipelines on every query.
- A practical GraphRAG study (Min et al., 2507.03226) fuses vector similarity with 1-hop graph traversal via RRF, and extracts triples with dependency parsing instead of an LLM, reporting 94% of GPT-4o-based construction performance (61.87% vs 65.83%). This is a single-domain result (ABAP code migration).
③ Routing — send each question down a different path.
- That's why LaRA's subtitle is "No Silver Bullet for LC or RAG Routing": the answer depends on the model, context length, and task type, so you have to choose per query.
- LlamaIndex's
auto_routedmode uses a lightweight agent to pick chunk retrieval, whole-file retrieval, or metadata-based retrieval for each query.
This blog's LLM Wiki post sits in the same space: instead of searching the raw sources every time, the LLM organizes the knowledge into a wiki ahead of time (close to preloading), and can extend it into a knowledge graph (the graph side).
Wrapping up
The infographic's three-line summary is a good map for first thinking about how to get knowledge into the context. Checked against the original papers and research since 2025, though, it needs three additions.
First, the benefit claims hide their comparison baselines. CAG's "Answer instantly" is relative to uncached full input, not to RAG, and KAG's "Traceable" doesn't mean correct. When you cite a number, check what it was compared against and who measured it.
Second, "it fits in the window" and "the model uses it well" are different things. All 18 models got worse as input grew, and at 128k RAG overtook long context. The bigger context windows get, the more choosing what to put in them matters.
Third, the three are parts, not rivals. The CAG paper's conclusion proposes mixing in retrieval, KAG is built as a graph + vector hybrid, and every independent benchmark says there is no universal winner.
Checklist before adopting:
- ✅ Have you actually counted the tokens in your knowledge base? (Under 200k tokens, try loading it all first)
- ✅ If you use RAG, does it include hybrid search, reranking, and chunk context enrichment?
- ✅ If you use prompt caching, is the order stable content first, changing content last?
- ✅ Have you priced in cache TTLs, write premiums, and minimum token counts?
- ✅ Have you compared accuracy with the long context versus only the relevant parts on your own data?
- ✅ Before adding a graph, have you weighed the share of multi-hop questions against graph construction and maintenance cost?
- ✅ Have you separated vendor-reported numbers from independent benchmarks in what you cite?
References
Infographic
- GenAI.works, "RAG vs CAG vs KAG — How LLMs use knowledge they were never trained on" (infographic)
Original papers
- Chan et al., Don't Do RAG: When Cache-Augmented Generation is All You Need for Knowledge Tasks (arXiv 2412.15605, WWW '25 Companion, DOI) · official implementation
- Liang et al., KAG: Boosting LLMs in Professional Domains via Knowledge Augmented Generation (arXiv 2409.13731) · OpenSPG/KAG
Papers since 2025
- Zhang et al., KAG-Thinker: Interactive Thinking and Deep Reasoning in LLMs via Knowledge-Augmented Generation (2025-06)
- Li et al., LaRA: Benchmarking Retrieval-Augmented Generation and Long-Context LLMs — No Silver Bullet for LC or RAG Routing (2025-02)
- Han et al., RAG vs. GraphRAG: A Systematic Evaluation and Key Insights (2025-02, KDD '26)
- Xiang et al., When to use Graphs in RAG: A Comprehensive Analysis for Graph Retrieval-Augmented Generation (2025-06)
- Min et al., Towards Practical GraphRAG: Efficient Knowledge Graph Construction and Hybrid Retrieval at Scale (2025-07)
- Agrawal et al., Enhancing Cache-Augmented Generation (CAG) with Adaptive Contextual Compression for Scalable Knowledge Integration (2025-05)
- Lumer et al., Don't Break the Cache: An Evaluation of Prompt Caching for Long-Horizon Agentic Tasks (2026-01)
- Hamilton et al., The Token Tax of Epistemic Accuracy: Comparing RAG and Long-Context Architectures for Document-Grounded Generative AI Applications (2026-06)
- Günther et al., Late Chunking: Contextual Chunk Embeddings Using Long-Context Embedding Models (v3 2025-07)
Official docs · engineering blogs
- Chroma, Context Rot: How Increasing Input Tokens Impacts LLM Performance (2025-07-14)
- Anthropic, Introducing Contextual Retrieval (2024-09)
- Claude Docs, Prompt caching
- OpenAI, Prompt caching
- OpenSPG, KAG 0.8 release notes (2025-06-27)
- LlamaIndex, RAG is dead, long live agentic retrieval (2025-05)
- Hamel Husain, Stop Saying RAG Is Dead (2025-07)
Earlier posts