liveBook · Manning

Chapter 7: Microsoft’s GraphRAG implementation

What you will learn in chapter 7 of Essential GraphRAG

This chapter introduces Microsoft’s GraphRAG pipeline, which builds a summarized knowledge graph and retrieves from it through global and local search.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This chapter introduces Microsoft’s GraphRAG pipeline, which builds a summarized knowledge graph and retrieves from it through global and local search.

Key terms: Microsoft’s GraphRAG, MS GraphRAG, knowledge graph, LLM, entities, relationships, entity summaries, relationship summaries, graph communities, community summaries

7.1 Dataset selection

This section explains how to choose a suitable unstructured-text dataset and define entity types before implementing Microsoft GraphRAG.

Key terms: MS GraphRAG, unstructured text documents, entities, text chunks, cross-chunk summarizations, entity types, extraction, linking, summarization, domain-specific entities

7.2 Graph indexing

This section introduces constructing a knowledge graph from The Odyssey with the Microsoft GraphRAG pipeline, emphasizing that modeling choices affect summaries and queries.

Key terms: knowledge graph, entity summaries, community summaries, MS GraphRAG pipeline, entity selection, graph connectivity, summaries, queries, The Odyssey, Gutenberg project

7.2.1 Chunking

This section prepares The Odyssey for MS GraphRAG indexing by splitting it along natural book boundaries, measuring token lengths, and further chunking the books with a chosen size and overlap.

Key terms: prefaces, footnotes, books, token counts, natural divisions, chunk size, entity references, self-reflection iterations, extraction passes, 600-token chunk size

7.2.2 Entity and relationship extraction

This section configures an LLM prompt to extract typed entities and scored relationships from The Odyssey, imports the results into Neo4j, and examines the resulting descriptions and duplicates.

Key terms: entity_types, entity_name, entity_type, entity_description, source_entity, target_entity, entity types, PERSON, ORGANIZATION, LOCATION

7.2.3 Entity and relationship summarization

This section explains how MS GraphRAG uses LLMs to consolidate repeated entity and relationship descriptions into coherent graph summaries while managing high-volume super nodes.

Key terms: entity and relationship summarization, descriptions, coherent summary, redundancy, fragmentation, summarization prompt, description list, third person, contradictions, entity names

7.2.4 Community detection and summarization

This section detects densely connected graph communities with Louvain and produces structured community summaries for downstream GraphRAG retrieval.

Key terms: community, community detection, entities, relationships, Louvain method, node property, Graph Data Science library, non-deterministic, community summarization, TITLE

7.3 Graph retrievers

This section introduces graph retrieval after indexing and contrasts local and global search as the two approaches explored next.

Key terms: graph retriever stage, graph indexing, structured graph, local search, global search, detected community, entire graph structure

7.3.1 Global search

This section explains how GraphRAG global search uses a map-reduce workflow over community summaries to answer broad questions spanning an entire dataset.

Key terms: global search, community summaries, community reports, vector similarity, map step, reduce step, intermediate responses, key points, importance rating, community hierarchy

7.3.2 Local search

This section implements Microsoft GraphRAG local search, which starts from semantically matched entities and combines their graph neighborhood and source text into a cited, evidence-grounded LLM answer.

Key terms: local search, entity-focused queries, structured knowledge graph data, unstructured text, entity summaries, text embeddings, vector index, vector search, entry points, Cypher statement

7.4 Summary

This summary recaps Microsoft GraphRAG’s graph-indexing pipeline, its global and local retrieval modes, and the choices that affect retrieval quality and scale.

Where this is used later

Concepts explained in this chapter

← Chapter 6: Constructing knowledge graphs with LLMs Chapter 8: RAG application evaluation →

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.