Paper Breakdowns  /  GraphRAG
Paper 60~11 min readMicrosoft · 2024worked math + runnable code
Paper Breakdown

GraphRAG,
explained.

Ask a RAG system "what did the Q3 report say about revenue?" and it shines — the answer lives in one passage it can fetch. Ask "what are the main themes across all our documents?" and it flounders, because no single passage holds that answer; it's smeared across hundreds. GraphRAG fixes the blind spot by turning the corpus into a knowledge graph, clustering it into communities, summarizing each, and combining those summaries. Here's why global questions break plain RAG, and how a graph answers them.

Video breakdown
The animated walkthrough is in production.
Read the full breakdown below in the meantime ↓
01

Local vs global questions

Standard RAG works by similarity: embed the query, retrieve the top-k most similar chunks, and let the model answer from them. For a local question — one whose answer sits in a specific place — this is perfect. The relevant passage is similar to the query, so it gets retrieved, and the model reads it off.

But a global question is different in kind. "What are the recurring themes?" "How do these findings relate across the whole report?" "Summarize the main tensions in this corpus." The answer to these isn't in any passage — it's an emergent property of many passages. Retrieve the top-k most similar chunks and you get a handful that happen to match the query's words, covering a small slice of what you'd need to synthesize. No amount of better embedding fixes this: the information is distributed, and top-k retrieval is inherently local.

The one-sentence version

Vector RAG retrieves a few similar passages — fine for local facts, blind to global questions whose answer is spread across the whole corpus; GraphRAG structures the corpus so the whole can be summarized.

02

Build the graph

GraphRAG's indexing does more than embed chunks. An LLM reads every chunk and extracts entities and the relationships between them — people, organizations, concepts, and how they connect. Stitched together across the corpus, these become a knowledge graph: nodes are entities, edges are relationships, and an entity mentioned in many places becomes a well-connected hub.

This graph captures something the flat pile of chunks never did: structure. Two facts stated in different documents about the same entity are now linked through that entity's node. The corpus stops being a bag of passages and becomes a network you can traverse, cluster, and reason over globally — which is exactly what the local, similarity-only view was missing.

03

Communities and summaries

A knowledge graph over a large corpus is itself too big to read. So GraphRAG runs community detection (the Leiden algorithm) to partition the graph into communities — clusters of densely interconnected entities that tend to correspond to coherent topics or themes. This is done hierarchically, giving communities at multiple levels of granularity. An LLM then writes a summary of each community ahead of time.

The GraphRAG indexing pipeline
ExtractLLM pulls entities + relationships from every chunk → a knowledge graph.
DetectCommunity detection clusters the graph into themes, hierarchically.
SummarizeLLM writes a summary per community — the corpus, distilled by topic.
IndexThese summaries are the searchable, aggregatable units for global queries.

The community summaries are the key artifact. Instead of a million raw chunks, you now have a manageable set of topic-level digests that collectively cover the entire corpus. A global question can be answered by consulting these, not by hoping the right handful of chunks were similar enough to retrieve.

04

Map-reduce answers

To answer a global query, GraphRAG uses map-reduce over the community summaries. Map: generate a partial answer from each relevant community summary in parallel. Reduce: combine those partial answers into a single, comprehensive response. Because the summaries span the whole corpus, the final answer draws on all of it — not the fraction that a top-k retriever would surface.

top-k coverage = min(k, R) / R (misses when R > k)  ·  GraphRAG map-reduce = covers all R

If a global answer is spread over R relevant passages and you retrieve only k < R, plain RAG covers just min(k,R)/R of it — for R=10, k=3, that's 30%. GraphRAG's map-reduce over community summaries covers the whole corpus by construction. The paper found this yields substantially more comprehensive and diverse answers to global sense-making questions, judged head-to-head against vector RAG. The runnable version below makes the coverage gap concrete.

RUN IT YOURSELF

Why top-k misses the global answer

Two things made concrete. First, a mini knowledge graph: entities and relationships become an adjacency structure with degrees, connected components (a stand-in for community detection), and a hub — the most-connected entity that anchors a community. Second, the coverage gap: when a global answer is spread over ten passages, top-3 vector retrieval surfaces just 30% of it, while GraphRAG's map-reduce over community summaries covers all of it. Change the graph or the passage spread and watch the gap.

CPython · WebAssembly
05

The trade-offs

GraphRAG buys global reach at a real cost, so it complements rather than replaces vector RAG:

DimensionWhere it lands
Global questionsBig win — comprehensive, diverse answers to whole-corpus sense-making, where vector RAG is weak.
Local questionsVector RAG is cheaper and just as good — no need for the graph machinery.
Indexing costMany LLM calls up front: entity extraction, graph building, and summarizing every community. Far pricier than embedding chunks.
FreshnessUpdating the graph and re-summarizing communities as documents change adds maintenance overhead.

The practical pattern is a hybrid: route local, fact-lookup queries to cheap vector RAG, and global, sense-making queries to GraphRAG's community summaries. The graph earns its expensive index precisely on the questions plain retrieval can't touch.

06

Why it matters

GraphRAG named and attacked a real limitation that practitioners kept hitting: retrieval-augmented systems that were great at fact lookup and useless at "help me understand this whole body of text." By reintroducing structure — a knowledge graph and its communities — it gave RAG a way to reason over a corpus as a whole, and its open-source release made the approach widely reproducible.

The deeper point is about representation. Flat vector retrieval treats a corpus as an unordered set of passages, which is why it can only ever answer locally. Imposing a graph — entities, relationships, communities — restores the connective tissue between passages, and connective tissue is exactly what global questions are about. It's a reminder that how you structure knowledge determines which questions you can answer, and that similarity search, powerful as it is, is only one such structure.

Worth knowing

The hierarchy of communities is a quiet feature: coarse levels answer broad "big themes" questions cheaply from a few summaries, while finer levels support more specific global questions — you pick the granularity that matches the query's scope.

Frequently asked

Quick answers

What does GraphRAG add over RAG?

It builds a knowledge graph of entities/relationships, clusters it into communities, summarizes each, and map-reduces those summaries — answering global questions vector RAG can't.

Why does plain RAG fail globally?

Top-k similarity retrieval surfaces a few matching passages, but a global answer is spread across many, so it only ever covers a fraction of what's needed.

How are communities found?

Community detection (Leiden) partitions the entity graph into clusters of tightly connected entities, hierarchically; an LLM summarizes each cluster.

What's the catch?

Indexing is expensive — many LLM calls to extract entities, build the graph, and summarize communities — so it's best paired with cheap vector RAG for local queries.

From Local to Global: A Graph RAG Approach to Query-Focused Summarization · Edge, Trinh, Cheng, Bradley, Chao, Mody, Truitt, Larson · Microsoft · 2024 · read the original paper on arXiv → · Vibe Engines · 2026
Finished this one? 0 / 101 Paper Breakdowns done

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.

More Paper Breakdowns