Introduction to Evaluating RAG Systems and Agents
Evaluating RAG applications from multiple perspectives, testing retrieval quality with relevance scoring, context matching and latency measurements, and measuring agent task completion, tool use and reasoning quality.
- 3 lessons
- Module quiz
RAG systems and agents have several stages, and a wrong final answer can originate in any of them. In a RAG system, the retriever may fail to find the relevant passage, or it may find it and the model may still answer incorrectly. In an agent, the final answer may look right while the agent took unnecessary or unsafe steps to reach it. Evaluating only the final text hides these differences, so each stage is evaluated separately.
For RAG, retrieval is measured with a test set of queries and their relevant passages, using metrics such as recall at k, the share of relevant passages found in the top k results, and mean reciprocal rank (MRR), which rewards ranking the first relevant passage highly. Generation is measured for faithfulness, correctness and citation quality. For agents, evaluation covers task completion, tool usage, efficiency in steps, tokens and cost, and the quality of reasoning.
What the exam expects
Questions test diagnosing which stage is failing from metric patterns, for example low coverage with high faithfulness, which indicates that retrieval rather than generation is the problem, and evaluating agents on both their outcomes and their trajectories.
How this module is organised
Evaluating RAG Retrieval and Generation Separately explains retrieval and generation metrics, automated assessment and human feedback. Testing Retrieval Quality with Labeled Queries explains how retrieval test sets are built and used. Evaluating Agent Task Completion, Tool Use and Efficiency explains how task completion, tool use, efficiency and reasoning are measured.