liveBook · Manning

GraphRAG

As explained in Retrieval Augmented Generation, The Foundational Ideas

Graph RAG is a retrieval-augmented generation architecture that represents corpus relationships as a graph and retrieves evidence through graph structure.

Suppose a procurement team asks, “What themes recur across this year’s vendor disputes?” The answer may be spread across hundreds of emails. Vector RAG can retrieve relevant individual messages, but its top results may miss the corpus-wide pattern. GraphRAG is designed for this kind of global, sense-making question: it organizes entities and relationships into communities, then uses summaries of those communities to support an answer. section 12.1 section 12.2

A standard vector index retrieves text chunks by similarity. Graph-based RAG adds an explicit network of entities and relationships derived from those chunks; retrieval can use graph structure rather than relying only on the closest passages. GraphRAG’s distinctive move is to summarize densely connected communities at multiple levels, making broad synthesis possible at query time. section 12.1 section 12.2

Separate the expensive preparation from the online question:

  • Indexing: extract entities and relationships, build a graph, detect communities, and prepare hierarchical community summaries. section 12.2 section 12.2.3
  • Querying: read community reports and combine their contributions through a Map-Reduce-style search, rather than expecting a few matching chunks to contain the whole answer. section 12.2 section 12.4.4
Figure 12.3 The summarization pyramid. The four phases of GraphRAG (extraction, community detection, hierarchical summarization, and Map-Reduce search) build and query this structure.

The summarization pyramid shows how extraction, community detection, and hierarchical summaries create the structure queried by Map-Reduce search. section 12.2

A recall question with a costly answer path

In an eleven-node supplier graph, a question about suppliers affected by a 2023 recall requires reaching a supplier two hops from the named entities. GraphRAG has that supplier available to the generator because it reads every community report. The comparison illustrates both the value of broad coverage and its price: the reported larger retrieval setting reads roughly 610,000 tokens of community reports for one question. section 12.4.4 section 12.4

Choose GraphRAG when recurring themes or other corpus-wide conclusions matter enough to justify heavy indexing and potentially expensive report reading. Use simpler vector retrieval for local lookups; consider HippoRAG for connections across documents or LightRAG when some graph structure is useful but the full indexing bill is not. A graph is also not a shortcut through fragmented enterprise systems: relationships must first be captured across the sources a question spans. section 12.1 section 12.4 section 15.8.4

How Retrieval Augmented Generation, The Foundational Ideas covers it

How deep it goes
Explains the indexing and search phases and reconstructs a stripped-down Python indexing core, short of the full released pipeline.
Examples
Uses vendor disputes, incident reports, and a hand-built supplier graph to contrast global coverage with narrower retrieval.
What it assumes
Introduces graph retrieval vocabulary before the pipeline, while the Python walkthrough uses graph libraries and structured extraction output.
What you can do after
Evaluate/understand it for global questions and weigh its coverage against indexing and query-time costs.
How it connects
Connects vector retrieval, knowledge graphs, Leiden community detection, hierarchical summarization, and Map-Reduce search.

Also explained in

Compare how 7 books explain GraphRAG →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Retrieval Augmented Generation, The Foundational Ideas. The section links point to the parts of the book it draws on.