What is GraphRAG (graph retrieval-augmented generation)?
GraphRAG is a RAG approach that brings a knowledge graph extracted from documents into retrieval-augmented generation, so it can answer when information is spread across many documents or a question concerns the whole collection.
It differs from classic Retrieval-Augmented Generation in what is retrieved: classic RAG fetches passages similar to the question, while GraphRAG also builds a knowledge graph of entities, relations and community summaries for retrieval. It is not better for every question; for simple local ones the extra indexing can be wasted.
- Topic
- Embeddings, document processing and RAG
- Also known as
- Graph RAG, graph-based RAG
- Origin
- 2024, Edge et al.
How GraphRAG (graph retrieval-augmented generation) works
- Documents are chunked; a language model extracts entities, relations and key claims from each chunk.
- These are merged into a graph; communities are detected and a summary is generated for each.
- At query time relevant nodes, relations or community summaries are retrieved; local questions use an entity's neighbourhood, global ones use community summaries.
- The retrieved information goes to the language model as context to produce an answer or collection summary.
In more detail
Entity resolution and deduplication
Entity extraction across chunks inevitably creates duplicates (such as "ACME Corp." and "ACME") and conflicting relations, so an entity resolution and deduplication step is critical before community detection. Without clean merging, graph connectivity fragments and retrieval quality drops sharply.
Hierarchical community detection and global map-reduce querying
In Microsoft's GraphRAG architecture, communities are organised hierarchically (commonly using the Leiden algorithm) and global queries run via a map-reduce pattern: intermediate answers are scored per community summary and then synthesised into a final response. Choosing the hierarchy level balances detail against token budget and latency.
Newer lower-cost approaches and incremental updates
To curb the heavy LLM indexing cost of classic GraphRAG, current variants such as LazyGraphRAG, DRIFT Search and LightRAG defer or simplify expensive summary generation, combine local neighbourhood walks with global community context or support cheaper incremental graph updates. Production deployments often pair a vector index with a lightweight graph index rather than building full summaries upfront.
Commonly confused terms
| Term | How it differs |
|---|---|
| Knowledge graph | A traditional Knowledge Graph relies on a curated, rigid ontology/schema populated via deterministic rules or manual curation; GraphRAG typically uses an LLM to extract open-schema entities, claims and community summaries directly from raw documents. |
| Agentic RAG | Agentic RAG routes queries iteratively across tools and retrieval steps at query time, while GraphRAG structures the knowledge corpus into a graph and community hierarchy ahead of time during indexing (though the two can be combined). |
Why GraphRAG (graph retrieval-augmented generation) matters for on-premises AI
It can combine relations spread across many regulations, contracts or reports into one answer and handles questions about a whole collection's themes better than classic RAG. In return, extracting entities and relations and summarising communities needs many language model calls during indexing, so in-house GPU capacity and time are planned ahead. Documents and extracted relations stay in-house; automatically extracted relations should be checked.
A bank combines credit rules spread across several regulations and instructions in an in-house knowledge graph; inspectors' policy questions get one answer with sources.
Common questions
When does GraphRAG beat classic RAG?
When the answer is spread across many documents or a summary of the whole collection is needed. For questions answered in one document, classic RAG is usually enough.
Why does GraphRAG raise in-house hardware cost?
Extracting entities, relations and community summaries from every chunk needs many language model calls during indexing; the load grows with document count.
Related terms
- Retrieval-Augmented Generation
- Knowledge graph
- Retrieval
- Multi-hop retrieval
- Vector search
- Naive RAG
- Named entity recognition
- Recursive Abstractive Processing for Tree-Organised Retrieval
Sources
- Edge et al., From Local to Global: A Graph RAG Approach to Query-Focused Summarization, 2024
- Hogan et al., Knowledge Graphs, ACM Computing Surveys, 2021
Related page on this site: Related FAQ · In the glossary: Glossary, D to L