productinterview.tools
MenuClose

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
Agent and RAG evals

Unlocks

None

Why it matters, by role

  • 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.

Lessons

  1. Evaluating RAG: retrieval and answer separately
  2. Evaluating agents: outcome, path and consistency
  3. Where agents fail

Evaluating RAG: retrieval and answer separately

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:

  1. 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.
  2. 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.
  3. 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.

Questions

Core

QuestionTypeRolesAsked atSource
A partner changed their API's response format and your agent started failing silently for a day. How do you catch this next time?diagnoseForward Deployed Engineer, AI Product Engineer–Representative
Your RAG assistant must only state things supported by retrieved documents. How do you measure that?metricsModel PM, AI Product Engineer, AI Safety PM–Representative

Advanced

QuestionTypeRolesAsked atSource
Your coding agent takes a GitHub issue and opens a pull request. How do you evaluate it?designAI Product Engineer, Model PM, AI Platform PM–Representative
You built a support agent for a customer. It handles refunds and order changes, and it worked well in the demo. The customer asks: how do we know it's ready for production?customer-scenarioForward Deployed Engineer, Applied AI PM, AI Product Engineer–Representative
Your travel-booking agent asks users follow-up questions. How do you evaluate it repeatably when every conversation goes differently?designAI Product Engineer, Model PM, Forward Deployed Engineer–Representative

Rubric

Dimension Weak Passable Strong
RAG One end-to-end score Mentions retrieval and answer quality Separate retrieval and groundedness checks, and reads them together to locate the fault
Agents Checks only the final answer Outcome and some path checks Outcome, path and consistency (pass^k), with simulated users
Diagnosis "The agent is bad" Lists failures Finds the first failing step and counts failure modes
Practicality Ignores how to get labels Mentions labelled data Plans how to build the labelled set and the test harness

Next modules