tools for agent evals
Summary
- Agent evals need tools that grade the path an agent took, not just its final answer: which tools it called, with what arguments, how many steps it needed, and whether it kept context across turns.
- The core toolkit is a trace-aware evaluation harness, scorers that read traces (tool-call judges, custom trace-based judges, code checks on spans), multi-turn judges for conversations, and human review to keep judges honest.
- MLflow's open-source GenAI evaluation covers this with
mlflow.genai.evaluate(), tool-call judgesToolCallCorrectnessandToolCallEfficiency(marked experimental in the MLflow docs), andmake_judge()judges that can read a full{{ trace }}. - On Databricks, the same scorers run against Unity Catalog evaluation datasets, domain experts label traces in the Review App, and production monitoring (Beta) runs scorers on a sample of live traces.
tools for agent evals
The tools you need for agent evals are a harness that replays a fixed set of tasks against each agent version, scorers that inspect the agent's trace, and a way to bring human judgment into the loop. An agent can reach a correct answer through a wasteful or risky path, and output-only checks will never notice. MLflow's open-source GenAI evaluation is built around traces for exactly this reason: every scorer can see the steps, not only the result.
Why agent evaluation is different
An LLM app answers a prompt. An agent plans, calls tools, reads results and decides what to do next, often over several turns. MLflow's docs put it this way: agents "can use tools, make decisions, and execute multi-step workflows", which makes evaluating them "challenging". Failures hide in the middle: the wrong tool, a malformed argument, a redundant call, or a fact the agent forgot from an earlier turn. To catch them, test cases need expectations for both outputs and agent behaviors such as tool usage, and scorers need the trace.
What to evaluate in an agent, and how
| What to evaluate | How to evaluate it | MLflow scorer |
|---|---|---|
| Final answer | Judge against expected facts or a reference answer | Correctness |
| Grounding | Check the response against retrieved context | RetrievalGroundedness |
| Tool choice and arguments | Check tool calls against the request, or against expected tool calls | ToolCallCorrectness (experimental) |
| Wasted steps | Look for redundant tool calls | ToolCallEfficiency (experimental) |
| Custom trajectory rules | An LLM judge reads the whole trace | make_judge() with {{ trace }} |
| Deterministic checks | Code that counts or inspects spans | @scorer |
| Conversations | Session-level judges over all turns | ConversationCompleteness, UserFrustration, KnowledgeRetention (experimental) |
Running an agent eval with MLflow
Built-in tool-call judges and your own trace-reading scorers go in the same call:
import mlflow
from mlflow.entities import SpanType, Trace
from mlflow.genai.scorers import ToolCallCorrectness, ToolCallEfficiency, scorer
@scorer
def llm_calls(trace: Trace) -> int:
return len(trace.search_spans(span_type=SpanType.CHAT_MODEL))
results = mlflow.genai.evaluate(
data=eval_dataset, # inputs, plus expectations where you have them
predict_fn=predict_fn, # wraps your agent
scorers=[ToolCallCorrectness(), ToolCallEfficiency(), llm_calls],
)
Open a failing row in the MLflow UI and the trace shows the exact sequence of tool calls, so you can see whether the fix belongs in the system prompt, a tool description or the agent's logic. For checks no built-in judge covers, make_judge() creates a judge from your own instructions. Trace-based judges explore the trace with Model Context Protocol (MCP) tools and can validate tool usage patterns, find performance bottlenecks and verify multi-step workflows. They require you to set the model argument.
For conversational agents, MLflow's ConversationSimulator generates synthetic multi-turn conversations from scenarios you define, so you can replay the same conversations against each version. The docs label conversation simulation and multi-turn evaluation as experimental.
How Databricks approaches agent evals
MLflow on Databricks runs the same evaluation APIs, with managed pieces around them:
- Datasets from real traffic. Evaluation datasets are stored as Unity Catalog tables. Search traces with
mlflow.search_traces()and add them withmerge_records(), so test cases reflect what users actually asked. - Hosted judges. Built-in judges use a Databricks-hosted LLM by default. Trace-based judges can use Foundation Model APIs or external model serving endpoints.
- Human review. Subject-matter experts label traces in the Review App. For new review workflows, Databricks recommends review queues (Beta), which route traces to reviewers one item at a time.
- Judge alignment. A judge's
align()method uses expert feedback to produce a judge that agrees more closely with your reviewers. It works for built-in and custom judges, but not for multi-turn judges. - Production monitoring (Beta). Register a scorer, start it with a sampling configuration, and the monitoring service scores a sample of incoming traces in the background. The same scorers serve development and production.
See Evaluate and improve, Built-in LLM judges and MLflow's guide to evaluating agents.
FAQs
Can I evaluate an agent built with LangGraph or another framework?
Yes. mlflow.genai.evaluate() calls a predict_fn that wraps your agent, and autologging captures framework calls such as LangGraph tool calls as spans the scorers can read.
Do tool-call judges need ground truth?
Not by default. The MLflow API reference says ToolCallCorrectness runs ground-truth free when no expectations are provided, using an LLM to judge whether the tool calls are reasonable for the request. Add expected_tool_calls to a test case's expectations and it compares actual calls against them, with LLM-based fuzzy matching by default or exact matching when should_exact_match=True.
How do I evaluate multi-turn conversations?
Use session-level judges such as ConversationCompleteness. Your traces need session IDs, and MLflow marks multi-turn evaluation as experimental.
Can domain experts review agent outputs without writing code?
Yes. On Databricks, experts label traces in the Review App, and their feedback can be used to align LLM judges with your quality bar.
The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.