Guide · Open source
How to use GraphRAG: install, initialise and run it
Updated · written with AI from the project's own documentation and checked against our catalogue data
GraphRAG is an open-source Python project from Microsoft Research. It uses large language models to extract entities and relationships from text and organise them as a graph, so an LLM can reason over a document collection more effectively than simple keyword or chunk retrieval. This guide shows how to install it, create a project folder, and what to check before you spend money on indexing.
Quick start
- 1Check Python. GraphRAG is a Python package, so make sure Python is installed on your machine.
- 2Install the package. Run pip install graphrag to install GraphRAG from PyPI.
- 3Create a project folder. Run graphrag init --root ./ragtest to create a project folder at ./ragtest.
- 4Read the cost warning. Review the documentation on indexing costs, since the README warns indexing can be expensive.
- 5Start with a small dataset. Index a small set of your own documents first to check results and spending.
- 6Tune your prompts. Follow the Prompt Tuning Guide in the official docs to improve results on your data.
What GraphRAG does and who it is for
GraphRAG is described as a data pipeline and transformation suite. It extracts structured information, a graph of entities and relationships, from unstructured text, which an LLM can then use to answer questions about a collection of documents.
The README suggests it suits researchers exploring graph-based retrieval over narrative or private text, developers who want to experiment with LLM-built knowledge graphs from their own documents, and teams comfortable with Python that already pay for LLM API usage.
Check the project status before you start
GraphRAG is released as a research project. The README says it is largely in maintenance mode, won't accept new PRs or implement new features, and that bug fixes and dependency updates will be made as appropriate.
The README also states that the provided code is a demonstration and not an officially supported Microsoft offering. It is therefore a poor fit if you want a polished, supported end-user product.
Install GraphRAG from PyPI
The only prerequisite named in the source is Python. The project is published on PyPI, so you install it with pip.
pip install graphragInitialise a project folder
Create a project folder with the init command. The README's example uses ./ragtest as the root path. The folder is where GraphRAG keeps its configuration and prompts.
When you upgrade between minor versions, the README advises running init again with the --force flag to get the latest config format. This overwrites your configuration and prompts, so back them up first.
- Use --root to set the project path, for example ./ragtest
- Back up your configuration and prompts before running with --force
graphrag init --root ./ragtestTune your prompts and start small
The README says using GraphRAG with your data out of the box may not give the best results, and recommends following the Prompt Tuning Guide in the official documentation.
The README also warns that indexing can be an expensive operation because it relies on LLM calls. Read the documentation on the process and costs, and start with a small set of documents.
- Read the Prompt Tuning Guide at microsoft.github.io/graphrag before indexing a large dataset
- Begin with a small document set to estimate cost
Compare GraphRAG with similar projects
The source names LightRAG, LlamaIndex and Microsoft kotaemon as comparable projects. The README does not compare them on quality, cost or speed, so test each one on your own data before choosing.
- LightRAG
- LlamaIndex
- Microsoft kotaemon
What people use it for
- Exploring graph-based retrieval over narrative text such as stories or reports
- Experimenting with LLM-built knowledge graphs from your own private documents
- Researching how graph structures can give an LLM a targeted context for question answering
Frequently asked questions
Is GraphRAG free to use?
The source says GraphRAG is an MIT-licensed open-source project. However, indexing calls LLMs, and the README warns that indexing can be an expensive operation, so you will pay for your LLM API usage.
How do I install GraphRAG?
Install it from PyPI with pip install graphrag. The only prerequisite named in the source is Python.
What does graphrag init do?
It creates a project folder at the path you give with --root, such as graphrag init --root ./ragtest. The README says to run it with --force between minor version bumps to get the latest config format.
Is GraphRAG officially supported by Microsoft?
No. The README says the provided code serves as a demonstration and is not an officially supported Microsoft offering.
Will GraphRAG get new features?
Probably not. The README says the project is largely in maintenance mode and won't accept new PRs or implement new features, though bug fixes and dependency updates will continue.
What are alternatives to GraphRAG?
The source lists LightRAG, LlamaIndex and Microsoft kotaemon as comparable projects. Compare them on your own documents, since the README does not benchmark them.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
GraphRAG suits researchers and Python developers who want to experiment with LLM-built knowledge graphs and can afford LLM API costs. It is a poor choice if you need a supported product, expect new features, or have a tight budget, in which case consider one of the comparable projects named in the source.
Install options & downloads