GraphRAG

GraphRAG is a retrieval-augmented generation method from Microsoft Research that has a language model build a knowledge graph of a document collection, then answers questions from summaries of that graph.

Standard retrieval-augmented generation finds the passages closest to a question and hands them to a model. That works for a question such as what a refund policy says. It fails for questions such as what the main themes are across thousands of documents, because no single passage holds the answer. The GraphRAG paper calls these global sensemaking questions, and treats them as a summarisation task rather than a search.

GraphRAG prepares the material in advance. A language model reads the source text and extracts entities, such as people, organisations and places, and the relationships between them, building a knowledge graph. The graph is then divided into communities of closely connected entities, at several levels of detail, and the model writes a summary of each community. To answer a question, each relevant community summary produces a partial answer, and those partial answers are combined into a final one.

The method was described in April 2024 by Darren Edge and colleagues at Microsoft in From Local to Global: A Graph RAG Approach to Query-Focused Summarization. On global questions over datasets of around a million tokens, they reported that it produced substantially more comprehensive and diverse answers than a conventional RAG baseline. Microsoft released the code on GitHub on July 2, 2024, along with a ready-to-deploy version for its Azure cloud.

An example: a newsroom holding a year of interview transcripts wants to know which groups keep appearing in disputes over a port expansion. Plain vector search returns a handful of matching quotes. GraphRAG can answer from summaries that cover every connected person and organisation in the collection.

The trade-off is cost. Building the graph means running a language model over the entire collection before anyone asks a question, and Microsoft acknowledged these upfront costs when it released the code. For simple lookups ordinary RAG is cheaper and usually good enough. The name graph RAG is also used loosely for any retrieval system that draws on a knowledge graph, not only Microsoft's method.

Common questions

What is GraphRAG?

It is a method, published and open-sourced by Microsoft Research in 2024, that uses a language model to turn a document collection into a knowledge graph with summaries of related groups of entities. Questions are answered from those summaries. It is designed for broad questions about a whole collection.

What is the difference between GraphRAG and RAG?

Ordinary RAG retrieves the text passages most similar to a question. GraphRAG first builds a graph of entities and relationships across all the documents and summarises it, so it can answer questions whose answers are spread across many documents. Ordinary RAG is better suited to looking up specific facts.

Is GraphRAG expensive?

Indexing can be. A language model has to process the whole collection to extract entities and write summaries before any question is asked, and Microsoft has said these upfront costs must be weighed against the benefits. Answering questions afterwards also uses more model calls than simple retrieval.

Is GraphRAG open source?

Yes. Microsoft published the GraphRAG code on GitHub in July 2024, together with an accelerator for deploying it on Azure. Other databases and frameworks have since added their own graph-based retrieval features.

Finding more

Search for "GraphRAG", "graph RAG knowledge graph retrieval" or "query-focused summarization" to understand the approach and its alternatives. Start with the Microsoft Research paper and project documentation, then look for independent evaluations that compare graph-based and vector-based retrieval on the same data. Vendor blog posts often present graph retrieval as better across the board, which the original paper does not claim.

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.