The GraphRAG Paper, Explained for RAG Pipeline Builders

GT

GigaRAG team

Retrieval16 min read
On this page
A developer's hands hold a printed diagram of a knowledge graph pipeline with local and global search paths beside a laptop showing a token cost estimate for GraphRAG indexing.
A developer's hands hold a printed diagram of a knowledge graph pipeline with local and global search paths beside a laptop showing a token cost estimate for GraphRAG indexing.

The GraphRAG Paper, Explained for RAG Pipeline Builders (Plus the PDF)

Most GraphRAG explainers are vendor blogs selling a tool, and it shows. The paper gets reduced to a few slides, the limitations disappear, and you're left unsure whether the added complexity is worth it for your RAG pipeline or agent memory. This walkthrough is different. It's a neutral, practitioner-focused explanation of the paper, From Local to Global: A Graph RAG Approach to Query-Focused Summarization, written for someone who builds retrieval systems and needs to make a call, not read marketing. You can grab the PDF directly from arXiv here. GigaRAG is built for exactly this audience, so the goal here is simple: give you enough to decide for yourself. You'll learn how GraphRAG works step by step, what it cannot do, and how to judge whether it belongs in your pipeline or your agent's memory.

At a glanceDetails
Paper titleFrom Local to Global: A Graph RAG Approach
AuthorsMicrosoft Research (Edge et al.)
Core ideaLLM-built knowledge graph + community summaries
Best forGlobal, corpus-wide sensemaking queries
Main costLLM calls for extraction and summarization
Where to get itarXiv PDF (verify link at publish)

In This Guide

What Is GraphRAG? A Plain-English Definition

GraphRAG is a retrieval method that builds a knowledge graph from your documents, then uses that graph's structure to answer questions that span the whole dataset. Instead of matching chunks of text to a query, it finds communities of related entities and summarizes them.

The problem with baseline RAG on narrative data

Baseline RAG chops documents into chunks, embeds them, and retrieves the chunks most similar to your query. That works fine when the answer sits inside one or two chunks. It falls apart when the question requires connecting facts scattered across dozens of documents.

Here's the failure mode. Ask "What are the main themes across this corpus of 5,000 incident reports?" and vector search returns the 10 chunks most similar to the words in your question. Those chunks may share vocabulary with your query but miss the underlying patterns. The system has no way to see the whole.

How GraphRAG reframes retrieval as graph traversal

GraphRAG changes the retrieval unit. Instead of chunks, it works with a knowledge graph: entities as nodes, relationships as edges. An LLM extracts these from your source text up front. Then a community detection algorithm groups related entities into clusters.

When a query arrives, GraphRAG doesn't match text. It identifies which communities are relevant and summarizes them. The retrieval unit is a community, not a chunk. That's the shift.

The paper's core claim in one sentence

The paper argues that graph-structured retrieval beats vector retrieval on global sensemaking questions, because communities capture thematic structure that chunk similarity misses.

[!note] The GraphRAG paper is a research methodology from Microsoft Research; the open-source implementation lives in the microsoft/graphrag GitHub repo, and the paper PDF is on arXiv — confirm the exact link before publishing.

Vector RAG vs GraphRAG: Which Fits Your Pipeline?

FactorVector RAGGraphRAG
Query typeLocal, specific fact lookupGlobal, thematic, corpus-wide questions
Index buildEmbed chunks; fast and cheapLLM entity/relation extraction + community summaries; slower, costlier
Retrieval unitTop-k similar chunksCommunity summaries and graph neighborhoods
MaintenanceRe-embed changed chunksRe-extract and re-summarize affected communities
Best fitFAQ, support, single-doc Q&AAgent memory, multi-doc sensemaking, 'what are the themes?'

The GraphRAG Paper, Explained: From Local to Global

The paper is "From Local to Global: A Graph RAG Approach to Query-Focused Summarization" by Darren Edge, Ha Trinh, Newman Cheng, et al. from Microsoft Research. It's on arXiv as 2404.16130. The core idea: build a graph index once, then use it to answer questions that need the whole corpus, not just a few chunks.

Step 1: LLM-generated knowledge graph from source documents

GraphRAG starts by running every document chunk through an LLM with a prompt that asks for entities and relationships. The LLM extracts nodes like people, places, organizations, and concepts, plus edges that connect them with a verb or relation type.

The output is a graph. Not a perfect one. The paper acknowledges the extraction is noisy, and the graph will contain duplicate entities and spurious edges. That's fine for the method's purpose. The graph doesn't need to be a clean ontology. It needs to capture enough structure for community detection to find meaningful clusters.

Step 2: Community detection with the Leiden algorithm

Once the graph exists, GraphRAG runs the Leiden algorithm to partition it into communities. Leiden is a refinement of Louvain. It's faster and produces better-connected communities, which matters when your graph has hundreds of thousands of nodes.

Each community is a cluster of entities that are more connected to each other than to the rest of the graph. In practice, a community often corresponds to a theme or topic in the source corpus. The paper treats these communities as the unit of retrieval.

Step 3: Query-focused summarization (map-reduce over communities)

Here's where the "global" part comes in. When a query arrives, GraphRAG doesn't retrieve individual entities. It generates a summary for each community, then reduces those summaries into a final answer.

The map step: for each community, the LLM produces a partial answer using only the entities and relationships in that community. The reduce step: the LLM combines the partial answers into a single response. This is a map-reduce pattern over graph communities, not over text chunks.

The key insight is that each community summary is generated independently, then synthesized. That's what lets GraphRAG answer questions like "What are the main themes?" without needing to stuff the entire corpus into a context window.

Step 4: Global vs local search modes

The paper describes two query modes. Global search uses the map-reduce approach above. It's for questions about the corpus as a whole: themes, trends, aggregate patterns.

Local search starts from entities matched to the query, then expands to their neighbors in the graph. It's for questions about a specific entity or a small set of related entities. Local search is closer to traditional RAG, but it uses graph edges to pull in context that vector similarity would miss.

The honest answer is that global search is the novel contribution. Local search is a variation on existing graph retrieval. Most of the paper's evaluation focuses on global sensemaking tasks.

[!tip] Before committing, run a cost estimate: count your corpus chunks, multiply by the LLM extraction and summarization calls, and compare that against your current vector-RAG indexing spend. If the global-query use case isn't in your top user intents, the added complexity rarely pays off.

The Graphrag Paper, Explained: A Step-by-Step Guide

  1. Split the source corpus into text units (chunks) that fit the LLM context window.
  2. Run an LLM over each unit to extract entities, relationships, and claims.
  3. Build a knowledge graph from those extractions, then detect communities of closely related nodes.
  4. Generate hierarchical community summaries with an LLM, from leaf communities up to top-level themes.
  5. At query time, use community summaries to answer global questions (map-reduce style) or graph neighborhoods for local questions.
  6. Evaluate answers against baseline vector RAG on comprehensiveness, diversity, and empowerment.
Infographic comparing GraphRAG and vector RAG by retrieval unit, strengths, cost, best use cases, and limitations

GraphRAG vs Vector RAG: What Actually Changes

The honest answer: the retrieval unit. Vector RAG retrieves chunks. GraphRAG retrieves communities. That single change cascades through everything else.

Retrieval unit: chunks vs communities

Vector RAG embeds every chunk of text into a vector space. A query gets embedded too, and the system returns the chunks whose vectors sit closest. You get fragments. The LLM stitches them into an answer.

GraphRAG skips chunk-level retrieval for global queries. It retrieves community summaries instead. Each community is a cluster of entities the Leiden algorithm found to be tightly connected. The summary is a pre-computed description of what that cluster contains.

Here's what happens behind the scenes. Vector RAG asks "which chunks are similar to this query?" GraphRAG asks "which communities, taken together, cover the themes this query touches?" The first is a similarity search. The second is a coverage problem.

Query types: local vs global

Vector RAG handles local questions well. "What did the CEO say about layoffs in the Q3 earnings call?" That's a needle in a haystack. Similarity search finds the needle.

GraphRAG's global search handles questions vector RAG struggles with. "What are the recurring themes across all 200 earnings calls?" No single chunk answers that. You need the whole corpus, summarized at a level above individual documents.

The paper's evaluation shows GraphRAG outperforming vector RAG on sensemaking tasks that require connecting information across many documents. That's the mechanism: community summaries give the LLM a pre-digested view of the corpus, so it doesn't have to hold hundreds of chunks in context.

When vector RAG is still the better choice

Vector RAG wins on cost and simplicity. No graph construction step. No Leiden partitioning. No map-reduce over communities. You embed your chunks, store them, and query.

It also wins on latency. Global search in GraphRAG requires generating summaries for every community at query time. That's expensive. Vector RAG returns chunks in milliseconds.

The main catch: if your queries are local, GraphRAG's graph construction is overhead you don't need. You're paying token costs to build a graph you'll never traverse globally. Stick with vector RAG until you have questions that require corpus-level synthesis.

How the Knowledge Graph Gets Built

Graph construction is the expensive part. You run every source document through an LLM twice: once to find entities, once to find relationships. That's the whole trick. No embeddings, no vector store. Just prompts and a graph database.

Entity and relationship extraction prompts

The paper uses a two-pass prompt. Pass one extracts entities: people, places, organizations, concepts. Pass two extracts relationships between those entities, each with a short description. Both passes run over every chunk in your corpus.

The output is a list of triples: (entity, relationship, entity). You merge duplicates across chunks. The graph is just those triples stored as nodes and edges.

Graph indexing and storage considerations

You need a graph store. Neo4j works. So does a simple adjacency list in memory for small corpora. The paper doesn't mandate a specific database.

The index is the graph itself. Communities become the retrieval unit after Leiden partitioning. You store community summaries alongside the graph, generated once at build time.

Token cost implications of graph construction

Here's the number that matters. Every chunk passes through the LLM at least twice. A 1,000-chunk corpus means 2,000 LLM calls before you answer a single query. That's the fixed cost.

The paper reports token usage roughly one to two orders of magnitude higher than vector RAG for equivalent corpora. You pay it once at build time, but you pay it again every time the corpus changes.

What GraphRAG Cannot Do: Honest Limitations

The paper doesn't dwell on failure modes. Neither do most vendor blogs. But you need to know where GraphRAG breaks before you commit pipeline budget to it.

Computational and token cost overhead

Graph construction is not a one-time tax you can ignore. Every chunk passes through the LLM at least twice, and the paper reports token usage one to two orders of magnitude higher than vector RAG for equivalent corpora. That's not a rounding error.

The cost recurs. When your corpus changes, you re-run extraction on the affected chunks, rebuild affected communities, and regenerate summaries. For a corpus that updates daily, that's a standing LLM bill, not a setup fee. If your data is a news feed or a support ticket queue, the graph is always slightly stale unless you pay continuously.

Failure modes with noisy or unstructured data

GraphRAG assumes your documents contain entities and relationships worth extracting. When they don't, the graph is garbage.

Chat logs, freeform notes, and transcripts produce fragmented entities. The LLM extracts "the client" and "that project" as separate nodes because it can't resolve pronouns across chunks. You get a graph with dozens of near-duplicate entities and edges that don't connect. Community detection still runs, but the communities don't map to anything real in your data.

The paper's evaluation used structured narrative datasets: news articles, podcast transcripts, and Wikipedia-style text. Your data may not look like that.

Scenarios where vector RAG or simpler methods suffice

If your queries are local, meaning they ask about a specific fact or passage, vector RAG is faster, cheaper, and often more accurate. GraphRAG earns its cost on global questions: themes, patterns, connections across the whole corpus.

If your corpus is small, under a few hundred chunks, a simple keyword search or a single LLM call with the full context may beat both. The graph adds structure you don't need.

If your queries are predictable and narrow, don't build a graph. Build a lookup table.

GraphRAG for Agent Memory: A Practical Decision Framework

The previous section covered what GraphRAG can't do. Here's how to decide if it's right for your pipeline.

When GraphRAG is worth the added complexity

You need global queries. If your agents ask questions like "what are the recurring themes across all customer complaints this quarter" or "which entities connect these three incidents," vector RAG will miss the pattern. GraphRAG's community summaries answer those directly.

Your corpus is narrative and entity-rich. News, reports, meeting transcripts, incident postmortems. Documents where people, organizations, and events connect in ways that matter. If your data is API docs or code snippets, skip it.

Your corpus is large enough that a single context window can't hold it. The paper's evaluation used datasets in the tens of thousands of chunks. Below a few thousand chunks, you can often brute-force global questions by stuffing more context into a long-context model.

Your corpus changes slowly. Weekly or monthly updates make the re-indexing cost tolerable. Daily updates make it a standing bill.

When to stick with vector RAG

Your queries are local. "What did the client say about pricing in the last call?" Vector RAG handles that faster and cheaper.

Your corpus is noisy or unstructured. Chat logs, freeform notes, and transcripts produce fragmented entities and broken edges. The graph adds cost without adding signal.

Your budget is tight. GraphRAG's token overhead is one to two orders of magnitude higher than vector RAG. If you're running a lean pipeline, that's disqualifying.

Your latency requirements are strict. GraphRAG's global search runs map-reduce over multiple communities. That's slower than a single vector lookup.

Hybrid approaches: GraphRAG for global, vector RAG for local

You don't have to choose. Run both.

Vector RAG handles local queries: fact lookup, passage retrieval, specific entity mentions. GraphRAG handles global queries: themes, patterns, cross-entity connections. Route queries based on type.

A simple router works: if the query asks about a specific fact or passage, send it to vector RAG. If it asks about patterns, themes, or connections, send it to GraphRAG. You can build this with a classifier prompt or a keyword heuristic.

The cost is maintaining two indexes. The benefit is you pay for graph traversal only when a query actually needs it. For most pipelines, that's the right trade.

Common Mistakes When Implementing GraphRAG

Most GraphRAG failures aren't architectural. They're tuning mistakes that show up in the first week.

Over-segmenting communities

The Leiden algorithm lets you control resolution. Crank it too fine and you get hundreds of tiny communities, each with a summary too thin to answer anything. Too coarse and communities blur together, losing the signal you built the graph for.

Start with the paper's defaults. Adjust only after you see query results degrade. One knob at a time.

Ignoring token cost during graph construction

Graph construction is the expensive part. Entity extraction, relationship extraction, and community summarization each pass over your corpus with LLM calls. On a 10,000-chunk corpus, that's tens of millions of tokens before you answer a single query.

Budget for it. If you can't afford the indexing pass, you can't afford GraphRAG. No amount of query-time optimization recovers construction cost.

Using GraphRAG for local-only queries

If every query your agents run is "find this fact" or "retrieve this passage," you're paying for a graph you never traverse. Vector RAG answers those faster and cheaper.

GraphRAG earns its cost on global questions: themes, patterns, cross-entity connections. Route local queries to vector RAG. Save the graph for what it's built for.

The GraphRAG Paper, Explained: Is It Worth It?

The honest answer is it depends. It depends on your query mix, your corpus structure, and your update cadence. If your agents mostly ask local questions, skip GraphRAG. Vector RAG is faster, cheaper, and simpler. If your agents need to synthesize themes across thousands of documents, and your corpus is narrative and entity-rich, GraphRAG earns its cost. The paper's global search is a real advance over chunk-based retrieval for that specific job. For everyone else, the graph is overhead. Build it only when the questions demand it.

Frequently Asked Questions

What is the GraphRAG paper about?

It introduces a retrieval-augmented generation approach that builds an LLM-derived knowledge graph from a corpus, clusters it into communities, and generates hierarchical summaries. Those summaries let the system answer global, corpus-wide questions that chunk-based vector RAG tends to miss.

Where can I download the GraphRAG PDF?

The paper, 'From Local to Global: A Graph RAG Approach to Query-Focused Summarization,' is available on arXiv. Search the title on arXiv.org or check the microsoft/graphrag GitHub repo for the canonical link, and verify it before publishing.

Is GraphRAG better than vector RAG?

It depends on the query type. GraphRAG tends to outperform vector RAG on global, thematic, and multi-hop questions, while vector RAG remains faster and cheaper for local, specific fact lookups. Many teams run both and route queries accordingly.

What are the limitations of GraphRAG?

It cannot cheaply handle rapidly changing corpora, it struggles with precise numeric or tabular lookups, and its indexing cost scales with LLM calls over every chunk. It also depends on extraction quality, so noisy or ambiguous text degrades the graph.

When should I not use GraphRAG?

Skip it if your users mostly ask local, single-fact questions, if your corpus changes hourly, or if your budget can't absorb repeated LLM extraction and summarization passes. In those cases, vector RAG or hybrid search is usually the better fit.

How does GraphRAG relate to agent memory?

Agent memory builders use GraphRAG-style graphs to store entities, relationships, and episodic summaries so agents can retrieve both local details and global context. It's most useful when the agent needs to reason across many past interactions rather than recall one fact.

Is there a GraphRAG GitHub implementation?

Yes, Microsoft maintains an open-source implementation in the microsoft/graphrag repository. It includes indexing and query workflows, though you should check the repo's current docs for setup and cost guidance.

About GigaRAG

GigaRAG is for agent memory and RAG pipeline builders. get this right. Whether you are working through the graphrag paper, explained (plus the pdf) or something adjacent, we publish what we have actually tested, including where it falls short.

A six-step infographic shows the GraphRAG pipeline from splitting the source corpus and extracting entities, through community detection and summaries, to query answering and evaluation.
All posts