Overview

12 Graph-based RAG

Graph-based RAG extends standard retrieval by adding explicit relationships to the indexing and search process. Instead of treating text as isolated chunks connected only by similarity, it builds a graph of entities and edges so the system can retrieve not just what looks relevant, but what is structurally connected. This matters most for questions whose answers are distributed across documents, where the missing link is a relationship rather than a matching phrase.

The chapter groups the main designs into three patterns. One uses the graph for global sense-making by precomputing community summaries over hierarchical clusters, making it strong for broad, corpus-wide questions. Another uses the graph as an associative memory that spreads activation from query seeds to hidden bridge nodes, which helps with multi-hop reasoning. A third combines graph structure with vector search, routing queries to the most efficient path so the system can handle both specific facts and broader themes without paying the full cost of heavy graph summarization.

Each approach trades off build-time cost, query-time speed, and reasoning depth. GraphRAG offers the strongest global synthesis but requires expensive indexing and summarization. HippoRAG is cheaper to build and effective for connecting distant facts, but it does not provide rich global summaries. LightRAG aims for practical deployment by using a lightweight graph to improve retrieval quality while keeping most queries fast. The chapter closes by emphasizing that the right choice depends on whether the task is local lookup, multi-hop association, or dataset-level synthesis, and suggests that future systems may push more graph reasoning directly into the model itself.

A small knowledge graph for the authentication-service example. Three kinds of nodes: services in blue, the teams that own them in green, the incident in orange. Follow the depends_on edges into AuthService to see which services a change would touch, then the owned_by edges out of those to reach the teams that need telling. INC-2347 hangs off AuthService by triggered_by, which is how the past-incident half of the question gets answered by the same walk.
The same corpus and the same query, run through both workflows.
The summarization pyramid. The four phases of GraphRAG (extraction, community detection, hierarchical summarization, and Map-Reduce search) build and query this structure.
The associative ripple.
LightRAG's dual-path router.

Summary

  • The unit of retrieval changes from the chunk to the relationship: These systems build an answer by following edges between entities instead of fetching a passage that already contains it.
  • Three lineages, by what the graph is for: Global summarizers such as Microsoft's GraphRAG for sense-making across a whole corpus, associative reasoners such as HippoRAG for connecting facts that never appear together, and hybrid optimizers such as LightRAG for keeping the cost down.
  • Traversal replaces similarity: Personalized PageRank walks from the entities in the query to related ones, reaching documents that share no words with it.
  • Construction is where the money goes: an LLM reads every chunk and extracts entities before anything can be indexed. That upfront pass is what buys answers to the disconnected-fact questions flat RAG cannot reach.
  • Text-overlap metrics cannot score this: Interaction information measures synergy directly, going negative when two passages answer a question together that neither answers alone, which is the thing the graph was built to produce.
  • Nobody has published a deployment of these three: The measured production case in this space is LinkedIn's customer-service knowledge graph, which cut median per-issue resolution time by 28.6%.

FAQ

Why does vector search fail on multi-hop, relationship-heavy questions?Vector search measures similarity, so it finds chunks that look like the query. For questions that require connecting facts across multiple documents, the needed intermediate facts often share little or no vocabulary with the question, so the search misses the chain of relationships.
What is graph-based RAG?Graph-based RAG augments or replaces the flat vector index with an explicit graph of entities and relationships. Retrieval becomes traversal over connected nodes rather than just nearest-neighbor similarity search.
How does graph-based RAG differ from standard RAG?Standard RAG retrieves text chunks by distance in embedding space. Graph-based RAG retrieves entities, relationships, or communities from a graph, using traversal or activation flow to gather connected evidence.
What are the three main graph-based RAG approaches discussed in the chapter?The chapter groups them into three types: GraphRAG as a global summarizer, HippoRAG as an associative reasoner, and LightRAG as a hybrid optimizer that routes between graph and vector retrieval.
How does Microsoft GraphRAG work?GraphRAG extracts entities and relationships from chunks, clusters the resulting graph with Leiden community detection, pre-computes hierarchical summaries for each community, and answers global questions with a Map-Reduce-style search over those summaries.
Why is the Leiden algorithm used in GraphRAG?Leiden finds densely connected communities while ensuring they remain internally connected. That makes the communities coherent enough to summarize, and its repeated aggregation naturally creates a hierarchy for multi-level summaries.
What problem does HippoRAG solve?HippoRAG is designed for multi-hop questions where the answer lies in a chain of facts spread across documents with no shared wording. It uses Personalized PageRank to spread activation from query seed entities and surface hidden bridging nodes.
How does Personalized PageRank help retrieval in HippoRAG?PPR starts from query-mentioned seed nodes and repeatedly teleports back to them while walking the graph. Nodes that are structurally close to multiple seeds accumulate high score, which helps reveal connecting facts even without lexical overlap.
What is LightRAG’s dual-level retrieval idea?LightRAG splits retrieval into two paths: a low-level graph path for specific entities and their neighbors, and a high-level vector path for broader thematic matches. The system routes the query between them and merges the results before generation.
How can you tell whether a graph is worth its cost?Use measures that capture synergy, not just overlap. The chapter highlights interaction information: if two passages only answer the question together, they show negative synergy, which suggests the graph added value beyond plain vector retrieval.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Retrieval Augmented Generation, The Foundational Ideas ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Retrieval Augmented Generation, The Foundational Ideas ebook for free