Skip to content

GraphRAG

Python pipeline that uses an LLM to turn raw text into a graph for answering questions over private documents.

Stars
36.5k
Forks
3.9k
Licence
MIT
Language
Python
Last update
4 days ago
Type
Library

What it is

GraphRAG is a data pipeline and transformation suite from Microsoft Research. It uses large language models to pull structured information (a graph of entities and relationships) out of unstructured text, so that an LLM can reason about a collection of documents more effectively than simple keyword or chunk retrieval. It is released as a research project and the README describes it as largely in maintenance mode.

  • Extract entities and relationships from a body of narrative text into structured data
  • Ask questions across a document collection using graph-derived context
  • Tune prompts for your own data using the project's Prompt Tuning Guide

Great for

  • Researchers exploring graph-based retrieval over narrative or private text
  • Developers who want to experiment with LLM-built knowledge graphs from their own documents
  • Teams already comfortable with Python and paying for LLM API usage

Not ideal for

  • Anyone wanting a polished, supported end-user product, since the README says the code is a demonstration and not an officially supported Microsoft offering
  • Users with a tight budget, because the README warns that indexing can be an expensive operation
  • Teams expecting new features, since the README says the project won't accept new PRs or implement new features
Step-by-step guide: how to use GraphRAGInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Python

    Install from PyPI

    pip install graphrag

    Initialize a project folder

    graphrag init --root ./ragtest
  2. 2

    Run it

    • Read the command line quickstart in the documentation
    • Initialize a project folder with graphrag init
    • Add your input text and configure your LLM settings
    • Run indexing on a small sample first to understand cost
    • Query the indexed data
  3. 3

    Get the most out of it

    • Fine-tune prompts with the Prompt Tuning Guide before relying on results
    • Run graphrag init --root [path] --force between minor version bumps to get the latest config format, backing up your config and prompts first
    • Use the provided migration notebook between major version bumps to avoid re-indexing

Downloads

Strengths

  • Backed by a published Microsoft Research blog post and arXiv paper
  • Has an official documentation site with quickstart and prompt tuning guidance
  • MIT licensed with an active PyPI package

Trade-offs

  • Maintenance mode: only bug fixes and dependency updates, no new features
  • Indexing cost can be high, and the README advises starting small
  • Out-of-the-box results may be weak without prompt tuning

How it compares

ProjectStarsTypeLevelUpdatedBest for
graphrag (this)36.5kLibraryintermediate4 days agoResearchers exploring graph-based retrieval over narrative or private text
LightRAG40.5kLibraryintermediate7 days agoDevelopers building question-answering over their own document collections
llama_index52.8kLibraryintermediate10 days agoPython developers building retrieval-augmented generation (RAG) apps over private documents
DB-GPT20.2kAppintermediate4 days agoAnalysts who want to ask questions of CSV or Excel files in plain language
generative-ai-for-beginners123kLearning resourcebeginner5 days agoDevelopers who know some Python or TypeScript and want a guided introduction to generative AI
Prompt-Engineering-Guide79.8kLearning resourcebeginner8 months agoPeople who are new to prompting and want structured lessons with examples

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.