Building an AI agent is easy. Measuring it honestly is where the real engineering happens. A recent post from an intern at Valentius Kryptix, Abhi18, details a LangChain agent named CloudML Study Analyst that achieved a 10/12 pass rate on a custom test suite. The two failures weren't just bugs in the model; one was a violation of the output contract, and the other was a bug in the evaluation code itself.

The Agent Architecture

CloudML Study Analyst is designed to answer questions from ML course notes using a ChromaDB vector store. It features three tools, a custom persona, and comprehensive step logging. The agent retrieves context, calls a safe calculator for math tasks, and returns structured summaries with page citations. For example, given the prompt 'explain server virtualization, then calculate the cost of 25 servers at $120 a month for a year', the agent is expected to chain these operations correctly.

Anatomy of the Failures

The test suite consisted of 12 cases covering multi-step tasks, missing data, out-of-scope queries, and error handling. Passes required strict adherence to expected tools, tool order, output format, computed values, and citation pages. The first failure occurred when the agent was asked 'What is the capital of France?'. The model decided no tool was needed and replied in plain text, breaking the structured output contract. The second failure was a false negative: the agent correctly handled the invalid expression '5 +* 3' by returning 'N/A (Invalid syntax)', but the test checker failed it because it was strictly looking for the word 'error'.

Lessons for Agent Builders

Abhi18 argues that evaluation harnesses are code and therefore susceptible to bugs. Reading the execution trace for each failure was critical to determining whether the agent or the test was at fault. The author recommends evaluating with expected outcomes rather than 'vibes', logging every tool call with its reasoning, and adding guardrails like loop limits and input validation. A documented 10/12 pass rate is more credible than an unmeasured claim that 'it works'.

Key Takeaways

  • Evaluation harnesses are code and can contain bugs; always verify failures by reading execution traces.
  • Agents may bypass structured output contracts if they judge no tool is needed, requiring strict enforcement.
  • Logging every tool call with its reasoning turns ambiguous agent behavior into fixable bugs.
  • Publishing a documented pass rate (e.g., 10/12) is more credible than unmeasured claims of success.

The Bottom Line

Stop trusting green checkmarks in isolation. If your eval harness doesn't account for its own potential bugs, you are measuring the tool, not the agent.