RAG vs. CAG vs. KAG: Evidence, Context, and Relationships

When AI answers from organizational knowledge, should we retrieve documents each time, preload them, or structure knowledge as a graph? Each approach has different costs and failure modes. Start with the nature of the data and the questions to answer.

A document archive, pre-opened files, and linked information cards represent retrieval, preloading, and knowledge relationships

Choose RAG, CAG, or KAG based on the data and evidence you need

If answers are scattered across many documents, start by evaluating RAG, which retrieves evidence for each question. CAG is worth testing when a small, stable knowledge set fits in context. KAG may suit questions that require following relationships and rules across several steps. These are KrobClick's criteria for choosing what to test, not a ranking. The approaches can work together, and none guarantees correct answers.

For a closer look at splitting documents and retrieving them before answering, read What Is RAG? Check Retrieval before Trusting AI Answers For the choice between supplying information and changing model behavior, read RAG and Fine-tuning

ApproachWhat to prepareWhen a question arrivesMain costs and maintenance
RAGContent and search indexesFind relevant evidence then create an answerSearch quality, index updates and document rights
CAG following the work of Chan et al.Document set in context and KV cacheUse prepared state alongside the questionLong context, memory, cache creation and replacement
OpenSPG's KAGKnowledge graph connected to text and indexPlan, retrieve, and solve problems using multiple operatorsDefine relationships, extract data, and check logic.

RAG: Retrieve information at query time, using more than just vectors if needed

RAG means Retrieval-Augmented Generation: retrieve information, then give relevant passages to the model as it answers. Many systems split documents into chunks, create embeddings and search a vector index. Keyword search, hybrid search and metadata filters are also options. RAG does not require one particular vector database.

You need not put the whole library into every request. But the number of documents a system can handle depends on its index, infrastructure and workload. Freshness depends on adding new documents and removing old ones promptly. If a manual changes but the index does not, the answer may still come from the old version.

When an answer is wrong, trace the path: did retrieval find the right document? Did the selected chunk include its conditions? Did the model interpret it correctly? Check the information flow before blaming the model alone.

CAG: Prepare reading state for reuse without creating permanent model memory

In the paper by Chan et al., CAG (Cache-Augmented Generation) starts with a knowledge set that fits in the context window. The model processes it in advance and stores a KV cache or computation state for subsequent questions. This removes retrieval from the question-time path; it does not permanently train the knowledge into the model's weights.

Researcher diagram comparing RAG through an IR Model with CAG preparing a Knowledge Cache before questions arrive
Original CAG-team diagram: the top uses an IR Model to retrieve at query time; the bottom prepares knowledge ahead of time. Pink marks inference-time work. It does not explain KAG or measure KrobClick performance. Source: hhhuang/CAG © 2024 Hen-Hsen Huang, Brian J Chan, Chao-Ting Chen and Jui-Hung Cheng used as MIT License Resized and converted to WebP without editing text. Open full size to read labels.

Without a retrieval step, there is no question-time ranking error. The model can still misread context, miss conditions or claim more than the evidence supports. Fitting all the documents into the context window does not mean the model uses every part well; space is also needed for the question, history and answer.

The cache has an upfront creation cost. When documents change, the reusable state must change too; users with different permissions must not share a cache containing material they cannot access. To compare speed, measure preparation, reuse and updates, not just the response time of a warm cache.

The study's results concern its selected datasets and models, not every document system. A service's prompt caching feature may also work differently from the CAG implementation in the paper; check the system you intend to use.

KAG: Use relationships with text search and calculations.

OpenSPG's KAG (Knowledge Augmented Generation) connects source text to a knowledge graph and plans the solution as a logical form. Steps can include text retrieval, following relationships, language-based reasoning and calculation. It does more than traverse a graph, and it can still use vector retrieval.

The KAG architecture prepares indexes and a knowledge base on the left, connected to a logical form solver that plans, retrieves, reasons, and generates answers on the right
OpenSPG diagram: the left prepares the knowledge base; the right combines Planning, Retrieval & Reasoning, and Generation, covering retrieval and reasoning. This describes the project's architecture, not proof that every answer step is correct. Source: OpenSPG / KAG Used according to Apache License 2.0 Converted PNG to WebP while preserving dimensions and text. Open full size to read labels.

Consider two legal entities with the same company name, or a rule that applies only during certain dates. A graph with typed relationships and supporting evidence can help trace those conditions. But an incorrectly extracted name, a wrong relationship or an expired rule can still produce a convincing-looking wrong answer.

KAG Research reports results on specific tests and use cases. They do not establish that this is the best approach for every medical, legal or financial task. Even when citations are traceable, a specialist must check the source, the dates when rules apply and the conclusion.

One hypothetical task reveals different costs

Suppose a support team uses Thai-language manuals to answer: 'Which documents does this request need, who approves it, and which policy version applies?' This is KrobClick's hypothetical exercise. We have not built or tested the example system.

The same workflow could retrieve the current manual with RAG, check the approval chain through a graph and cache the instructions that seldom change. You do not have to choose just one method.

Measure answer quality and cost before choosing an approach

Before choosing, test the same human-checked questions and answers across approaches. Include answerable questions, ones requiring several sources, missing information, conflicting documents and access restrictions. Keep the model and document versions as similar as possible. Record answers, evidence, index or cache versions and setup costs; otherwise differences in the data may masquerade as differences in architecture.

  1. Check the facts in the answers and compare them with the originals. Including missing conditions and answers beyond the evidence.
  2. Open the actual references; distinguish having a link from having a link that supports the claim
  3. Measure data preparation, time to first response, and completion time; separate first runs from repeat use
  4. Change one document and check that answers update, including resulting costs and maintenance
  5. Test unauthorized-access attempts and unanswerable questions; the system should refuse or explain limits without disclosing prohibited data

When an answer fails, determine whether retrieval, reading the context or a graph relationship caused it before adding complexity. Check that the system uses the right version, can trace its evidence and is affordable to maintain.

Research and original projects

Sources reviewed October 18, 2026, Thailand time. Based on research and documentation, not KrobClick benchmarks. Organizations are hypothetical. CAG and KAG follow the cited papers' definitions, not every similarly named product.