A junior AI engineer shares a hard-learned lesson from shipping an AI support-routing agent that broke within three days of production. The post explains the critical gap between observability (seeing what an agent did) and evaluation (proving it did the right thing), backed by LangChain survey data showing only 52% of teams have offline evals. Three common failure modes are covered: confident hallucinations, wrong tool selection with correct-looking output, and prompt drift across versions. A practical ~50-line Python eval pattern is provided using hard checks for ground truth cases and LLM-as-judge for subjective quality. The post also covers LLM-as-judge pitfalls (position bias, verbosity bias, rubric drift) and recommends calibrating judges against 20–30 human-labeled examples. Frameworks like Langfuse, DeepEval, LangSmith, and MLflow are briefly compared.

16m read timeFrom levelup.gitconnected.com
Post cover image
Table of contents
The thing that happened to me last quarterWhat’s an agent eval, and why is it not just a unit test?The math that finally made me take this seriouslyThe three failure modes I hit (and you will too)Your first eval: a roughly fifty-line patternGet Mohamed Jihed Riahi ’s stories in your inboxThe LLM-as-judge trapThe honest counterargumentsThe cheap insurance policyReferences
8.2K Impressions2 Comments