Why GraphRAG turns knowledge into a network, not a pile of text
Why GraphRAG turns knowledge into a network, not a pile of text
Ask an LLM to summarize what your whole document corpus is about and you'll quickly hit a wall. Plain retrieval-augmented generation (RAG) is brilliant at finding a needle in a haystack, but it fails when the question requires connecting the dots across the entire haystack. That is exactly the blind spot Microsoft's GraphRAG paper was written to fix.
"RAG fails on global questions directed at an entire text corpus, such as 'What are the main themes in the dataset?', since this is inherently a query-focused summarization (QFS) task, rather than an explicit retrieval task." — Edge et al., From Local to Global: A Graph RAG Approach to Query-Focused Summarization (arXiv:2404.16130)
This article digs into why that failure happens, exactly how GraphRAG fixes it, and — most usefully — when each retrieval approach (plain vector RAG, GraphRAG, or a hybrid) is the right tool, backed by verifiable sources.
First, a refresher: how plain RAG actually works
Before we talk about graphs, it's worth being precise about what "plain RAG" does under the hood, because every failure mode we discuss comes from one of these steps. RAG (retrieval-augmented generation) was formalized by Lewis et al. in 2020 — the core idea is to augment the LLM with retrieved context instead of relying only on its parametric memory. A typical RAG pipeline has six steps:
Chunking. The corpus is split into text chunks. The chunk size is a real design decision, not a detail: in GraphRAG's own ablation (Section 3.1.1), GPT-4 extracted almost twice as many entity references from 600-token chunks as from 2400-token chunks on the HotPotQA dataset — larger chunks degrade the recall of information early in the chunk. (Source: arXiv:2404.16130)
Embedding. Each chunk is turned into a high-dimensional vector using an embedding model. Two popular families:
Vector database. The chunk embeddings are stored in a vector store (Pinecone, Weaviate, Qdrant, pgvector, FAISS, etc.). At query time the user's question is embedded with the same model and the store returns the K nearest neighbors by cosine similarity.
Retriever. The vector store returns the top-K most-similar chunks. This is the step that "loses" when a question needs entities joined across chunks.
Re-ranking (optional). A second, more expensive model re-sorts the top-K hits to surface the most relevant ones before they reach the LLM.
Generator. The retrieved chunks are stuffed into the LLM's context window and it writes the answer.
OpenAI text-embedding-3-small and text-embedding-3-large: released in January 2024, these are OpenAI's current embedding models. By default text-embedding-3-small produces 1536-dimensional vectors and text-embedding-3-large produces 3072-dimensional vectors; a dimensions parameter lets you shrink them (matryoshka-style) with a minimal loss of quality. On the MTEB benchmark, text-embedding-3-large scores 64.6% vs text-embedding-3-small's 62.3% and the older ada-002's 61.0%. (Source: platform.openai.com/docs/guides/embeddings)
Open-source/local: BGE (BAAI) — bge-small-en-v1.5 is 384-dim, bge-base-en-v1.5 768-dim, bge-large-en-v1.5 1024-dim, all with a 512-token context (MTEB scores 62.17 / 63.55 / 64.23). Nomic Embed (nomic-embed-text-v1.5) is a fully open, Apache-licensed model with a 768-dim default and an 8192-token context; it also supports Matryoshka down to 64 dimensions. sentence-transformers (Hugging Face / UKPLab) is the framework most teams use to run models like these locally.
The practical takeaway: embedding models matter, and the choice between a hosted API (OpenAI) and a local model (BGE, Nomic) is driven by cost, privacy, and latency — not by whether you use GraphRAG or vector RAG. (Sources: HuggingFace model cards for BAAI/bge-small-en-v1.5 and nomic-ai/nomic-embed-text-v1.5; huggingface/sentence-transformers repo.)
The critical limitation: step 4 is a best-first similarity search. It returns chunks that look like the question. It has no idea which chunks relate to each other. When the answer lives at the intersection of many documents, no single chunk is a good "nearest neighbor," so the top-k retrieval returns a handful of loosely related fragments — and the LLM has to "connect the dots" that were never handed to it.
That's the real reason the GraphRAG authors wrote that opening quote. Vector RAG is excellent at explicit fact retrieval, and it's precisely bad at the thing the paper calls global sensemaking — "what are the main themes in this 1-million-token dataset?"
The fix: build a graph, then summarize the graph
GraphRAG's core insight is to re-index the corpus into a knowledge graph first, and then make the graph itself the retrieval substrate. The paper's pipeline (Figure 1) has two phases — indexing time and query time:
Text Chunks → Entities & Relationships. The LLM is prompted to extract important entities and the relationships between them from each chunk, plus short descriptions. Crucially, the paper's graph index spans nodes (entities), edges (relationships), and covariates (claims).
Entities & Relationships → Knowledge Graph. These triples are merged into a graph. This is where you get the (Florian)-[:OWNS]->(NeuralNine)-style triples: a subject, a predicate, an object.
Knowledge Graph → Graph Communities. The graph is partitioned using community detection — specifically the Leiden algorithm (Traag et al., 2019) — which exploits the graph's inherent modularity to find groups of closely related nodes. This is the step that makes "thematic" structure explicit: related entities get grouped into a community.
Graph Communities → Community Summaries. Each community is summarized by the LLM, recursively bottom-up: summaries at higher levels of the community hierarchy incorporate lower-level summaries. The result is a set of community summaries describing "global descriptions and insights over the corpus."
Query time (map-reduce):
GraphRAG query time: map each community summary to a partial answer, then reduce into the final global answer.
Community Summaries → Community Answers → Global Answer. The paper describes this as map-reduce processing: in the map step, each community summary independently and in parallel generates a partial answer to the query; in the reduce step, all partial answers are combined and summarized into the final global answer. Local search, by contrast, acts directly on specific entities and relationships relevant to the query.
(All of the above is drawn directly from the paper, arXiv:2404.16130, Sections 3.1.1–3.1.6.)
"Comprehensiveness and diversity" — the actual evaluation
The paper evaluates GraphRAG against a conventional RAG baseline (which they call "SS" / "source-and-summarize") plus other configurations, on global sensemaking questions over datasets in the 1-million-token range. The headline metrics are three, each judged by an LLM:
Comprehensiveness — how much of the relevant information does the answer cover?
Diversity — does it capture the full range of perspectives/topics, not just one angle?
Empowerment — does it help the reader understand and make informed judgments, with reasoning and sources, without misleading or fallacious assumptions?
The headline result: GraphRAG leads to substantial improvements over a conventional RAG baseline on both comprehensiveness and diversity. (The paper's Table: GraphRAG beats the baseline with large, statistically significant win-rates — e.g., >70–83% on comprehensiveness across hierarchy levels, p < 0.001 — vs baseline SSRAG's single-digit-to-mid-20s percentages.)
There's also a delightfully counterintuitive finding worth remembering: the authors tested context windows of 8k/16k/32k/64k for the baseline and found the smallest window (8k) was universally best for comprehensiveness (58.1% avg win rate) — consistent with the "lost in the middle" problem that longer contexts dilute the signal. (Source: arXiv:2404.16130, Appendix C.)
Practical note on cost: GraphRAG indexing is genuinely expensive — an LLM is called on every chunk to extract entities, then again to summarize every community, then again per community at query time. Microsoft's own repo warns: "GraphRAG indexing can be an expensive operation… and start small." That cost is the single biggest reason teams hesitate to adopt it — and the reason the alternatives below exist.
Practical takeaways: which retrieval wins, when
Here's the honest, decision-ready summary. The "best" approach depends on the shape of the question you actually need to answer:
Match the retrieval strategy to the shape of the question.
Vector RAG wins on similarity and explicit fact retrieval. "Find all passages that mention X", "summarize the document most similar to this one", "what does the spec say about parameter Y" — single-hop, term-similarity questions. It's cheap, fast, and easy to set up (embed → store → query). Benchmarks like HotPotQA, MultiHop-RAG, and MT-Bench are oriented toward exactly this kind of vector-RAG / explicit-fact retrieval performance (the paper says so directly). If most of your workload is "pull the right passage," start here.
GraphRAG wins on multi-hop and whole-corpus "sensemaking." "What are the main themes across this entire corpus?" "Trace the network of relationships between these entities." "Compare how topic A relates to topic B and C across all documents." These are global questions where no single chunk is the answer. The paper's 1-million-token "global sensemaking" regime is exactly where GraphRAG's community summaries + map-reduce beat the RAG baseline on comprehensiveness and diversity. The cost is real, but so is the answer quality for genuinely corpus-level questions.
Hybrid / graph-retrieval wins when you already own a knowledge graph. If your data is already structured as a graph (a product catalog, an org chart, an ontology), the most practical pattern is Text2Cypher: have the LLM translate natural-language into Cypher, the Neo4j graph query language, then run it against the database and feed the records back to the LLM for the final answer. In the official Neo4j GraphRAG Python package (neo4j-graphrag), this is the Text2CypherRetriever: "This retriever first asks an LLM to generate a Cypher query to fetch the exact information required to answer the question from the database. Then this query is executed and the resulting records are added to the context for the LLM to write the answer." The same package also ships VectorRetriever, VectorCypherRetriever, and HybridCypherRetriever, so you can mix similarity search with graph traversal. (Source: neo4j/neo4j-graphrag-python repo docs.)
LightRAG (arXiv:2410.05779) is a pragmatic alternative to full Microsoft GraphRAG. It also incorporates graph structure into text indexing and retrieval, but uses a dual-level retrieval system to capture both low-level (entity) and high-level (thematic) knowledge, and — the selling point — it integrates graph structures with vector representations for efficient retrieval of related entities and relationships "significantly improving response times" while maintaining contextual relevance. If you like GraphRAG's graph thinking but find indexing too heavy, LightRAG is a strong middle ground.
LazyGraphRAG (Microsoft Research, Nov 2024) attacks the cost problem directly. Its premise is radical: no prior summarization of the source data, avoiding the up-front indexing costs that may be prohibitive for some use cases. It "blends the advantages of vector RAG and Graph RAG while overcoming their respective limitations" by using deferred LLM use — it does as much as possible with vector-style retrieval before spending an LLM call. The authors report that LazyGraphRAG's indexing cost is identical to vector RAG and 0.1% of full GraphRAG's, and that at ~4% of GraphRAG global-search query cost it can outperform competing methods on both local and global query types. (Source: Microsoft Research blog, "LazyGraphRAG: Setting a new standard for quality and cost.")
The bottom line
GraphRAG doesn't replace vector RAG — it complements it. Vector RAG is your precise scalpel for fact and similarity questions; GraphRAG is the wide-angle lens for understanding whole corpora; LightRAG, LazyGraphRAG, and Text2Cypher are the pragmatic tools when you want graph-like structure without GraphRAG's indexing tax. The good engineer's move is not to pick a single paradigm but to match the retrieval strategy to the generality of the question and the structure of the data.
Sources
Microsoft GraphRAG paper (arXiv): "From Local to Global: A Graph RAG Approach to Query-Focused Summarization" — Edge, Trinh, Cheng, Bradley, Chao, Mody, Truitt, Metropolitansky, Ness, Larson — https://arxiv.org/abs/2404.16130 (full text: https://arxiv.org/html/2404.16130v2)