匠人学院 JR Academy
Skip to article
Engineering handbook
AI Agent Engineering Handbook

Start with tool calls. Understand how an agent acts, reads observations and stops when something fails. Verify each boundary with complete code and offline tests.

5 chapters·16 guides·Open access
Evaluation and Testing
On this page

Evaluating Agent Outcomes

Unit tests can verify a parser or permission check, but an agent also needs outcome evaluation: did it complete the task, use valid evidence and respect constraints?

#Build a regression set

Include ordinary requests, missing evidence, conflicting sources, malformed tool input, unavailable services and permission denial. Store input, expected behavior, allowed evidence and an evaluation rubric. Keep a held-out set so prompt edits do not simply memorize the examples.

Separate four layers: final output, action sequence, retrieval and business result. A polite answer can hide a failed action. A correct tool call can still produce an unusable final document.

#Use deterministic checks first

Validate schemas, required fields, source IDs and permissions with ordinary code. For a policy assistant, check that an absent rule produces an unresolved result rather than a fabricated number.

An illustrative rubric:

CriterionPass condition
SupportEvery factual policy claim maps to an authorized passage
Missing informationUnknowns remain explicit
Action integrityNo write occurs without the required authorization
ResultThe complete requested artifact can be opened

#Model judges are fallible

LLM-as-a-judge can help review relevance or support at scale, and RAGAS-style metrics can organize retrieval evaluation. Neither replaces calibration against human labels. Judges can prefer fluent but wrong answers, inherit prompt injection from examples or disagree across runs.

Record judge model, rubric and prompt version. Inspect disagreements and report uncertainty. Judge calls can incur additional cost and need the same data handling and authorization controls as generation.

#Make changes comparable

Run baseline and candidate against the same dataset and environment. Report case counts and failures alongside averages, latency and usage. Do not publish invented scores or copy a sample metric as if it were a measured result. Keep representative failing cases so the next change addresses a concrete defect.

System Design

Core system design concepts and practical case studies

Learn the trade-offs and patterns that matter in technical interviews.

Open System Design →

FAQ

Which language should I use?
Python and TypeScript both work. Start with the language you can debug; the first exercise uses Python 3.10+ and its standard library.
Does MCP require a specific model?
No. MCP connects applications to tools and context services. Compatibility depends on the host client, transport, protocol version and authorisation; model tool-calling support is a separate check.
Does learning agents guarantee employment?
No. Use a small project to demonstrate requirements analysis, permissions, testing and maintenance. Employment outcomes depend on the role market and your actual skills.

Done reading? Next steps