liveBook · Manning

Chapter 12: Graph-based RAG

What you will learn in chapter 12 of Retrieval Augmented Generation, The Foundational Ideas

This introduction explains when relationship-heavy questions call for graph-based retrieval and distinguishes the roles a graph can play in RAG.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This introduction explains when relationship-heavy questions call for graph-based retrieval and distinguishes the roles a graph can play in RAG.

Key terms: vector retrieval, multi-hop reasoning, text-to-SQL, knowledge graph, nodes, edges, triplet, traversal, graph-based RAG, GraphRAG

12.1 Graph-based RAG

Introduces graph-based RAG as an added relationship layer for retrieval and distinguishes three graph approaches by the questions they address.

Key terms: vector RAG, graph-based RAG, chunk, embedding, entities, relationships, traversal, community, ego-graph, nodes

12.1.1 The core architecture of graph-based RAG

This section explains the shared graph-based RAG workflow and how its indexing, retrieval, and generation context differ from standard RAG.

Key terms: G-Indexing, G-Retrieval, G-Generation, connected subgraph, element extraction, entities, relationships, triplets, graph construction, source grounding

12.2 Microsoft GraphRAG

Introduces the corpus-wide questions Microsoft GraphRAG targets, its precomputed hierarchy of graph summaries, and the indexing cost of that approach.

Key terms: Global Question problem, sense-making tasks, vector RAG, hierarchical graph structure, communities, summarization pyramid, pre-computed summaries, graph-structured summaries, naive RAG, heavier indexing

12.2.1 G-Indexing: Building the pyramid

GraphRAG builds a hierarchy of community summaries by extracting and consolidating a graph from the corpus, detecting connected communities, and summarizing them at successive levels.

Key terms: entities, relationships, numeric strength, gleaning loop, provenance, node-level description, Leiden, community, modularity, super-node

12.2.2 G-Retrieval and G-Generation: Map-reduce over the pyramid

Explains how Microsoft GraphRAG answers global questions by mapping over pre-computed community summaries and reducing ranked partial answers into one response.

Key terms: community summaries, hierarchy, global question, Map step, helpfulness score, partial answer, positional bias, Reduce step, final context window, global response

12.2.3 Implementing GraphRAG

This section walks through a simplified implementation of GraphRAG’s indexing core: constructing a directed entity graph, moving it between Python graph libraries, and identifying communities for later summarization.

Key terms: nx.DiGraph, add_elements, triplets, NetworkX, igraph, leidenalg, _nx_name, Leiden, ModularityVertexPartition, n_iterations=-1

12.3 HippoRAG

Introduces HippoRAG as a choice for multi-hop questions whose evidence spans documents that a flat vector search may not connect.

Key terms: HippoRAG, multi-hop questions, flat vector index, GraphRAG, surface vocabulary

12.3.1 From PageRank to Personalized PageRank

This section contrasts PageRank’s global ranking with query-anchored Personalized PageRank and explains why HippoRAG uses the latter to retrieve multi-hop bridging facts.

Key terms: PageRank, Personalized PageRank (PPR), random surfer, seed nodes, probability mass, HippoRAG, PPR, entity graph, bridging facts, vector search

12.3.2 How HippoRAG works

This section explains how HippoRAG builds a lightweight knowledge graph and uses query-seeded activation to find connections that direct matching can miss.

Key terms: G-Indexing, triples, Knowledge Graph (KG), synonymy edges, dense encoder, schemaless associative map, multi-hop retrieval, structural connectivity, GraphRAG, G-Retrieval

12.3.3 G-Generation: ranking by activation

Explains how HippoRAG turns graph activation into passages for an LLM and why its single-pass retrieval is cheaper and faster than iterative multi-hop reasoning.

Key terms: PPR scores, activation, passages, G-Generation, single-step multi-hop, iterative reasoning, IRCoT, PPR, index time

12.3.4 Implementing PPR activation

This section shows how HippoRAG extracts query entities as seeds and uses Personalized PageRank to rank graph nodes related to the query.

Key terms: seed entities, G-Indexing, synonym matching, bridge passages, personalization vector, PPR, NetworkX, random walk, structural centrality, damping factor

12.4 LightRAG

This section positions LightRAG among graph-based RAG approaches and explains how its dual-level retrieval and directly addressable profiles reduce query and update costs.

Key terms: GraphRAG, HippoRAG, LightRAG, global summaries, indexing budget, Dual-Level Retrieval Paradigm, vector search, graph traversals, specific entities, broad concepts

12.4.1 G-Indexing: Graph-enhanced indexing

LightRAG enhances graph indexing by distinguishing specifics from concepts and consolidating entity mentions into descriptive profiles.

Key terms: entity profiling, node profile, deduplicated index, strict duality, specifics, concepts

12.4.2 G-Retrieval: Dual-path routing

This section explains how LightRAG splits a question into entity-specific and thematic searches, checks the combined results, and uses them to generate an answer.

Key terms: low-level keys, high-level keys, graph path, vector path, dual-path, critic module, merged context, Reject/Retry, router, G-Generation

12.4.3 Implementing LightRAG

This section explains how LightRAG builds deduplicated entity profiles and uses a dual-path retriever to answer entity-specific and thematic queries.

Key terms: indexing pipeline, deduplicated entity profiles, entity, node, low-level retrieval path, dual-path router, low-level path, high-level path, vector similarity, synthesis

12.4.4 The three architectures on one question

A fixed supplier graph shows what GraphRAG, HippoRAG, and LightRAG read for the same recall question, revealing a cost-versus-coverage tradeoff and a missed two-hop answer.

Key terms: GraphRAG, HippoRAG, LightRAG, community report, two hops, brake actuator, low-level path, Personalized PageRank, damping factor, node degree

12.5 Evaluation and real-world application

This section explains how to evaluate whether graph-based retrieval adds value, where its ability to connect evidence matters, and how to interpret comparisons among graph RAG systems.

Key terms: interaction information, synergy, redundancy, BLEU, ROUGE, marginal contribution, ensemble of retrievers, dual-path design, vector index, Multi-hop Success Rate

12.6 Emerging optimizations

12.6.1 TagRAG

TagRAG lowers the cost of graph-based RAG indexing by linking documents through hierarchical tags instead of building richly described knowledge graphs.

Key terms: TagRAG, hierarchical tag chains, taxonomy, tag lineage, indexing token usage

12.6.2 Clue-RAG

Clue-RAG uses a three-part graph to preserve retrieval paths when automated knowledge-graph construction misses entity links.

Key terms: Clue-RAG, Knowledge Unit, retrieval path, recall, Multi-Partite Graph, Text Chunks, Knowledge Units, Entities

12.6.3 HybGRAG

HybGRAG chooses between vector and graph retrieval at runtime, then checks whether the retrieved content answers the query and can switch methods if it does not.

Key terms: HybGRAG, Retriever Bank, Vector, Graph, Router, Critic Module

12.6.4 AcademicRAG

The section explains how AcademicRAG uses graph-grounded keywords and citation relationships for literature discovery, then considers a source-grounded alternative to building graphs from raw chunks.

Key terms: semantic drift, clue-guided keyword generation, local subgraph, subgraph-based retrieval, citation lineage, relationship metadata, raw chunks, synthesized, interlinked prose, LLM Wiki, pages as nodes

12.6.5 Where this is going

The section contrasts today’s neuro-symbolic graph RAG with a proposed Graph Foundation Model that could reason directly over changing graphs without heavy indexing.

Key terms: Neuro-Symbolic, Symbolic System, topological data, Graph Foundation Model (GFM), graph inductive biases, Zero-Shot Graph Reasoning, internal attention mechanisms, indexing bottleneck

12.7 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 11: Correction, planning, and reasoning Chapter 13: Context compression and pruning →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.