What is GraphRAG?
In Turkish: GraphRAG · Topic: Using AI
A variant of retrieval-augmented generation that also draws on a knowledge graph extracted from documents, giving the model the relationships between entities along with the relevant text.
How does it work?
First, entities and the relationships between them are extracted from documents, often with a language model, and a graph is built from the results. In some implementations, tightly connected nodes are grouped into communities and a summary of each community is prepared. When a question arrives, the relevant nodes and their neighbors, and sometimes community summaries, are retrieved. These are given to the model as context together with the relevant text passages. The term became widespread through work published by Microsoft Research; details vary from one implementation to another.
Why does it matter?
Classic RAG is good at finding a few relevant passages but can struggle to pull together relationships spread across many documents. GraphRAG aims to do better on multi-step questions and questions about a whole data set. The trade-off is that building and maintaining the graph can be costly and complex.
Example
When asked which suppliers in a company's hundreds of contracts are linked through shared subsidiaries, the system can answer by moving through the network of relationships.
FAQ
What is the difference between GraphRAG and classic RAG?
Classic RAG usually finds text passages similar to the question and hands them to the model. GraphRAG additionally uses a graph of relationships between entities, which helps answer questions that need connected information.
Does every project need GraphRAG?
No. If questions can be answered from information in a single document, classic RAG is often enough and much cheaper. GraphRAG makes sense when relationships and the big picture matter.