RAG Handbook retrieval-augmented generation Bipin Singh
Advanced RAG

GraphRAG

2 min readChapter 15 of 26By Bipin Singh

Standard RAG retrieves isolated passages. It struggles with questions that require connecting facts scattered across many documents, or with "big picture" questions about a whole corpus. GraphRAG addresses this by building a knowledge graph of entities and relationships and retrieving over that structure.

The core idea

During indexing, use an LLM to extract entities (people, products, concepts) and the relationships between them from your documents, assembling a graph. At query time you can traverse relationships — following connections between facts — rather than only matching isolated text.

When it helps

Local vs global search

The trade-off

GraphRAG is powerful but expensive to build: extracting entities and relationships across a corpus means many LLM calls at index time, and maintaining the graph as content changes adds complexity. Use it when your questions are genuinely about connections and themes; for straightforward "find the passage that answers this," standard RAG is simpler and cheaper.

Tip
You don't have to choose one or the other. Hybrid systems run vector retrieval and graph retrieval together, using the graph for relationship-heavy questions and vectors for direct lookups.
Bipin Singh
Written by Bipin Singh

Senior Full-Stack Engineer · AI & AWS. I build production RAG and LLM systems for enterprises.

Work with me