All posts

GraphRAG vs vector RAG: when a knowledge graph is worth the indexing bill

GraphRAG answers whole-corpus questions that vector RAG cannot, but it costs far more to index. How the two differ, what each is good at, and a decision table for choosing.

CodeKrypt 5 min read

Your RAG assistant handles "what is the refund window?" well and falls over on "what are the recurring complaints across all our support tickets?". If you are weighing GraphRAG vs vector RAG, the decision comes down to which of those two kinds of question your users actually ask, and whether the much higher indexing cost is justified. This post explains the difference, what each approach costs, and how to decide.

The claims below come from Microsoft's published GraphRAG paper and documentation, linked inline. They are the authors' own results, so test on your own documents before committing.

What is the difference between GraphRAG and vector RAG?

Vector RAG splits documents into chunks, embeds them, and at query time returns the chunks closest to the question. The answer has to live in a few passages. See RAG chunking strategy for how those chunks are made.

GraphRAG, as described in the Microsoft paper, uses an LLM in two stages: it extracts an entity knowledge graph from the source documents, then pregenerates summaries for communities of closely related entities. At query time each community summary produces a partial answer, and the partial answers are combined. The GraphRAG documentation lists the indexing steps: split into text units, extract entities, relationships and claims, cluster the graph hierarchically with the Leiden technique, and summarize communities bottom-up.

Vector RAG retrieves nearest chunks; GraphRAG builds entities, communities and summariesVector RAGChunksEmbeddingsNearest chunksGraphRAGText unitsEntity graphCommunitiesSummaries

Which questions does vector RAG get wrong?

The GraphRAG paper frames the gap precisely: standard RAG fails on global questions about an entire corpus, its example being "What are the main themes in the dataset?". That is a summarization task over everything, and no single chunk holds the answer. For a class of such questions over datasets of about one million tokens, the authors report "substantial improvements over a conventional RAG baseline for both the comprehensiveness and diversity of generated answers."

The documentation draws the same line: global search is "for reasoning about holistic questions about the corpus", while local search is "for reasoning about specific entities by fanning-out to their neighbors and associated concepts." Questions that follow relationships between entities (which supplier is linked to which contract, which person appears in which incident) are the other natural fit for a graph.

If your failures are instead wrong or missing passages for specific questions, a graph will not help. Fix retrieval first with hybrid search and reranking.

What does GraphRAG cost compared with vector RAG?

The cost sits at indexing. Every text unit goes through an LLM for entity and relationship extraction, and every community gets an LLM-written summary. Vector indexing needs only an embedding model.

Microsoft's LazyGraphRAG post gives the comparison as ratios rather than dollars: "LazyGraphRAG data indexing costs are identical to vector RAG and 0.1% of the costs of full GraphRAG." LazyGraphRAG avoids the LLM-heavy graph build by using noun-phrase extraction and deferring LLM use to query time. The same post says it suits one-off queries, exploratory analysis and streaming data, while full GraphRAG's entity and community summaries have value as reports in their own right, and vector RAG excels at local queries where the answer resembles the query text.

Two further costs are easy to miss. Indexing repeats whenever documents change, which compounds the issue covered in RAG knowledge base freshness. And switching the embedding model forces a rebuild, as in embedding model migration. For the budgeting habit behind this, see how to reduce LLM API costs.

GraphRAG vs vector RAG: how do you choose?

Your main question typeBetter starting pointWhy
Look up a fact in a specific documentVector or hybrid RAGThe answer sits in a few chunks
"Summarize themes across the whole corpus"GraphRAG or LazyGraphRAGNeeds corpus-level structure
Follow links between entitiesGraphRAG (local search)Relationships are explicit in the graph
Corpus changes dailyVector RAG, or LazyGraphRAGCheap to re-index
Rare one-off analysis of a document setLazyGraphRAGMinimal upfront indexing
Need shareable entity and community reportsFull GraphRAGThe summaries are a useful output

A separate academic comparison, RAG vs GraphRAG, concludes the two have "distinct strengths across different tasks and evaluation perspectives" and explores combining them. That matches the practical advice: it is rarely either/or.

How do you test whether you need a graph?

  1. Collect real user questions and label each as local (answer in a passage) or global (answer spans the corpus).
  2. Run them through your current hybrid retriever and note failures by type.
  3. If failures are mostly local, improve retrieval and stop.
  4. If a meaningful share are global or multi-hop, prototype LazyGraphRAG-style indexing on a sample first, since its indexing cost matches vector RAG.
  5. Compare answers on your own labeled set, using the habits in LLM evals in CI.

What to do next

Do not start with a graph. Measure where vector retrieval fails, classify those failures, and add graph structure only for the question types that need it. If you are building a retrieval-backed product and want that measurement and architecture done properly, our AI SaaS service covers it.

Sources

CodeKrypt avatar

CodeKrypt

Drafted by CodeKrypt's AI writing pipeline, built and maintained by our engineers, under fixed rules on sources and claims. How we write

Frequently asked questions

What is the difference between GraphRAG and vector RAG?
Vector RAG embeds text chunks and retrieves the ones nearest to the question. GraphRAG uses an LLM to extract entities and relationships into a graph, groups them into communities, and summarizes each community, then answers from those structures.
When does vector RAG fail that GraphRAG fixes?
On global questions about a whole corpus, such as 'what are the main themes across these documents?'. No single chunk contains the answer, so nearest-neighbour retrieval returns fragments.
Is GraphRAG more expensive?
At indexing time, yes. Microsoft states that LazyGraphRAG indexing costs are identical to vector RAG and 0.1% of the cost of full GraphRAG, which implies full GraphRAG indexing is roughly a thousand times the cost of vector indexing.
Should I start with GraphRAG?
Usually no. Start with vector or hybrid retrieval, measure which questions fail, and add graph structure only if the failures are global or multi-hop questions.

Related reading

Chat on WhatsApp