← the late compiler
C_000181 · llms and generative ai · foundation

GraphRAG

Retrieval over a knowledge graph of entities and relationships, so answers can follow connections rather than only match text.

Step 1 of 4

In words

What it is, why it matters, and what it is like.

Why am I learning this?

This unlocks the ability to build systems that answer questions where the answer lives in the connections between facts, not just in matching text. You'll be ready for Agentic Retrieval (letting the model search iteratively), Hybrid and Semantic Search (combining keyword and meaning-based retrieval), and Enterprise Knowledge Assistants (grounding answers in an organization's documents). GraphRAG is also a key step toward Knowledge Graphs and Multi-Document Retrieval, and it's a critical tool for Hallucination Mitigation — because when the answer depends on relationships, a graph lets you follow the links to verified facts instead of guessing.

The idea, in plain terms

Imagine you have a box of recipe cards. Each card has a title and a list of ingredients. If someone asks, 'What can I make with paneer and spinach?', you can flip through the cards and find the ones that mention both. That's like vector retrieval — finding documents that are similar in meaning. But now suppose someone asks, 'Which of my friends would enjoy a dinner party with both a vegetarian and a strict vegan guest?' The answer isn't on any single card. You need to know that Priya is vegetarian, that Rohan is vegan, that both of them like Italian food, and that the restaurant you have in mind serves both. That knowledge is spread across multiple cards, and the answer comes from *connecting* them: Priya → likes Italian → restaurant serves vegan → Rohan likes it too. That's the problem GraphRAG solves. A knowledge graph is a map where things (entities) are points, and the relationships between them are lines. When you retrieve an answer with GraphRAG, you don't just pull documents that match the words — you walk along the lines of this map, from entity to entity, to find the facts that are *linked* in a way that answers the question. The key insight is that the answer is not in any single document; it's in the *connections* between facts scattered across many documents.

An analogy

Think of a city's road network. A map is a graph: intersections are entities (like 'Chai Point', 'Metro Station'), and roads are relationships (like 'is next to', 'is 200 metres from'). If someone asks, 'How do I get from the station to the bookshop?', you can look at the map and follow the roads. Now imagine you have a stack of photo albums, each with pictures of a different part of the city. If you only had the photos, you'd have to flip through every album to find a picture of the station and a picture of the bookshop, and then try to figure out if they're connected — but they might not even be in the same album. That's like vector retrieval — you have the pieces, but not the connections. GraphRAG is the map. It's built by first looking at all the photos (documents), extracting the landmarks (entities) and the roads between them (relationships), and drawing them on a single map. Then, when someone asks a question that spans multiple landmarks, you can trace the route on the map instead of searching through photos. Where does the analogy stop? A map is static; a knowledge graph can be updated as new documents arrive. A map shows physical distance; a graph can show any kind of relationship — 'works for', 'is allergic to', 'is a cause of'. But the core idea — that knowledge is in the connections, and you navigate it by following links — holds perfectly.

Definition

GraphRAG is a retrieval technique that first builds a knowledge graph — a network of entities (people, places, concepts) and the relationships between them — from a corpus of documents, and then, at query time, retrieves answers by traversing this graph to find entities and paths that are relevant to the question, rather than only matching the text of the question to the text of documents.

Where this sits

This concept builds on Embeddings (how documents become numbers for vector search) and Vector Databases (how those numbers are stored and searched). It also connects to Reranking and Retrieval Quality, because you still need to measure how good your retrieval is. Most importantly, it is a complement to Hybrid and Semantic Search — you will often combine them. It leads directly to Agentic Retrieval, where the model decides to search multiple times, and to Enterprise Knowledge Assistants, where the knowledge graph is built from internal documents. The library's 'AI Without Mathematics' book positions GraphRAG as what you reach for 'when entity relationships carry the answer', and this page follows that idea exactly.

Signal from the Frontier

Get the next essay on mind, machine, and meaning

Essays at the intersection of AI, philosophy, and Indian governance. No promotional content.

We'll send a one-click sign-in link to confirm. No password needed.

Views expressed are personal and do not represent the Government of India or the Government of Uttarakhand.