GraphRAG builds a graph of entities and relations from your corpus, then retrieves connected subgraphs and their linked text to answer questions that span multiple documents.
Entity extraction and graph traversal
- An extraction pass, using an LLM, identifies entities and relationships in the corpus. In Microsoft's version, a clustering step then groups related entities into communities and the LLM writes a summary of each.
- Entities become nodes and relationships become edges, which builds the knowledge graph.
- A query is matched to entities in the graph.
- The system traverses edges from those entities to gather related facts, forming a connected subgraph.
- That neighborhood, with supporting passages, goes to a generator model that writes the answer.
Microsoft's GraphRAG adds pre-summarized clusters of related entities, which helps with global questions that need broad context. Because the graph carries community summaries and relationships, the generator receives context that connects the facts, grounded in the corpus instead of the model's training alone.
Multi-hop questions that vector RAG cannot answer
Plain vector RAG retrieves chunks independently by semantic similarity. That works for simple lookups. It struggles with a question like "Which vendors did we onboard that also failed the security review, and who approved them?" The answer is spread over several documents and no single chunk holds it. Vector RAG treats chunks in isolation and cannot follow relationships between them.
A graph makes the relationships first-class, so the system can hop from vendors to their security reviews and approvals. A regulatory compliance question that draws on several documents is another fit. The traversal path also explains how the answer was derived.
The graph is a join inferred from prose
Building the graph resembles a foreign-key JOIN across normalized tables: entities are rows and edges are the relationships. The difference is the source. A database schema enforces integrity, while this graph is inferred from unstructured prose, so edges can be imperfect or incomplete. A query can therefore return unexpected results where the extraction missed or misread a link.
GraphRAG or vector RAG
- Choose a knowledge graph when the domain has connected entities and multi-hop questions, such as compliance investigations or organizational knowledge.
- Choose vector RAG for lookup-style Q and A where the answer sits in one place. It is cheaper and quicker to deploy.
- Be wary of a graph when the underlying data changes often, because graph maintenance may outweigh the benefit.
Example scenario: graph retrieval accuracy falls from 85% to 65%
Suppose retrieval accuracy falls from 85% to 65%. The figures are illustrative. The usual cause is incomplete or wrongly linked entities: missing entities, or relationships that are poorly defined.
- Check the graph for entity completeness.
- Review the relationship definitions between entities.
- Read query logs for common failure points.
Improve entity linking and extend coverage of the corpus. Graph updates will take longer. Monitor query accuracy and how often entities are updated.
Primary source. GraphRAG: Unlocking LLM discovery on narrative private data, Microsoft Research Blog, by Jonathan Larson and Steven Truitt, 13 February 2024.