liveBook · Manning

Chapter 8: RAG application evaluation

What you will learn in chapter 8 of Essential GraphRAG

This chapter introduces a benchmark-based approach to evaluating a RAG agent at tool-selection, retrieval, answer-generation, and end-to-end levels using RAGAS.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This chapter introduces a benchmark-based approach to evaluating a RAG agent at tool-selection, retrieval, answer-generation, and end-to-end levels using RAGAS.

Key terms: benchmark evaluation, benchmark dataset, benchmark questions, agent capabilities, tool selection, retrieval relevance, retrieved context, contextually relevant answers, end-to-end evaluation, vector search

8.1 Designing the benchmark dataset

This section explains how to design a diverse benchmark dataset that tests the decision-making, retrieval, response, and usability capabilities of a RAG agent.

Key terms: benchmark dataset, input queries, RAG pipeline, decision making, response generation, functional coverage, tool selection evaluation, retrieval method, entity and value mapping, multistep retrieval scenarios

8.1.1 Coming up with test examples

This section shows how to build a diverse end-to-end benchmark dataset of questions and ground truths that exercises all of a RAG agent’s capabilities.

Key terms: benchmark dataset, end-to-end test examples, question, ground truth response, Cypher queries, ground truth, static string, graph database, benchmark, greetings

8.2 Evaluation

8.2.1 Context recall

This section defines context recall as a binary, sentence-level check of whether a generated answer is supported by retrieved context, indicating retrieval effectiveness.

Key terms: context recall, retrieval system, retrieved context, relevant information, Context recall evaluation, context, answer, binary classification, Yes (1), No (0)

8.2.2 Faithfulness

This section defines faithfulness as factual grounding in retrieved context and explains how to evaluate it by decomposing an answer into atomic statements and checking each statement against that context.

Key terms: faithfulness, generated response, retrieved context, hallucination, atomic statements, Faithfulness statement breakdown, JSON, Faithfulness evaluation, context, verdict

8.2.3 Answer correctness

This section defines answer correctness as a ground-truth comparison that classifies answer statements to assess accuracy, completeness, and relevance.

Key terms: answer correctness, ground truth, answer statement, TP (true positive), FP (false positive), FN (false negative), factual accuracy, relevance, user's query, factual consistency

8.2.4 Loading the dataset

8.2.5 Running evaluation

This section runs the benchmark evaluation by generating answers and ground truth, recording retrieved context and latency, and scoring results with RAGAS.

Key terms: benchmark dataset, generated answers, ground truth responses, Cypher statements, retrieved contexts, latency, RAGAS framework, non-null values, I don’t know, answer correctness

8.2.6 Observations

This section interprets benchmark results to diagnose RAG weaknesses, identify targeted improvements, and support ongoing evaluation as the system evolves.

Key terms: answer correctness, context recall, faithfulness, retrieved context, retrieval coverage, query reformulation, entity mapping, ambiguous queries, response accuracy, text2cypher

8.3 Next steps

This section positions the reader to build agentic GraphRAG systems by thoughtfully combining retrieval tools, embeddings, and knowledge-graph structure.

Key terms: external tools, data retrieval, transformation, manipulation, goals and constraints, unstructured data, embed text, similarity-based retrieval, entities, relationships

8.4 Summary

This section summarizes how to benchmark a RAG pipeline with diverse tests and separate measures for retrieval, grounding, and answer quality.

Concepts explained in this chapter

← Chapter 7: Microsoft’s GraphRAG implementation

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.