Lesson 11.03 · Phase 11 · Evaluation & Observability
Trajectory evaluation
The final answer tells you what the agent said. The trajectory tells you what it did: which tools it called, with which arguments, in what order. Comparing trajectories to a reference by tool names alone misses the dangerous cases. A $790 refund on a $79 order has a "perfect" name sequence. Grade trajectories with specs instead: required calls, forbidden calls, ordering rules that matter, step budgets, and loop detection.
Learning objectives
- Implement reference-based trajectory metrics: exact match, in-order, any-order, tool precision and recall, edit distance.
- Implement spec-based checks with argument-aware matchers: required, forbidden, "A before B", budget, repeats.
- Show where each metric gives false passes and false failures, on five realistic trajectories.
- Write a trajectory spec for a task in your own agent.
Your refund agent's final answers all look fine: "Done, I've refunded your order." The answer-only eval says 100%. Then you read trajectories. One run refunded before looking up the order. Another refunded ten times the order total. A third called lookuporder four times in a row because it didn't handle a timeout. All three told the customer the same polite thing.
Loading the full lesson…