GraphRAG
An advanced RAG architecture that extracts entities and relationships into a knowledge graph, combining graph traversal with vector search for multi-hop reasoning and global synthesis
Table of Contents
Structure Diagram
What is GraphRAG?
An advanced RAG architecture that extracts entities and relationships into a knowledge graph, combining graph traversal with vector search for multi-hop reasoning and global synthesis. It is a core concept in Retrieval & RAG within AI / ML.
Core Principles
Standard chunk-based RAG retrieves isolated passages, making it weak on multi-hop relational queries (e.g., tracing indirect dependencies across documents) and global corpus-wide synthesis.
GraphRAG extracts entities and relationships into a Knowledge Graph during indexing and optionally pre-computes hierarchical community summaries. At query time, it combines vector entry-point matching with graph neighborhood traversal to feed connected evidence into the LLM.
Practical Takeaways
- Adopt selectively—indexing is expensive: Extracting graphs with LLMs costs far more than flat chunking. Exhaust Hybrid Search + Reranking first, and adopt GraphRAG when relational or global queries are core requirements.
- Constrain your ontology and resolve entities: Unconstrained extraction creates duplicate nodes (
MS,Microsoft). Define explicit entity/edge schemas and run entity resolution. - Always link graph nodes back to source chunks: Pairing traversed triples with their original text passages preserves nuance and verifiable citations.
Notable Examples
- Microsoft GraphRAG: Uses Leiden community clustering and hierarchical summaries to answer corpus-wide thematic questions.
- Financial & Supply-Chain Intelligence: Connects companies, suppliers, and regulations to trace cascading risk exposure.
- Codebase Architecture Assistants: Models services, APIs, and database tables as a graph to answer impact-analysis queries.