I recently built a LangChain agent as part of my internship at Valentius Kryptix. Building it was the easy part. Measuring it honestly was where I learned something.

The agent

CloudML Study Analyst answers questions about my ML course notes. Given a task like "explain server virtualization, then calculate the cost of 25 servers at $120 a month for a year", it retrieves from a ChromaDB store, calls a safe calculator, and returns a structured summary with page citations. It has three tools, a custom persona, and logs every step so I can see which tool it called and why.

The test set

I wrote 12 test cases covering multi-step tasks, missing data, out-of-scope questions, and error handling. Each case has expected tools and values, and it only passes if every check passes: tools used, tool order, output format, computed value, citation pages and more.

The result was 10/12 (83.3%). The two failures were very different kinds of failure.

Failure 1: the agent broke the rules

Asked "What is the capital of France?", the agent replied in plain text. It decided no tool was needed, so it never called the summary tool and my structured output format collapsed. This was a real agent failure: the model followed its own judgment over my output contract.

Failure 2: my test was wrong

Given the invalid expression 5 +* 3, the agent handled it correctly and wrote "N/A (Invalid syntax)". My checker was looking for the word "error" and failed it. The agent was right and my evaluation was too strict.

This is the lesson I would not have learned from manual testing. An eval harness is code too, and it has bugs. Reading the trace for each failure told me which side was at fault.

What I would tell another beginner

  • Evaluate with expected outcomes, not vibes. Even 12 cases exposed problems I had missed.
  • Log every tool call with its reason. Traces turn "the agent did something weird" into a fixable bug.
  • Add guardrails. Loop limits, input validation and a rule to report missing data instead of inventing it. My agent correctly said the notes had no price per GB instead of making one up.
  • Publish your failures. A documented 10/12 is more credible than an unmeasured "it works."

Try it

The agent is live on Render (free tier, so the first request may take about a minute to wake up): https://agentic-ai-workflow-ek5k.onrender.com/

The code is on GitHub: https://github.com/KRISH18833/agentic-ai-workflow

Read the full article with the architecture, tracing details and deployment notes: https://valentiuskryptix.com/how-to-build-an-agentic-ai-workflow-from-seems-fine-to-a-measured-83-3-pass-rate/

CloudML Study Analyst live demo showing the answer and agent trace