Glossary
What is GraphRAG
In short
GraphRAG is a version of RAG in which the AI first builds a knowledge graph from documents, about people, companies and the links between them, and then answers from this graph and its summaries.
Search and RAG · GraphRAG
MMOOZZGG.com editorsChecked: 1 min read
For a child
Imagine a board in your classroom where you draw all the characters of a fairy tale as circles and join them with arrows: who is whose friend, who lives where. Then the teacher asks: what is the whole tale about? You look at the board and see the whole picture at once, not just one page. GraphRAG helps a computer draw such a board from many books.
In plain words
Plain RAG finds a few similar pieces of text and answers from them. It cannot answer a question like what the main topics in all the reports for the year are: the answer is spread over hundreds of documents. GraphRAG reads the whole archive in advance and writes down the participants and links: who worked with whom, which project belongs to which client. The result is a graph. Then the system splits it into groups of closely linked objects and writes a short summary for each. For a general question, the answer is built from these summaries.
For business
The graph approach is useful when a manager needs an answer across the whole set of documents: a review of client complaints for the quarter, links between contractors and contracts, risks across a project portfolio. The main cost item here is indexing: the model reads every document and builds the graph before the first question, which means many calls and tokens. If the archive is updated often, the graph is rebuilt, and that costs money too. The risk is in extraction quality: if the model links entities wrongly, the error gets into all the summaries. For a pinpoint question such as what the payment term is in the contract with a supplier, plain search answers more cheaply. Choose the setup after comparing both on your own documents.
For a specialist
GraphRAG was proposed in the work of Edge et al. (Microsoft, 2024) for global questions about the whole corpus, which plain RAG cannot handle. The authors classify such questions as query-focused summarization (QFS), not retrieval. The index is built in two stages. First, an LLM extracts entities and relations from the chunks and assembles an entity knowledge graph. Then the graph is recursively split into communities with the Leiden algorithm, and a summary is written in advance for each community. For a global question, each summary gives a partial answer, and the partial answers are combined into the final one in a map-reduce scheme. Long chunks reduce the number of model calls and the indexing cost, but entities from the start of a chunk are extracted worse. The Microsoft documentation describes the Global Search, Local Search (an entity and its neighbors in the graph), DRIFT Search and Basic Search modes, the last being plain vector top-k.
Example
The quality department uploads thousands of client requests for the year and asks which complaint topics are growing. GraphRAG answers from summaries of groups of related problems, not from three random letters.
Related terms
Questions and answers
Sources
Where companies use it
Not sure whether your company needs this?
AI solutions map