RAG vs Knowledge graphs (GraphRAG)
39 sourced facts · updatedRAG or a knowledge graph (GraphRAG): which retrieval should you use?
Start with plain RAG. Vector search is usually enough when a search engine could answer the question. Add a knowledge graph when answers depend on links between things: the graph becomes imperative at three or more hops, or when data must be aggregated across documents. It is not either-or: GraphRAG is RAG whose retrieval path includes a knowledge graph, and the sources advise using the graph and the vector layer together. [1][2][3]
In the knowledge graph: The walk is a retrieval path: vector search finds the seeds, the links do the rest.
The difference between RAG and Knowledge graphs (GraphRAG)
| RAG | Knowledge graphs (GraphRAG) | |
|---|---|---|
| How the knowledge is stored | As chunks of the documents, each filed twice: by meaning (a dense vector) and by exact words (a BM25 entry), with metadata such as page and section path. [4][5] | As entities and the links between them: a language model extracts triples from chunks, twins are merged, and each fact is tied to the sources it came from. [6][7] |
| How a question finds its answer | Vector and keyword searches run in parallel, the lists are fused and optionally reranked, and the top chunks go to the model. [8] | Vector search finds seed nodes, then the agent walks the links from them, for example with graph queries or a shortest path between two nodes. [9][10] |
| Questions that span many facts | Weak: a vector index sees only the top few chunks, and the limit of one-shot retrieval is that it cannot open a document, go to a table or verify the answer. [11] | Strong: similarity is not the same as a relationship, so vector-only lookup cannot follow long multi-hop chains; with GraphRAG the model writes a query and the graph runs it over all the data, so the answer is computed, not sampled. [12][13][14] |
| Exact words, names and numbers | Handled by the keyword half of the index: rulebook codes, message names and exact identifiers look like noise to an embedding but work as BM25 tokens. [15][16] | Handled by structure: the graph store fired Cypher queries from seed nodes where a vector store could not find the specific details in one demo. [17] |
| Tracing an answer to its source | By design: every answer can cite rulebook, section and page, and a filter can refuse citations that cannot be verified. Attaching sources afterwards does not help if retrieval pulled the wrong one. [18][19][20] | Built into the data: each fact links to its source episodes, so tracing it is a graph walk, and the answer shows which part of the graph produced it. Merging two entities must keep both sets of source links or lineage is lost. [7][21][22] |
| The cost of building it | Chunking is lossy: chunks that are too big blur the nuance and chunks that are too small lose the big picture. Dirty input makes meaningless chunks that slow retrieval and lower accuracy. [23][24] | A schema is needed: free-form triples give a graph not worth querying. Lineage and provenance are expensive to build, and a rerun of the builder wrote a second copy of every lesson. [25][26][27] |
| When the facts change | Parsing and embedding is a one-time cost per document, and the index holds the chunks as filed. [28] | Contradicting data does not erase the old fact: its edge gets an invalid-at date and the source episodes that changed it are recorded. A fact is deleted only when no remaining source supports it. [29][30] |
When to use RAG
- A search engine could answer the question. The sources say plain vector RAG usually suffices there, and hybrid search over the fused lists lifted hit rate from 92% to 97% over dense only on 63 retrieval questions, as the builders reported. [1][31]
- Your sources are documents to quote: every answer must cite the exact rulebook, section and page, and a check can refuse any figure that matches no registered source. [18][19]
- You do not want to design and maintain a schema first: a graph built from free-form triples is not worth querying, while chunks only need to be cut, labelled and filed. [25][4]
When to use Knowledge graphs (GraphRAG)
- Questions need three or more hops, or counts and aggregates across documents. Vector search always returns something, even when nothing is relevant, and for counts, averages and multi-hop questions it estimates and presents the estimate as fact. [1][13]
- The answer sits in how things connect. In a healthcare example, vector RAG gave generic advice about the patient, while the graph-grounded answer used a smoking history and an operation that similarity search had lost. [32][12]
- You need to audit where a fact came from, including rules over its sources: a tag set at ingestion is inherited by every fact derived from it, so a walk can filter for facts from verified sources. [33][22]
Using RAG and Knowledge graphs (GraphRAG) together
The two are layered. The vector search finds the seed nodes where the walk starts, a graph search then pulls their neighbours and ranks them, and the speaker advises using both graph and vector, not graph alone. [2][9]
Does reading a graph beat reading the files?
The sources disagree. One author claims about 71 times fewer tokens per query when a model reads a knowledge graph instead of the raw files, a figure commenters dispute. On a large code base another found the graph tool fiddly to set up, with no noticeable gain in output quality or time against ordinary code-intelligence tooling. [34][35][36]
Does an agent that greps files replace the ranked index in RAG?
The sources split. On about 20 bug tasks agentic search matched vector search in accuracy at a quarter of the cost. At scale, BM25 overtakes a file-system agent around 10 million tokens, and some argue agentic search sits on the index rather than replacing it. [37][38][39]