GraphRAG
A modular graph-based Retrieval-Augmented Generation system from Microsoft that extracts knowledge graphs from unstructured text to improve LLM question answering.
At a Glance
About GraphRAG
GraphRAG is a Microsoft Research project that turns unstructured text into a knowledge graph and uses it to give LLMs better context when answering questions about private data. It ships as a Python data pipeline with a command-line interface, indexing and query packages, and prompt tuning guidance. The README notes the project is largely in maintenance mode, with bug fixes and dependency updates but no new features or PRs, and describes the code as a demonstration rather than an officially supported Microsoft offering.
What It Is
GraphRAG is a structured, hierarchical approach to Retrieval Augmented Generation, as opposed to baseline RAG that relies on vector similarity over plain text snippets. The project describes itself as a data pipeline and transformation suite for extracting structured data from unstructured text using LLMs. The documentation says that baseline RAG struggles to connect disparate pieces of information and to holistically understand large collections, and that GraphRAG is designed to address these two kinds of questions.
How the Indexing Pipeline Works
The index step slices an input corpus into TextUnits, which serve as analyzable units and provide fine-grained references in outputs. It then extracts entities, relationships, and key claims from those units. The graph is clustered hierarchically with the Leiden technique, and summaries are generated for each community from the bottom up. Docs also cover indexing methods, inputs, outputs, and bringing your own graph.
Query Modes
At query time, these structures supply context to the LLM. Global Search uses community summaries to reason about holistic questions over the corpus. Local Search fans out from specific entities to their neighbors and associated concepts. DRIFT Search does similar entity-focused reasoning but adds community information. Basic Search handles queries best answered by standard top-k vector search. Question generation is also documented.
Setup and Tuning
The recommended starting point is the command line quickstart. Configuration is created with the init command and documented in detailed YAML settings and language model selection pages. The docs strongly recommend prompt tuning, with auto and manual tuning guides, since out-of-the-box results may not be optimal. Indexing can be expensive, so the README advises starting small. Between minor versions, users should rerun the init command with force, and a migration notebook is provided for major version bumps.
Current Status
The latest release listed is v3.3.0. The repository is MIT licensed and states it is in maintenance mode, focused on bug fixes, dependency updates, and CVE responses.
Community Discussions
Be the first to start a conversation about GraphRAG
Share your experience with GraphRAG, ask questions, or help others learn from your insights.
Pricing
Open Source (MIT)
GraphRAG core is released under the MIT License and is free to use, copy, modify and distribute. LLM inference costs (e.g., model API usage) are external and not charged by the project.
- MIT License
- Self-hosted Python data pipeline and transformation suite
- Indexing, Global/Local/DRIFT/Basic search, prompt tuning
- Project is in maintenance mode; demonstration code, not an officially supported Microsoft offering
- Indexing can be expensive due to LLM usage costs
Capabilities
Key Features
- Knowledge graph extraction from unstructured text
- Entity, relationship, and claim extraction from TextUnits
- Hierarchical Leiden community clustering
- Bottom-up community summaries
- Global Search
- Local Search
- DRIFT Search
- Basic Search (vector top-k)
- Question generation
- Auto and manual prompt tuning
- Bring your own graph
- YAML configuration and init command
- Command line interface
- Example notebooks and visualization guide
