Generative AI

GraphRAG (Knowledge Graph RAG)

GraphRAG is a retrieval-augmented generation approach that stores entities and their relationships in a knowledge graph so that a language model can answer questions requiring connections across many documents.

What is GraphRAG (knowledge graph RAG)?

GraphRAG is a variant of retrieval-augmented generation that organizes source material as a knowledge graph of entities and relationships, then retrieves from that graph as well as from text chunks. Standard RAG finds passages that resemble the question. GraphRAG can also follow links: from a supplier to the parts it makes, from those parts to the assemblies that use them, and from the assemblies to the customers who bought them. Questions that span many documents, or that ask about a whole collection rather than one passage, are where it earns its extra cost.

How GraphRAG works

During ingestion a language model, or a named entity recognition pipeline, reads each document and extracts entities (people, companies, parts, contracts, locations) and the relationships between them, such as supplies, owns, references, or replaces. The results are stored in a graph database, with each node linked back to the passages that mention it. Many implementations also cluster the graph into communities and write a summary of each one, so that a broad question such as the main causes of warranty claims in a product line can be answered from the summaries rather than from thousands of individual tickets.

At query time the system identifies the entities in the question, pulls their neighborhood from the graph, adds the linked passages and any relevant community summaries, and passes the whole package to the model. The answer cites both the relationships and the passages.

GraphRAG in practice

An industrial equipment manufacturer receives a recall notice for a bearing from a second-tier supplier. The question is which finished products, serial number ranges, and customers are affected. The answer lives in purchase orders, bills of materials, engineering change notes, and shipping records that no single document connects. A GraphRAG system that has extracted part, assembly, order, and customer relationships traverses the chain in one query and produces a list with the supporting documents, a task that previously took an engineer and a buyer most of a week.

What to watch for

  • Entity extraction is itself a generative step and makes mistakes, so audit a sample of extracted relationships before relying on them.
  • Building and refreshing the graph costs many model calls per document, which matters at the scale of millions of records.
  • Agree on an ontology for entity and relationship types before extraction, or the graph fills with near-duplicate concepts that defeat traversal.
  • Most question types are answered well by standard RAG, so reserve GraphRAG for multi-hop and whole-corpus questions you have identified.

← Back to AI Glossary