liveBook · Manning

Chapter 10: Evaluating agents

What you will learn in chapter 10 of Build an AI Agent (From Scratch)

This introduction explains why agent autonomy makes rigorous, automated evaluation necessary and why defining success can be difficult.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This introduction explains why agent autonomy makes rigorous, automated evaluation necessary and why defining success can be difficult.

Key terms: autonomy, rigorous evaluation, automated evaluation, intermediate reasoning, tool selection, action decisions, evaluation space, clear ground truth, open-ended tasks, explicit rubric

10.1 Observing an agent

This section explains how collecting signals from an agent’s operation makes its behavior observable, evaluable, and monitorable.

Key terms: observability, evaluation, telemetry, latency metrics, traces, logs, token-use statistics, traditional monitoring, agent observability, nondeterministic behavior

10.1.1 Pillars of observability: Metrics, traces, and logs

This section explains how metrics, traces, and logs provide complementary views of an agent’s behavior.

Key terms: metrics, telemetry, dashboards, alerting systems, trace, span, event, logs, debugging

10.1.2 Generating, collecting, and exporting telemetry: OpenTelemetry

This section explains how OpenTelemetry captures and exports agent telemetry, and how observability platforms use that data for analysis.

Key terms: instrumentation, telemetry data, observability backend, OpenTelemetry (OTel), vendor neutrality, OpenTelemetry Protocol (OTLP), metrics, traces, logs, LLM requests and responses

10.2 Building datasets and establishing evaluation criteria

The section explains how to turn representative agent runs and their failures into evaluation criteria that account for both answers and real-world actions.

Key terms: agent quality, tool calls, consequences of its actions, dataset, representative user requests, execution traces, error analysis, failure taxonomy, frequency, evaluation criteria

10.2.1 What should we evaluate?

The section explains why agent evaluation must examine the final result, the components, and the path taken, using representative requests that can be run repeatedly.

Key terms: nondeterministic, final result, final output, component, trajectory, evaluation dataset, representative user requests

10.2.2 Creating a dataset

Explains where agent-evaluation datasets come from and how to build a test set that covers normal, difficult, and adversarial situations.

Key terms: benchmarks, baseline capability, custom datasets, production data, ground-truth labels, human annotation, representative core use cases, complex and challenging edge cases, adversarial or stress-testing inputs

10.2.3 Analyzing errors

The section shows how to turn agent traces into evidence-based evaluation criteria by noting errors, grouping them into failure categories, and revisiting those categories as the agent changes.

Key terms: dataset, traces, error analysis, evaluation criteria, open coding, full trace, predefined categories, failure taxonomy, rubric items, measurable metrics

10.2.4 Designing rubrics and metrics

This section turns findings from error analysis into explicit pass/fail rubrics and numerical metrics for tracking agent evaluation.

Key terms: rubric, Likert scale, binary decision, PASS, FAIL, answer relevancy, citation reliability, requirement compliance, metric, overall pass rate

10.3 Evaluating with LLM-as-a-judge

This section explains how LLM judges grade agent responses and compares them with code-based evaluation, human review, and end-user feedback.

Key terms: LLM-as-a-judge, evaluation prompt, rubric, judge model, code-based evaluator, strict format validation, execution-based evaluation, constraint checks, human evaluation, hybrid pipeline

10.3.1 Types of LLM-as-a-judge

Introduces two common ways to use an LLM as a judge: grading one agent response against a rubric and comparing two responses to the same input.

Key terms: single-output grading, rubric, expected output, reference answers, pairwise evaluation, relative comparison, A/B testing, A, B, or Tie, win rates

10.3.2 Building a rubric-based evaluation system

This section builds a rubric-based prompt for judging a research agent’s final answer against the user’s request and the evidence the agent saw.

Key terms: query, final_answer, evidence_pack, rubric, reference, citation mismatch, key claim, Answer Relevancy, Citation Reliability, Requirement Compliance

10.4 Operations: CI/CD

This section explains why automated agent evaluation belongs in CI/CD rather than being a one-time development check.

Key terms: automated evaluation, CI/CD, regressions, agent reliability

10.4.1 Evaluation-gated deployment

This section explains how to make quality verification a condition of deploying an agent, using manual review or automated CI/CD gates.

Key terms: quality verification, manual evaluation, automated gates, evaluation harness, CI/CD, premerge integration, CI, PR, small test set, regressed

10.4.2 Improving the test set and evaluator: Agent quality flywheel

This section explains why agent evaluation must keep evolving after deployment and how operational failures feed an agent-quality improvement loop.

Key terms: evaluation, test set, rubric, failure patterns, agent quality flywheel, operational data, error analysis, taxonomy, rubric/metric, evaluation dataset

10.5 Summary

The chapter summary connects observable agent behavior, failure-driven evaluation criteria, and continuous deployment checks into a process for improving agent reliability.

Concepts explained in this chapter

← Chapter 9: Orchestrating multi-agent systems

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.