Book a 30-min callBook a call

GraphRAG and knowledge graphs for retrieval: when vector search is not enough

How GraphRAG works: LLM-built knowledge graphs, entity resolution, Leiden communities, local and global search, LightRAG, graph storage and evaluation.

A stack of document boxes with an arrow into a network of small circles joined by lines, the circles grouped by three dashed outlines, each outline with an arrow to a short summary box.
Written by
BYD Tech
Published
Topic
Deep dives
Reading time
19 min read

Questions people ask

Is GraphRAG better than vector RAG?

For some questions. Edge et al. report large win rates over vector RAG on global sensemaking questions, such as themes across a corpus, and a graph helps multi-hop questions that need facts linked through an entity. For questions answered by one passage, vector or hybrid RAG is simpler, cheaper to index and usually just as good. Label a sample of real questions by type before deciding.

Do I need a graph database for GraphRAG?

No. A retrieval graph fits in two relational tables, entities and edges, and a one-to-three-hop traversal is a recursive CTE or a couple of joins in PostgreSQL. A graph database helps when traversals are deep or path-heavy, when you run graph algorithms often, or when people explore the graph directly.

What is the difference between local and global search in GraphRAG?

Local search starts from the entities most similar to the question and collects their neighborhood: related entities, relations, claims, community reports and source chunks. Global search ignores entry points and runs a map-reduce over community reports at a chosen level, scoring partial answers and combining the best ones. Local suits questions about specific things; global suits questions about the whole corpus.

How much work does GraphRAG indexing take?

Far more than embedding. Every chunk gets at least one LLM extraction call, often more with gleaning rounds, then entities and relations get summarization calls and every community at every level gets a report. Lighter variants reduce this with NLP-based extraction, no community hierarchy, or incremental updates as in LightRAG.

Why does my knowledge graph give wrong multi-hop answers?

Usually because of extraction or entity resolution. A missed relation leaves no path to follow, an unmerged alias splits one entity into disconnected nodes, and a wrong merge joins two different things. Check the path retrieval took for failing questions, and audit a sample of relations and merges against the source text.

Building something like this?