Skip to main content

What metrics should I use to measure output quality for AI agents completing tasks?

Summary

  • The four core dimensions of agent quality are: is the response correct, grounded, safe, and complete? These frame every evaluation decision. Correctness means the answer is accurate; grounded means claims cite facts or data; safe means the response respects constraints and permissions; complete means it fully addresses the user's request.
  • Use a combination of LLM judges (automated scorers) and code-based checks to measure these dimensions. LLM judges assess subjective qualities like correctness and completeness; code-based checks verify objective facts (does the response include required fields, is the output format valid, etc.).
  • Databricks Agent Evaluation provides pre-built scorers and the ability to define custom ones. Pre-built scorers include Correctness, Completeness, and Fluency. You can create custom scorers to measure domain-specific qualities or business outcomes. Register scorers for reuse across teams and evaluation runs.
  • Score traces from development, staging, and production. Use Agent Evaluation in the UI to manually score samples, or use mlflow.genai.evaluate() programmatically to evaluate entire datasets. Set up production monitoring to continuously apply scorers to live traffic samples.
  • Establish a feedback loop with human raters. Built-in review apps let you collect feedback from stakeholders and subject matter experts. Use that feedback to tune agent behavior and improve scorer quality over time.

What metrics should I use to measure output quality for AI agents completing tasks?

Agent quality is multi-dimensional. A response can be factually correct but unsafe (violating permissions), or grounded but incomplete. The four core dimensions are: correctness (the answer is accurate), grounded (claims cite facts or data), safe (the response respects constraints and permissions), and complete (it fully addresses the request). These four frame every evaluation decision. Measure them using a combination of LLM judges and code-based checks, then close the loop with human feedback.

Core quality dimensions for agent outputs

Dimension What to Measure Example
Correctness Does the response provide accurate information? Agent reports inaccurate financial metrics: incorrect.
Grounded Are claims backed by data or facts, not hallucinated? Agent cites "last quarter's earnings" with a specific source: grounded.
Safe Does the response respect data permissions and constraints? Agent reveals data a user isn't authorized to see: unsafe.
Complete Does the response fully address the user's request? User asks for 2024 and 2025 data; agent provides only 2025: incomplete.

How to measure each dimension

Correctness and Completeness: use LLM judges first. An LLM judge (an automated scorer powered by an LLM) can read the user's request, the agent's response, and ground truth (if available), then assess whether the response is correct and complete. This works well for subjective judgments like "did the agent address all aspects of the question?" and "is the tone appropriate?"
Grounding: combine LLM judges with citation checks. LLM judges can detect unsourced claims. But add a code-based check: does the response include citations or links to data sources? Does it match facts from your knowledge base? If ground truth exists, verify the response against it.
Safety: use code-based checks primarily. Code-based checks are best for safety: does the response include fields that should be redacted? Does it reference data the user doesn't have permission to access? Did the agent violate any business rules or policy guardrails? These checks are deterministic and precise.
Fluency: use LLM judges. LLM judges assess readability, tone, and clarity. A response can be correct but confusing. Ask the judge to evaluate whether a reader would understand the answer.

Databricks Agent Evaluation framework

Use pre-built scorers or create custom ones. Databricks Agent Evaluation provides pre-built LLM-as-a-judge scorers including Correctness, Completeness, and Fluency. You can also create custom scorers to measure domain-specific qualities (e.g., "did the agent recommend the right product?") or business outcomes (e.g., "did the response lead to a conversion?"). Register scorers for reuse across teams.
Evaluate traces in the UI or programmatically. In the AI Playground or through the UI, manually select traces and run scorers with no coding required. Or use mlflow.genai.evaluate() to score entire datasets systematically, compare different agent versions, and identify which changes improve quality.
Set up production monitoring for continuous evaluation. Beyond development, set up production monitoring to automatically apply scorers to live traffic samples. This lets you catch quality regressions in real time and see how agents perform on real user requests.
Collect human feedback to close the loop. Use built-in review apps to collect feedback from stakeholders and subject matter experts on samples. Use this feedback to refine agent prompts, tool definitions, and scorer definitions over time.

Putting it together: an evaluation workflow

  1. Define success criteria: Which of the four dimensions matter most for your use case? (E.g., for customer support, safety and completeness matter most.)
  2. Select or build scorers: Use pre-built scorers or create custom ones for your criteria.
  3. Score a sample: Evaluate 50-100 representative traces using your scorers, either in the UI or programmatically.
  4. Analyze results: Identify patterns (e.g., "agent always scores low on grounding when using source X").
  5. Iterate: Improve the agent (refine prompts, add tools, add guardrails), re-score, and verify improvements.
  6. Monitor production: Deploy scorers to production traffic so you catch regressions early.

FAQs

What's the difference between correctness and completeness?

Correctness means the information provided is accurate. Completeness means the response fully addresses what the user asked for. A response can be correct but incomplete (answers part of the question) or complete but incorrect (answers everything but with wrong data).

What is an LLM judge?

An LLM judge is an automated scorer that uses a language model to assess response quality. It reads the request, response, and ground truth (if available), then scores dimensions like correctness, completeness, and tone. It's useful for subjective assessments that are hard to measure with code.

Can I use code-based checks for all metrics?

No. Code-based checks work well for objective, deterministic metrics like safety (did the response violate permissions?) and format validation (does the response include all required fields?). Subjective metrics like correctness and completeness require human judgment or LLM judges.

How do I prevent an agent from hallucinating during evaluation?

Evaluate grounding explicitly: check whether responses cite data sources and whether those sources are correct. Use code-based checks to verify claims against your knowledge base. Deploy guardrails that force the agent to cite sources or admit uncertainty.

The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.