RAG vs CAG vs KAG: Three Ways to Give a Model Knowledge
Retrieval, cache-augmented and knowledge-augmented generation compared on corpus size, freshness and cost.
The short answer
RAG, CAG and KAG solve different knowledge shapes. If the missing part is knowledge that must come from a large or changing corpus, use RAG. If the missing part is a bounded stable corpus that fits the context window, use CAG. If the missing part is multi-hop entity logic over relationships, use KAG. The one question that decides it is below. As-of July 2026.
When should you use RAG vs CAG vs KAG?
The deciding frame is how the knowledge is structured and how often it changes. Unstructured knowledge that is larger than the window or changes frequently points to RAG. A stable unstructured corpus that fits the window and can be amortised through caching points to CAG. Structured relationships that require multi-hop reasoning point to KAG. CAG and its borders are handled on the architectures page, and the broader three-way trade-off lives on this page.
What’s the difference between RAG, CAG, and KAG?
RAG, CAG, and KAG differ by what they do instead of a single “retrieve then generate” step. They share the goal of grounding answers in external knowledge, but they ground that knowledge in different ways.
| Factor | RAG | CAG | KAG | Why |
|---|---|---|---|---|
| Corpus larger than the window | Favoured | Weak | Variable | RAG can search and fetch only what is needed at query time. |
| Knowledge changes often | Favoured | Weak | Variable | RAG can use fresher sources; CAG’s cached KV state must be rebuilt when the corpus changes. |
| Stable corpus that fits the window | Weak | Favoured | Variable | CAG can preload and cache the working set so queries skip retrieval. |
| Multi-hop entity relationships | Weak | Weak | Favoured | KAG routes reasoning through explicit relationships rather than similarity search. |
| Chunk-level citations | Favoured | Weak | Weak | RAG can point to retrieved passages; CAG has preloaded text; KAG grounds via graph facts. |
| Build complexity | Medium | Low-to-medium | High | CAG is a preprocessing and caching workflow; KAG needs entity and relationship structure. |
Chan et al. (2025) report example results for CAG and related retrieval setups on Llama 3.1 8B. On HotPotQA-small, CAG BERTScore is 0.7951 versus the best sparse RAG top-5 of 0.7676; on HotPotQA-large, sparse RAG top-5 is 0.7535 versus CAG 0.7407 with the gap narrowing as corpus size grows. For generation time, they report HotPotQA-small CAG generation at 0.8512 s versus dense RAG top-10 at 2.6608 s. They also discuss an in-context learning comparison without a precomputed KV cache on HotPotQA-large, reporting 92.0824 s versus 2.2631 s for CAG in their comparison setup. Their paper and companion materials also spell out the experimental boundaries for what these comparisons do and do not measure.
What does CAG stand for in AI?
CAG stands for Cache-Augmented Generation. In Chan’s definition, CAG preloads a curated corpus into a long-context model and caches the KV state so queries skip retrieval when the working set fits and stays stable.
When should you use both RAG and CAG?
Use both when a stable subset of knowledge can be cached or preloaded and the remaining long tail still needs retrieval. A common pattern is to use CAG (or a pre-cached knowledge block) for high-frequency stable content and use RAG for fresh or out-of-cache queries. If you are deciding whether hybrid is your best route, the point is not “CAG versus RAG”; it is “which parts should be cache-backed and which parts should be retrieved.”
What are the use cases for RAG, CAG, and KAG?
RAG fits large or frequently updated knowledge bases such as internal KB assistants, research/news, and any setting where you must retrieve and ground against passages. CAG fits FAQ-style procedures, product manuals, and other bounded stable corpora where latency on repeated queries matters. KAG fits questions whose answers depend on explicit relationships and multi-hop entity logic, such as entity-relationship style reasoning.
If you want the broader “what else can replace RAG” router, start with alternatives to RAG.
Is RAG or CAG the better choice?
Pick CAG when the knowledge is a bounded stable corpus that fits the context window and benefits from skipping retrieval. Pick RAG when the corpus is large, frequently changing, or you need to retrieve fresh passages at query time.
What does CAG stand for?
CAG stands for Cache-Augmented Generation. It caches the KV state of a preloaded corpus so queries can be answered without a query-time retriever.
Is CAG better than RAG?
It can be for bounded stable corpora, because it avoids query-time retrieval. It is usually not better for frequently changing knowledge, where CAG’s cached state must be rebuilt and retrieval is the safer grounding path.
Can I use RAG and CAG together?
Yes. Many systems cache or preload stable high-frequency content with CAG and fall back to RAG for fresh or out-of-cache requests. The design question is which parts of your knowledge should be cache-backed versus retrieved.
How is KAG different from GraphRAG?
KAG is a knowledge-augmented path that emphasizes explicit relationships and multi-hop entity logic. GraphRAG is typically described as a retrieval architecture built around graph-structured indexes and traversal; it is not the same definition as KAG in the three-way RAG/CAG/KAG framing.