Agent Evaluation Lab on Databricks MLflow
A high eval mean is not evidence that your evaluation suite works; a caught failure is. I built an evaluation lab on Databricks MLflow that turns LangGraph execution into queryable traces, pairs managed LLM judges with deterministic scorers, plants known-bad controls to prove the scorers actually catch failures, and asserts tool-call behavior straight from trace spans.
Most evaluation setups celebrate the first time every bar turns green. That usually just tells you the suite is polite, not that it works ;) I built this lab on Databricks MLflow to test the full loop — trace, inspect, measure, evaluate, and prove the scorers actually fail when the agent misbehaves — running entirely on Databricks-hosted models (ChatDatabricks) with no external LLM API key and no separate observability vendor.
Making execution queryable first
The lab runs a LangGraph agent with MLflow autologging capturing model and tool spans, nested cleanly inside manual @mlflow.trace spans that mark the application boundary plus pre- and post-processing. Multi-turn conversations log separate traces grouped under a shared session_id, so each turn keeps clean inputs and outputs while recall turns (where the agent answers from conversation history without calling a tool) stay traceable inside the same thread.
Failure signatures are tested deliberately too:
- Unhandled exceptions mark the root trace
ERRORwith exception type, message, and stack trace. - Handled errors mark only the failing child span
ERRORwhile leaving the parent traceOK, so operators can tell a recovered fault from a broken request. - Segmented metrics: latency, tokens, and cost are queried directly from persisted
TraceInfometadata, segmented by scenario and status so answerless error traces withnullusage don’t skew averages.
Proving the scorers with planted known-bad controls
Evaluation runs over persisted traces with no agent re-run, combining two managed Databricks LLM judges (relevance_to_query and a scoped self_consistent rubric) with three deterministic scorers (expected city named, ground-truth fact stated, and response length).
Running a pilot caught a real false negative right away — "New York City" failed an exact check expecting "NYC" until I added an alias map. Then I appended six planted known-bad controls alongside clean traces: wrong city, off-topic, over-length, refusal, right city with wrong fact, and right fact with self-contradiction (“cloudy, but sunny and 95F”).
Those last two are the whole reason to layer scorers instead of trusting one number:
- Right city, wrong fact sails past relevance, city, and length checks — only the deterministic ground-truth fact check catches it.
- Right fact, self-contradictory slips past even the fact check because the expected word is present — only the scoped consistency judge catches it, and that judge needs no expected facts.
Scoring what the agent did, not just what it said
Answer quality doesn’t tell you whether the agent behaved properly along the way. To test tool-call behavior directly, I ran five scripted cases through the real LangGraph loop against the exact same request and advertised tools: one happy call, no call, wrong tool, wrong argument, and three identical repeated calls.
First, I fetched every trace back and asserted the tool spans deterministically — tool name, arguments, call count, and span status — with zero LLM judge calls. Then I ran three judge configurations twice over those same persisted traces (no predict_fn): exact-match correctness, unaided correctness, and efficiency. One finding stood out immediately: efficiency scores “yes” on a no-call trace where correctness says “no” — doing nothing is cheap and still wrong.
Honest limits
Short answers and unambiguous tool traces prove the evaluation pipeline works, not that an agent is production-ready. LLM judges cost a model call per record, stay non-deterministic at the margin, and only read one answer at a time — contradictions split across turns can still slip past. The point of the lab is the discipline: prove your trace is answerable, settle everything deterministic checks can settle, and verify your judges against known-bad controls before trusting a green dashboard. It follows the same evaluation philosophy I wrote about in When the humans hallucinate and built into my Salesforce evals and observability tooling.