liveBook · Manning

Evaluation

As explained in Build an AI Agent (From Scratch)

Agent evaluation is the systematic measurement of an agent's behavior and task performance.

Agent evaluation measures more than whether an answer looks right. An agent chooses information sources, tools, action sequences, and a stopping point; a small mistake can therefore lead to costly actions. Because the same request can produce different paths, one successful final answer may reflect luck rather than reliable behavior. Repeatable, automated tests are needed to examine both results and the steps that produced them. section 10.0 section 10.2.1

Evaluate each run from three perspectives:

  • Final output: Does the artifact meet the request, including accuracy and required format? section 10.2.1
  • Components: Did tools and other modules do their jobs, such as retrieving relevant documents or executing code without errors? section 10.2.1
  • Trajectory: Were the reasoning steps and tool calls reasonable and efficient, or did the agent wander and backtrack? section 10.2.1

Start with representative user requests that can be run repeatedly. Keep execution records: without traces, a failed result cannot be reliably traced to a component or decision. Review those traces, log errors, group recurring failures into a taxonomy, and turn frequent or severe failures into a PASS/FAIL-first rubric. Use metrics as a dashboard for detecting regressions, not as a substitute for inspecting behavior. Open-ended tasks require explicit quality criteria before their results can be judged. section 10.2.1 section 10.5 section 10.0

A summarization run

Check whether the summary captures key points without omissions and follows the requested JSON or table format. Then inspect whether search returned relevant documents, whether the LLM interpreted them correctly, and whether unnecessary tool calls or backtracking preceded the answer. section 10.2.1

Run automated evaluation in CI/CD when prompts, tool integrations, or models change. Treat a passing test set as provisional: environments, users, and external APIs change. Review operational data, analyze new errors, and update the taxonomy, rubric, metrics, and test set so the checks continue to reflect real failures. section 10.4 section 10.4.2 section 10.5

Figure 10.4 Agent quality flywheel is a continuous four-step loop for improving agent quality. The process begins by defining quality criteria (1), followed by instrumenting the system to gain visibility into real-world behavior (2). The collected data is used to evaluate the agent’s performance and identify failure patterns (3). Finally, feedback loops are architected to update datasets, rubrics, and metrics (4), feeding insights back to step 1 to refine how quality is defined.

The agent quality flywheel shows how quality criteria, visibility into real behavior, failure analysis, and updates to evaluation checks feed into one another. section 10.4.2

How Build an AI Agent (From Scratch) covers it

How deep it goes
Develops a repeatable process from execution records and error analysis through rubrics, metrics, test-set updates, and CI/CD checks.
Examples
Uses summarization requirements, search relevance, code-execution errors, and unnecessary tool calls to distinguish evaluation targets.
What it assumes
Assumes familiarity with agents that use LLMs and tools, while introducing how to judge their outputs, components, and trajectories.
What you can do after
Practice/perform it by reviewing traces, codifying failures, automating checks, and updating tests as new failures emerge.
How it connects
Links evaluation to observability, tool calls, failure taxonomies, rubrics, metrics, and CI/CD.

Also explained in

Compare how 15 books explain evaluation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build an AI Agent (From Scratch). The section links point to the parts of the book it draws on.