Frontier Foundry

RAG vs Knowledge graphs (GraphRAG)

39 sourced facts · updated

RAG 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)

RAGKnowledge graphs (GraphRAG)
How the knowledge is storedAs 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 answerVector 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 factsWeak: 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 numbersHandled 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 sourceBy 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 itChunking 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 changeParsing 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]

Each one on its own

from their concept pages

What is RAG?

Retrieval-augmented generation looks up relevant documents when a question arrives and places them in the prompt. The model then answers from that text and not from memory alone. It gives a model current and private facts without retraining, and the answer is only as good as what was fetched.

Retrieval-augmented generation fetches relevant pieces of a document set at question time and puts them in front of the model. The sources describe a pipeline: documents are cut into chunks and filed by meaning and by exact words; a question fetches a short list, merged and reranked; the model answers from it and a check can refuse figures it cannot trace. Its limits are a short desk, a chunk size no one gets right for every query, and answers that can come from the wrong page.

about 2,000 characters
Size a chunk is packed to before it is cut, in one rulebook assistant (reported by the builders) Nina Žižakić
top 50 + top 50 to 30 to 10
Candidates per list, kept after fusion, and given to the agent (reported by the builders) Eleonora Drykina
2 to 4 calls
Search calls most questions need; the prompt asks the agent to reconsider before the sixth (reported by the builders) Eleonora Drykina

RAG, explained in full: how it works as a machine, every part and its sources.

What is Knowledge graphs (GraphRAG)?

A knowledge graph stores facts as things and the links between them: this person works at that company, which makes this product. An agent can follow the links to answer questions that need several hops. It gives structure that a pile of documents lacks, and it has to be built and kept current.

A knowledge graph stores facts as entities and the links between them, built from text by a language model and queried by walking the links. The sources describe building it (extract, merge twins, tie each fact to its source), and reading it (seed by similarity, walk the links, hand back the path). What they warn about is a graph full of twins and facts that cannot say where they came from.

43M papers, 157M entities, 3B triplets
Size of one research knowledge graph built from papers in 26 disciplines, as reported by its authors Hugging Face
3 hops
Depth at which the speaker says GraphRAG becomes imperative over vector-only RAG Nyah Macklin

Knowledge graphs (GraphRAG), explained in full: how it works as a machine, every part and its sources.

In AI coverage over the last four weeks, RAG took 0.81% and Knowledge graphs (GraphRAG) 0.28%. RAG, week by week

The facts behind this page

39 facts from the two knowledge packs
  1. GraphRAG is RAG whose retrieval path includes a knowledge graph; plain vector RAG usually suffices when a search engine could answer, and the graph becomes imperative at three or more hops or when data must be aggregated across documents. Nyah Macklin, AI Engineer · 2026-06-29 · Knowledge graphs (GraphRAG)
  2. The speaker advises using both graph and vector, not graph alone: the graph does not replace the vector layer, and together they give the benefits of both. Nyah Macklin, AI Engineer · 2026-06-29 · Knowledge graphs (GraphRAG)
  3. 3 hops: Depth at which the speaker says GraphRAG becomes imperative over vector-only RAG Nyah Macklin, AI Engineer · 2026-06-29 · Knowledge graphs (GraphRAG)
  4. Each chunk gets metadata: rulebook name, page, section path and chunk index, so a citation card can link to the PDF and a section or rulebook can be put back together. Nina Žižakić, AI Engineer · 2026-10-12 · RAG
  5. Every chunk is embedded two ways, as a dense vector and as a BM25 entry. Nina Žižakić, AI Engineer · 2026-10-12 · RAG
  6. A graph is built from text in five moves: gather the sources, split them into chunks, embed each chunk, have a language model extract entities and relationships, then write the graph. Nyah Macklin, AI Engineer · 2026-06-29 · Knowledge graphs (GraphRAG)
  7. A fact is a graph triple of two entities and the edge between them; the sources it came from are linked to it as episodes, so tracing a fact to its source is a graph walk. Daniel Chalef, AI Engineer · 2026-07-02 · Knowledge graphs (GraphRAG)
  8. In a managed RAG pipeline the query is optionally rewritten and embedded, vector and keyword search run in parallel, the lists are fused and optionally reranked, and the top chunks are either returned or passed to a generation model. cloudflare · 2026-10-01 · RAG
  9. In a demo the vector search finds the seed nodes where the walk starts; a graph search then pulls their nearest neighbours and ranks them by how related they are. Stephen Chin, AI Engineer · 2026-07-02 · Knowledge graphs (GraphRAG)
  10. Between two known nodes, a shortest-path walk returns the intermediate nodes as context; neither vector search nor symbol lookups would have found them, and working them out by hand was slow. Tim Ainge, AI Engineer · 2026-06-29 · Knowledge graphs (GraphRAG)
  11. The limit of one-shot chunk retrieval: an index may find the right document but cannot open it, go to the table, read the surrounding context or verify the answer, so the model must answer from whatever the first retrieval selected. mistral · 2026-08-20 · RAG
  12. Similarity in vector space is not the same as a relationship, so vector-only lookup returns related-looking facts, makes silly mistakes and cannot follow long multi-hop chains. Stephen Chin, AI Engineer · 2026-07-02 · Knowledge graphs (GraphRAG)
  13. Vector search always returns something, even when nothing is relevant, and sees only the top few chunks, so for counts, averages and multi-hop questions it estimates and presents the estimate as fact. Elizabeth Fuentes Leone, AI Engineer · 2026-06-29 · Knowledge graphs (GraphRAG)
  14. With GraphRAG the model writes a Cypher query and the graph runs it over all the data, so the model gets a computed, verifiable answer instead of a sample, and spends only the answer tokens. Elizabeth Fuentes Leone, AI Engineer · 2026-06-29 · Knowledge graphs (GraphRAG)
  15. Dense search is good for meaning, but rulebook codes, message names and exact identifiers look like noise to an embedding; BM25 is the mirror image: exact tokens work, paraphrases do not. Eleonora Drykina, AI Engineer · 2026-10-12 · RAG
  16. For a product or medical assistant exact keywords and numbers matter more than the nearest meaning, so semantic and keyword search are used together. Abed Matini, AI Engineer · 2026-06-29 · RAG
  17. Over the same data, a vector store could not find the specific details while the graph store fired Cypher queries from the seed nodes, took one-hop steps, kept the winning nodes in context and named the exact exposed host and its old operating system. Stephen Chin, AI Engineer · 2026-07-02 · Knowledge graphs (GraphRAG)
  18. Every answer must cite the exact rulebook, section and page, and the assistant must not answer from the model general knowledge of other payment schemes. Nina Žižakić, AI Engineer · 2026-10-12 · RAG
  19. A post-processing filter refuses citations that cannot be verified, so a number that is not cited cannot appear in the output. Vinoo Ganesh, AI Engineer · 2026-10-25 · RAG
  20. The wrong source, the wrong number. Attaching sources after the fact does not help when retrieval pulled the wrong source (a blog with a wild price), or the right source and the wrong number: a 17 in a filing may be millions, billions or yen, or an earlier year. Vinoo Ganesh, AI Engineer · 2026-10-25 · RAG
  21. When two entities merge, the merged entity must keep the source links of both, or a source is silently dropped and the lineage is lost. Daniel Chalef, AI Engineer · 2026-07-02 · Knowledge graphs (GraphRAG)
  22. A graph answer is accurate, explainable, because you can look at the graph that came back, and auditable, because it shows which part of the graph produced the answer. Stephen Chin, AI Engineer · 2026-07-02 · Knowledge graphs (GraphRAG)
  23. Chunking is lossy compression: chunks that are too big blur the nuance in their embedding, chunks that are too small lose the big picture, so no single size is right. Yuval Belfer, AI Engineer · 2026-06-30 · RAG
  24. Uploading a whole handbook uncleaned yields meaningless chunks (acknowledgements, a signature date) that slow retrieval, lower accuracy and raise hallucination. Abed Matini, AI Engineer · 2026-06-29 · RAG
  25. Asked for free subject-predicate-object triples, an extractor returns a graph that is not worth querying; given a schema to fill, node and edge types are consistent and relationships can be queried. Tim Ainge, AI Engineer · 2026-06-29 · Knowledge graphs (GraphRAG)
  26. Lineage and provenance are expensive: building the graph the way the speaker does costs a great deal, and the team has worked to cut the cost and latency of generating graph artifacts. Daniel Chalef, AI Engineer · 2026-07-02 · Knowledge graphs (GraphRAG)
  27. Rerun the builder, double the lessons. In a live workshop the agent was asked how many lessons a course has and answered 30. The graph held 15 lessons: the speaker had run the graph builder a second time and it had written a second copy of each. Nyah Macklin, AI Engineer · 2026-06-29 · Knowledge graphs (GraphRAG)
  28. An embedding is cached compute: parsing and embedding a codebase is a one-time cost, and at run time the agent queries it and saves tokens, time and money. AI Engineer · 2026-04-10 · RAG
  29. When new data contradicts a stored fact, the edge gets an invalid-at date and the source episodes that changed it are recorded, so the old fact is dated, not erased. Daniel Chalef, AI Engineer · 2026-07-02 · Knowledge graphs (GraphRAG)
  30. A fact is deleted only when no remaining source episode supports it, so deleting one of three sources keeps a fact that two others still back. Daniel Chalef, AI Engineer · 2026-07-02 · Knowledge graphs (GraphRAG)
  31. 92% to 97%: Hit rate of hybrid search over dense only on 63 retrieval questions (reported by the builders) Eleonora Drykina, AI Engineer · 2026-10-12 · RAG
  32. In a healthcare example a plain model gave generic care advice and vector RAG gave generic advice about the patient; the graph-grounded answer used the patient history of smoking and an operation that the similarity search had lost. Stephen Chin, AI Engineer · 2026-04-10 · Knowledge graphs (GraphRAG)
  33. A tag set on a source episode at ingestion is inherited by every entity and fact derived from it, so a later walk can filter for facts from verified sources. Daniel Chalef, AI Engineer · 2026-07-02 · Knowledge graphs (GraphRAG)
  34. Does reading a graph beat reading the files? A graph of the files cuts tokens per query by about 71 times, in the author claim. AINews · 2026-06-30 · Knowledge graphs (GraphRAG)
  35. ~71x fewer tokens: Author claim for tokens per query when a model reads a knowledge graph instead of the raw files; disputed by commenters AINews · 2026-06-30 · Knowledge graphs (GraphRAG)
  36. Does reading a graph beat reading the files? On a large code base the graph tool was fiddly to set up and did not noticeably improve output quality or save time against ordinary code-intelligence tooling. AINews · 2026-06-30 · Knowledge graphs (GraphRAG)
  37. Does an agent that greps files replace the ranked index? On about 20 bug tasks agentic search matched vector search in accuracy at a quarter of the cost, because lone chunks lacked the surrounding logic. Jess Wang, AI Engineer · 2026-10-05 · RAG
  38. Does an agent that greps files replace the ranked index? At scale ranking wins: BM25 overtakes a file-system agent around 10 million tokens, and agentic reasoning works best after ranked discovery, not in place of it. Hugging Face · 2026-07-31 · RAG
  39. Does an agent that greps files replace the ranked index? Agentic search does not replace the index but sits on it: Mistral's agent builds on an existing search index and adds tools to open, navigate, read and grep the documents the index finds. mistral · 2026-08-20 · RAG

Cite this page

the version of 2026-12-02
APA
Han, R. (2026, December 2). RAG vs Knowledge graphs (GraphRAG): what is the difference?. Frontier Foundry. https://www.ryanhan.ai/compare/rag-vs-knowledge-graphs
BibTeX
@misc{han2026-compare-rag-vs-knowledge-graphs,
  author       = {Han, Ryan},
  title        = {{RAG vs Knowledge graphs (GraphRAG): what is the difference?}},
  howpublished = {Frontier Foundry},
  year         = {2026},
  month        = dec,
  url          = {https://www.ryanhan.ai/compare/rag-vs-knowledge-graphs}
}

More comparisons

all of them