Chapter 12. Evaluating GraphRAG
The code for this chapter is in the
code/ch12folder of the companion repository. Both benchmarks in this chapter are runnable against the Chapter 8 agent. See its README for dependency installation and the environment variables the scripts expect.
Everything up to this point in the book has focused on building GraphRAG systems: constructing the graph, designing retrieval strategies, wiring up agents. This chapter is about the question that determines whether any of it actually works: is it good?
Evaluation is the least glamorous and most consequential part of a GraphRAG project. A pipeline that looks elegant in a slide deck can still hallucinate facts, miss the obvious entity, or regress the moment a new model rolls out. Without a measurement harness, every prompt tweak is a guess, every model upgrade is a roll of the dice.
GraphRAG is harder to evaluate than a plain RAG pipeline for three reasons.
First, it has more moving parts. Extraction, entity resolution, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access