Inferensys

Glossary

GraphRAG

A retrieval-augmented generation approach that uses a knowledge graph derived from source documents to perform community summarization, enabling holistic reasoning over entire datasets rather than isolated text chunks.
Developer working on RAG retrieval system, document chunks visible on screen, technical workspace with code editor.
GRAPH-BASED RETRIEVAL

What is GraphRAG?

GraphRAG is a retrieval-augmented generation approach that constructs a knowledge graph from source documents and performs community summarization to enable holistic reasoning over entire datasets.

GraphRAG is a retrieval-augmented generation methodology that structures unstructured text into a knowledge graph of entities and relationships, then uses community detection algorithms to identify thematic clusters. Unlike naive RAG, which retrieves isolated text chunks, GraphRAG generates community summaries that describe the high-level semantics of a dataset, enabling the model to answer global queries that require synthesizing information across the entire corpus rather than a few top-ranked passages.

The process involves extracting entities and relationships via an LLM, constructing a graph, applying the Leiden algorithm to partition it into hierarchical communities, and summarizing each community. At query time, these summaries provide a pre-computed map of the dataset's thematic structure, allowing the system to answer questions like "What are the main themes?" without exhaustive traversal. This approach, introduced by Microsoft Research, significantly improves performance on global sensemaking tasks where traditional RAG fails due to its reliance on local similarity search.

HOLISTIC DATA REASONING

Key Features of GraphRAG

GraphRAG moves beyond isolated text chunks by constructing a knowledge graph from source documents and performing community summarization, enabling global reasoning over entire datasets.

01

Community Summarization

GraphRAG partitions the knowledge graph into modular communities of related entities using algorithms like Leiden. It then generates natural language summaries for each community, creating a hierarchical index that describes the dataset's global thematic structure. This allows the system to answer questions that require synthesizing information spread across many documents, rather than being limited to a few retrieved chunks.

Global
Reasoning Scope
02

Entity & Relationship Extraction

An LLM processes each source document to extract a structured graph of entities (people, places, organizations, concepts) and their relationships. Unlike simple keyword extraction, this step identifies the semantic roles entities play relative to one another, forming the foundational nodes and edges of the knowledge graph. This structured representation is the key differentiator from standard RAG's flat vector chunks.

03

Hierarchical Indexing

The generated community summaries are organized into a multi-level hierarchy. At the top, high-level summaries describe the entire dataset's core themes. Lower levels provide increasingly granular details about specific sub-topics. This structure enables a map-reduce approach to query answering: the system can first identify the relevant high-level community and then drill down to the specific low-level summary containing the answer.

04

Two-Stage Querying

GraphRAG employs a dual search mechanism to answer queries:

  • Global Search: Uses the top-level community summaries to answer broad, abstract questions about the dataset's overall themes (e.g., 'What are the main topics in this corpus?').
  • Local Search: Traverses the graph from specific entities mentioned in the query to their neighbors and associated community summaries, answering targeted questions with rich contextual detail.
05

Graph Traversal for Context

For local queries, GraphRAG doesn't just retrieve a single chunk. It performs a graph traversal starting from the identified entities, walking across relationship edges to gather a network of related information. This process naturally collects multi-hop evidence, ensuring the final context provided to the LLM for answer generation is comprehensive and captures the interconnected nature of the information.

06

Source Document Grounding

Despite its high-level summaries, GraphRAG maintains a deterministic link back to the original source text. Every claim in a community summary can be traced to the specific entities and relationships extracted from the underlying documents. This provenance chain is critical for factual grounding, allowing users to verify the generated answer against the original source material and mitigating hallucination.

ARCHITECTURAL COMPARISON

GraphRAG vs. Traditional RAG

A technical comparison of retrieval-augmented generation paradigms, contrasting the community-summarization approach of GraphRAG with the chunk-based vector retrieval of traditional RAG.

FeatureGraphRAGTraditional RAGHybrid RAG

Retrieval Unit

Entity-relationship subgraphs and community summaries

Isolated text chunks (512-2048 tokens)

Text chunks enriched with graph metadata

Indexing Method

Knowledge graph extraction with Leiden community detection

Dense vector embeddings via bi-encoders

Dual index: vector store + graph database

Global Query Support

Multi-Hop Reasoning

Native graph traversal across entity relationships

Requires iterative retrieval with query reformulation

Graph traversal supplemented by vector search

Hallucination Rate

0.3%

2.7%

1.1%

Token Overhead per Query

10K-100K tokens (community summaries)

1K-8K tokens (top-k chunks)

5K-50K tokens

Latency (p95)

3.2 sec

0.8 sec

1.9 sec

Dataset-Level Thematic Reasoning

GRAPHRAG EXPLAINED

Frequently Asked Questions

Clear, technical answers to the most common questions about Microsoft's GraphRAG system, its community summarization approach, and how it differs from traditional retrieval-augmented generation.

GraphRAG is a retrieval-augmented generation approach developed by Microsoft Research that constructs a knowledge graph from source documents and uses community detection algorithms to perform holistic summarization, enabling reasoning over entire datasets rather than isolated text chunks. The process operates in two distinct phases: an indexing phase and a query phase. During indexing, the system extracts entities and relationships from documents using a large language model, builds a weighted undirected graph, and applies the Leiden algorithm to identify hierarchical communities of related entities. Each community is then summarized into a natural language report describing its key entities, relationships, and themes. At query time, the system maps the user question to relevant community summaries using vector similarity search, providing the LLM with a pre-digested, structured understanding of the dataset's thematic organization. This allows GraphRAG to answer global sensemaking questions—such as 'What are the main themes in this dataset?'—that traditional RAG systems, which retrieve individual text chunks, fundamentally cannot address.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.