From Local to Global: A Graph RAG Approach to Query-Focused Summarization

Authors: Darren Edge, Ha Trinh, Newman Cheng, Joshua Bradley et al.
Year: 2024 | Microsoft Research (arXiv: 2404.16130)
Source: edge-2024-from-local-to-global-a


What it is

GraphRAG is a RAG pipeline that builds a knowledge graph from source documents, performs community detection to identify clusters of related entities, and generates community-level summaries. When a user asks a global question about a corpus (“what are the main themes?”), GraphRAG uses these structured summaries rather than vector similarity search. The paper provides the first rigorous empirical comparison showing where graph-structured knowledge representation outperforms flat vector embeddings — validating at scale the symbolic AI intuition that structure enables reasoning.


The problem: vector RAG fails on global questions

Standard RAG embeds documents into a vector space and retrieves chunks by cosine similarity. This works for local questions (specific fact lookup):

"What year was the Treaty of Versailles signed?"
→ retrieve 1-2 chunks → answer: 1919  ✓

It fails for global sensemaking questions:

"What are the key themes across this entire research corpus?"
→ no single chunk answers this
→ relevant information is distributed across thousands of documents
→ vector RAG retrieves fragments; LLM can't synthesize at corpus scale  ✗

Global questions require aggregation and synthesis across the full dataset — exactly what graph traversal and hierarchical summarization support.


The GraphRAG pipeline

Indexing phase (done once, offline):

1. Chunk source documents

2. LLM extracts entities and relationships:
   "Apple acquired Beats Electronics in 2014" →
   nodes: [Apple, Beats Electronics]
   edge:  Apple --acquired--> Beats Electronics (2014)

3. Build entity knowledge graph across all documents

4. Leiden community detection → hierarchical clusters
   Level 0: small tight clusters (5-10 entities)
   Level 1: medium clusters
   Level 2+: major themes / topic areas

5. LLM generates a summary for each community at each level

Query phase (at inference time):

User query → select community level (fine/coarse)
           → map: each community summary generates a partial answer (parallel)
           → reduce: partial answers merged into final response

Key results

Evaluated on ~1M token corpora (news articles, podcast transcripts) using LLM-as-judge methodology.

Global sensemaking questions (e.g., “What are the major themes in this dataset?“):

MethodComprehensivenessDiversity
Naive RAGbaselinebaseline
GraphRAG (C2 communities)+23% win rate+27% win rate

The improvement is substantial and consistent. For local questions, GraphRAG performs comparably to standard RAG — no degradation.


Why graph structure helps

Vector RAG’s failure mode on global questions is retrieval fragmentation: relevant information is spread across many documents, but each retrieved chunk is only locally coherent. The model must synthesize across hundreds of fragments in a limited context window.

GraphRAG solves this by building the synthesis during indexing:

  • Community detection groups semantically related entities
  • Community summaries pre-synthesize the relationships within each cluster
  • The map-reduce pattern allows parallel synthesis across communities

This is the knowledge graph insight from symbolic AI applied at LLM scale: explicit structure (typed edges, community membership) enables reasoning that flat similarity cannot.


Symbolic AI lineage

GraphRAG instantiates exactly what Minsky’s frames (minsky-1974-a-framework-for-representing-knowledge) and McCarthy’s Advice Taker (mccarthy-1958-programs-with-common-sense) proposed:

  • Entities = frame instances
  • Typed edges = slot relationships
  • Community summaries = frame system descriptions
  • Hierarchical levels = frame inheritance hierarchy

The difference: frames were hand-authored by knowledge engineers; GraphRAG builds the graph automatically from text using an LLM.


Architecture: hybrid symbolic-neural

GraphRAG is a hybrid system:

ComponentApproach
Entity extractionNeural (LLM)
Relationship labelingNeural (LLM)
Community detectionSymbolic (Leiden algorithm)
Graph traversalSymbolic (graph algorithms)
Community summarizationNeural (LLM)
Answer synthesisNeural (LLM)

The symbolic layer (graph + community detection) provides the structure that makes the neural layer’s synthesis tractable. Neither alone achieves the result.


Limitations

  • Indexing is expensive: one LLM pass per document chunk to extract entities
  • Graph quality depends on LLM extraction quality — errors propagate structurally
  • Community detection is domain-agnostic; may not match domain-relevant groupings
  • Not a solution for simple local lookup — standard RAG remains more efficient there

See also