GraphRAG
GraphRAG turns your documents into a map of people, places and links, groups and summarises it, then answers questions from that map.
Plain RAG answers a question by finding the few passages that best match it. That works for “what does page 12 say”. It struggles when the answer is spread across hundreds of files. It also struggles when you ask about the whole pile at once, such as its main themes.
GraphRAG, from Microsoft Research, prepares the documents first. A language model (the kind of AI behind chatbots) reads them. It lists the entities, meaning people, places or organisations, and how they are linked. Together these form a knowledge graph: a map of dots joined by lines. The graph is then split into communities, which are groups of closely linked entities. Each community gets a short written summary.
Picture a journalist with a pile of podcast transcripts who asks which episodes deal mainly with tech policy. No single passage says that. So GraphRAG uses global search, which reads the summaries instead of the raw text. Each community summary gives a partial answer, and each point in it gets a score. The strongest points are then combined into one reply. A narrow question about one named thing works differently. Local search starts at that entity and follows its links.
For engineers: Microsoft’s paper builds the index in two stages, an entity graph and then community summaries. Communities come from the Leiden algorithm, a method that guarantees each community is connected. The evaluation used two corpora (document collections) of about one million tokens each. The code is a demo that Microsoft does not officially support.
Plain RAG finds matching passages, which is not always enough.
Build the map once, then ask a whole-collection question.
- 1 · sliceThe documents are cut into small pieces called text units.
- 2 · extractA language model pulls out the entities, their relationships and key claims, which form a knowledge graph.
- 3 · groupThe graph is split into communities of closely linked entities, nested from broad to detailed.
- 4 · summariseA summary is written for each community, from the bottom level up.
- 5 · answerAt question time, those summaries and graph pieces are handed to the model as context.
GraphRAG reads the summaries, not just the closest passages.
| Who | What they ask | What it works with |
|---|---|---|
| Journalist | “Which podcast episodes deal mainly with tech policy?” | Community summaries built from the transcripts |
| Teacher | “What health topics in the news could go into a lesson?” | Summaries of a large news archive |
| Researcher | “What are the main themes across these reports?” | Top-level community summaries |
| Analyst | “What do the documents say about this company and who it works with?” | The company entity, its neighbours and linked text units |
- It can answer questions about a whole collection, such as its main themes.
- In tests on two collections of about a million tokens, its answers were more complete and varied than plain RAG.
- Local search can answer about one entity by following its links to neighbours.
- Text units give fine-grained references back to the original documents.
- Building the index can be expensive, so the project advises starting small.
- Results out of the box may be weak; the makers recommend tuning the prompts.
- It was tested on only two collections, so how well it works elsewhere is still open.
- Microsoft's project is in maintenance mode and takes no new features.
Sources used
This explainer is written in original language. The links below support its factual claims.
- paperFrom Local to Global: A Graph RAG Approach to Query-Focused Summarization, Edge et al., Microsoft Research · read 28 Sept 2026
- docsWelcome to GraphRAG, Microsoft · read 28 Sept 2026
- docsGlobal Search, Microsoft · read 28 Sept 2026
- docsLocal Search, Microsoft · read 28 Sept 2026
- repomicrosoft/graphrag, Microsoft on GitHub · read 28 Sept 2026
- paperFrom Louvain to Leiden: guaranteeing well-connected communities, Traag, Waltman and van Eck · read 28 Sept 2026