liveBook · Manning

Evaluation

As explained in AI Agents in Action, Second Edition

Evaluation is the systematic assessment of an agent's output or behavior against defined criteria or expected results.

An agent can give the right answer for the wrong reasons: it might make unnecessary tool calls, ignore retrieved evidence, or fail unpredictably on the next run. Evaluation checks an agent’s answers and behavior against defined criteria so failures become visible and improvements can be tested. It helps measure robustness; it cannot repair a poorly designed agent by itself. section 7.0 section 7.2

A practical evaluation loop starts small:

  • Set goals and benchmarks. For each input, record an expected response and a known-bad response. section 7.2
  • Check more than the final answer. Inspect tool choices, grounding in retrieved context, steps taken, latency, cost, and failure behavior. Use a rubric when criteria such as factual accuracy, tone, and structure need judgment rather than exact matching. section 7.2
  • Run tests repeatedly. Agent outputs vary, so one failure or success may be a one-off; run passing benchmarks at least three times to gain reasonable confidence. section 7.2.2
  • Make the smallest useful change to the prompt or tools, then test again. Keep the benchmark set so later changes can be checked against it. section 7.2 section 11.1.5

Start with an answer check

Suppose a small knowledge base says that a fictional engine spins antimatter rings. A benchmark asks what it spins, expects “antimatter,” and marks “fusion” as a known-bad answer. The first evaluator can simply check whether the response contains the expected word. That is a useful starting test, not a complete evaluation: it does not reveal whether the agent retrieved the right fact or took an inefficient route to its answer. section 7.2.2 section 7.2

As an agent moves toward deployment, automate checks on prompt or model changes and retain traces of prompts, tool calls, latency, and outcomes. Human feedback and LLM-as-judge checks add perspectives that simple matching misses. For releases, place offline tests before shadow traffic, a small canary, and full rollout; record model and tool versions so a failed run can be investigated. section 11.1.5 section 8.3.5

How AI Agents in Action, Second Edition covers it

How deep it goes
Details benchmark design, repeated runs, holistic checks, and iteration; begins with string matching before broader rubric-based assessment.
Examples
Uses a RAG benchmark with expected and known-bad answers, followed by a string-matching check.
What it assumes
Assumes an agent with prompts and tools to test; starts evaluation with simple expected-answer matching.
What you can do after
Practice/perform repeated benchmark checks, inspect intermediate behavior, and use failures to make minimal agent changes.
How it connects
Connects test-driven agent development with retrieval grounding, tool use, tracing, human feedback, guardrails, and release engineering.

Also explained in

Compare how 15 books explain evaluation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI Agents in Action, Second Edition. The section links point to the parts of the book it draws on.