Back to glossary

Term

GraphRAG

GraphRAG is a RAG variant that uses a knowledge graph in addition to vector search — answers come from linked entities and relationship paths, not just similar text.

GraphRAG — explained in detail

Classic vector RAG finds passages that are semantically similar to a question. For multi-part questions that span several documents (“Which suppliers of vendor X were also involved in case Y?”), the approach often fails — no single passage contains the full answer. GraphRAG adds a knowledge graph on top: entities (people, products, cases) and their relationships are extracted from the source documents and stored as nodes and edges. When a question comes in, the system traverses the graph and queries the vector index — the answer is built from both.

Example / Practical use

A typical flow following Microsoft and Neo4j implementations: 1) Extraction — an LLM reads the documents, identifies entities and relations, and writes them into a property-graph database (Neo4j, Memgraph, NetworkX). 2) Indexing — embeddings on node level are built in parallel. 3) Retrieval — for a query, multi-hop paths are traversed (“person → worked-at → company → sued → …”) and the resulting contexts plus vector hits are handed to the LLM. The approach shines in compliance research, legal case work, and scientific literature.

GraphRAG complements vector RAG — it does not replace it. Vector search remains faster and cheaper for local lookups. GraphRAG pays off as soon as multi-hop reasoning or cross-document aggregation is required. Drawbacks: building and maintaining the graph is expensive, and answer quality depends directly on the quality of entity extraction. Distinction from hybrid search (BM25 + vector): hybrid combines two search methods, while GraphRAG adds a structured knowledge layer on top.

Entdecke mehr

Themenuebersicht