Library
7 min read

GraphRAG

Ask a vector RAG system "what are the main complaints customers raised this quarter?" and it retrieves the five chunks most similar to that sentence, which are probably five complaints. Not the main themes across forty thousand tickets. The question is about the whole collection, and similarity search can only ever return a few pieces of it.

GraphRAG adds structure that vectors do not have: the entities in your documents (people, products, places, policies), the relationships between them, and summaries of clusters of related things. Microsoft Research published the best known version in 2024, and the idea has spread into many tools since. It is powerful for a specific kind of question, and expensive enough that you should know exactly when you need it.

Your answer

Why can't a vector search over chunks answer 'what are the five biggest themes across all our support tickets this quarter?', no matter how good the embeddings are?

How the index is built#

1/4 A model reads every chunk and pulls out entities ("Pro plan", "UPI", "Bengaluru", "rider app") and relationships between them ("UPI refund delayed for Pro plan users"). This is one model call per chunk, and it is where most of the cost goes.
Search mode
For questions about a specific thing. Find the entity, then gather its relationships, related entities and the chunks they came from. Better than plain vector search when the answer is spread across documents that are connected but not similar in wording.

That answers the question at the top. Vector search returns the few chunks most similar to the question. "Biggest themes" is not similar to any chunk. It is a property of all of them, which only a precomputed summary of the whole collection can answer.

The cost, honestly#

Building the index means a model call for every chunk to extract entities, plus summaries for every community, plus rebuilding parts of it as documents change. For a large corpus that can be many times the cost of embedding it. Lighter variants have appeared since 2024 (LightRAG is a well known one) that cut the extraction and update cost, and some vector databases and graph databases now offer graph retrieval built in.

ChoiceWhat you gainWhat you payPick it when
Vector RAGCheap to build and update, fast, great for specific questions.Cannot answer questions about the whole collection, misses connections between dissimilar text.Most question answering. The default.
GraphRAGAnswers whole-collection questions and connects facts across documents.Expensive indexing, slower global queries, more moving parts to keep fresh.Analysis over large corpora: research, investigations, ticket and feedback themes.
Hybrid: vector first, graph for someCheap path for specific questions, graph only where it earns its cost.Two indexes and a router.Products that mix lookup questions with analysis questions.
Does it need a graph?
"What is the warranty on the X200?"
"What did customers complain about most in Q3?"
"Which suppliers are connected to the delayed shipments?"
"Summarise this one PDF"
Do not start here

GraphRAG is a tool for a question type, not an upgrade to RAG in general. Build vector RAG first, log which questions fail, and add a graph only if many failures are whole-collection or relationship questions. Otherwise you have built an expensive index that makes FAQ answers no better.

Checkpoint#

Checkpoint

1. Why does vector RAG fail on "what are the main themes across all tickets"?

2. Where does most of the GraphRAG indexing cost come from?

3. Which search mode answers "which suppliers are linked to the delayed shipments"?

Worth memorising
  • GraphRAG: extract entities and relations, cluster into communities, summarise them.
  • Local search walks from an entity. Global search maps over community summaries.
  • It answers whole-collection questions vector RAG cannot.
  • Indexing is expensive. Add it only for question types that need it.
Say this in 60 seconds

Vector RAG returns the few chunks most similar to a question, so it cannot answer questions about a whole collection, like the main themes across all tickets. GraphRAG builds a knowledge graph: a model extracts entities and relationships from every chunk, they are merged, clustered into communities, and each community is summarised. Local search starts from an entity and walks its relationships, which connects facts across documents. Global search asks the question against every community summary and merges the partial answers. The indexing is expensive, a model call per chunk plus summaries, so I would start with vector RAG and add a graph only for analysis and relationship questions that keep failing.