Agent and RAG Evals: Evaluating Retrieval and Multi-Step Agents
Evaluating multi-step agents and retrieval.
AdvancedEvals core3 lessons5 questions
What this module covers
Why RAGRetrieval-augmented generation. Fetching relevant documents and putting them in the model's context before it answers. Read the full explanation needs two evals: did it find the right information, and did it use it correctly
Outcome checks vs trajectory (path) checks for agents
Consistency: why an agent that succeeds once isn't reliable yet
The common agent failure modes, and finding the first step that went wrong
Applied AI PMProduct Manager. Decides what a product should do, for whom, and why. Read the full explanation: most new AI features are RAG or agents; you'll be asked how you'd know they work.
AI Platform PM: developers building on your platform need eval tooling for exactly these patterns.
Forward Deployed EngineerForward Deployed Engineer. An engineer embedded with customers who scopes, builds and ships AI solutions into production. Read the full explanation: customer pilots are usually agents over the customer's data; proving they work is the job.
AI Product Engineer: you'll debug these systems step by step.
A RAG system does two things: it retrieves documents, then generates an answer from them. A wrong answer can come from either step, and the fix is different, so evaluate them separately.
Step
Question
Typical checks
Retrieval
Did it fetch the documents that contain the answer?
Recall@k: was the right document in the top k results?
Generation
Did the answer use those documents correctly?
Groundedness: is every claim supported by the retrieved text? Relevance: does it answer the question asked?
Reading the two together tells you where to fix:
Right document retrieved, wrong answer → a generation problem (prompt, model, or too much context).
Right document not retrieved → a retrieval problem (chunking, embeddings, search, or the document doesn't exist).
Answer not grounded in anything retrieved → the model is making things up. This is the dangerous case.
You need labelled examples saying which document answers each question; building that set is often the main work.
Evaluating agents: outcome, path and consistency
An agent takes several steps: it calls tools, reads results and decides what to do next. Evaluate it three ways:
Outcome: did it reach the right end state? Check the result directly: was the booking made, for the right date, at the right price? Outcome checks are usually code checks against the final state.
Path (trajectory): did it get there sensibly? Did it call the right tools with the right arguments, avoid forbidden actions, and not take 30 steps for a 3-step task? Path checks catch agents that succeed by luck or break a policy on the way.
Consistency: does it succeed every time? Run each task several times. An agent that succeeds 80% of the time on one try succeeds on all of five tries much less often. Benchmarks such as τ-bench report this as pass^k: the chance that all k attempts succeed. Users experience the failures, not the average.
Agents also need simulated users for evals: a scripted or LLM-played user that answers the agent's questions, so multi-turn tasks can be tested repeatably.
Where agents fail
When an agent fails, find the first step that went wrong. Later errors usually follow from it. The common failure modes:
Wrong tool, or wrong arguments: books the wrong date, searches with a typo.
Ignores a tool error: the API returned an error and the agent carried on as if it worked.
Gives up or stops early: says it's done before the task is complete.
Loops: repeats the same call without progress.
Breaks a policy: refunds without verifying identity; acts outside its permissions.
Misreads the user: solves a different problem from the one asked.
Count these across failed runs (error analysis, applied to traces). The counts tell you whether to fix tool descriptions, prompts, guardrails or the tools themselves.