Use agent metrics & LLM judges to evaluate app performance
Preview
This feature is in Public Preview.
This article describes the agent metrics and large language model (LLM) judge evaluations computed by Agent Evaluation evaluation runs. Learn how to use evaluation results to determine the quality of your agentic application.
Databricks is dedicated to enhancing the quality of judges by measuring their agreement with human raters. Databricks uses diverse, challenging examples from academic and proprietary datasets to benchmark and improve judges against state-of-the-art LLM-judge approaches, ensuring continuous improvement and high accuracy.
Evaluation run outputs
Each evaluation run generates the following types of outputs:
Request and response information
request_id
request
response
expected_retrieved_context
expected_response
retrieved_context
trace
Agent metrics and LLM judges
Agent metrics and LLM judges help you determine the quality of your application.
Agent metrics and judges
There are two approaches to measuring performance across these metrics:
Use an LLM judge: A separate LLM acts as a judge to evaluate the application’s retrieval and response quality. This approach automates evaluation across numerous dimensions.
Use deterministic functions: Assess performance by deriving deterministic metrics from the application’s trace and optionally the ground-truth recorded in the evaluation set. Some examples include metrics on cost and latency, or evaluating retrieval recall based on ground-truth documents.
The following table lists the built-in metrics and the questions they can answer:
Metric name |
Question |
Metric type |
---|---|---|
|
LLM judged |
|
|
How many of the known relevant documents did the retriever find? |
Deterministic (ground truth required) |
|
LLM judged (ground truth required) |
|
|
LLM judged |
|
|
LLM judged |
|
|
LLM judged |
|
|
Deterministic |
|
|
Deterministic |
You can also define a custom LLM judge to evaluate criteria specific to your use case.
See Information about the models powering LLM judges for LLM judge trust and safety information.
Retrieval metrics
Retrieval metrics assess how successfully your agentic application retrieves relevant supporting data. Precision and recall are two key retrieval metrics.
recall = # of relevant retrieved items / total # of relevant items
precision = # of relevant retrieved items / # of items retrieved
Did the retriever find relevant chunks?
Determine whether the retriever returns chunks relevant to the input request. You can use an LLM judge to determine the relevance of chunks without ground truth and use a derived precision metric to quantify the overall relevance of returned chunks.
![Chunk relevance precision example](../../_images/chunk-relevance-precision.png)
LLM judge:
chunk-relevance-precision
judgeGround truth required:
None
Input evaluation set schema:
request
retrieved_context[].content
ortrace
(only ifmodel
argument is not used inmlflow.evaluate()
)
yes
: The retrieved chunk is relevant to the input request.
no
: The retrieved chunk is not relevant to the input request.
Outputs for each question:
Data field |
Type |
Description |
---|---|---|
|
|
For each chunk, |
|
|
For each chunk, LLM’s reasoning for the corresponding rating |
|
|
For each chunk, if there was an error computing the rating, details of the error are here, and other output values will be NULL. If no error, this is NULL. |
|
|
Calculates the percentage of relevant chunks among all retrieved chunks. |
Metrics reported for the entire evaluation set:
Metric name |
Type |
Description |
---|---|---|
|
|
Average value of |
How many of the known relevant documents did the retriever find?
Calculates the recall percentage of ground truth relevant documents successfully retrieved by the retriever.
![Document recall example](../../_images/ground-truth-document-recall.png)
LLM judge: None, ground truth based
Ground truth required:
Yes
Input evaluation set schema:
expected_retrieved_context[].doc_uri
retrieved_context[].doc_uri
ortrace
(only ifmodel
argument is not used inmlflow.evaluate()
)
Outputs for each question:
Data field |
Type |
Description |
---|---|---|
|
|
The percentage of ground truth |
Metrics reported for the entire evaluation set:
Metric name |
Type |
Description |
---|---|---|
|
|
Across all questions, what is the average value of |
Response metrics
Response quality metrics assess how well the application responds to a user’s request. Response metrics can measure, for instance, if the resulting answer is accurate per the ground-truth, how well-grounded the response was given the retrieved context (e.g., did the LLM hallucinate), or how safe the response was (e.g., no toxicity).
Overall, did the LLM give an accurate answer?
Get a binary evaluation and written rationale on whether the agent’s generated response is factually accurate and semantically similar to the provided ground-truth response.
LLM judge:
correctness
judgeGround truth required: Yes,
expected_response
Input evaluation set schema:
request
expected_response
response
ortrace
(only ifmodel
argument is not used inmlflow.evaluate()
)
yes
: The generated response is highly accurate and semantically similar to the ground truth. Minor omissions or inaccuracies that still capture the intent of the ground truth are acceptable.
no
: The response does not meet the criteria. It is either inaccurate, partially accurate, or semantically dissimilar.
Outputs provided for each question:
Data field |
Type |
Description |
---|---|---|
|
|
|
|
|
LLM’s written reasoning for yes/no |
|
|
If there was an error computing this metric, details of the error are here, and other values are NULL. If no error, this is NULL. |
Metrics reported for the entire evaluation set:
Metric name |
Type |
Description |
---|---|---|
|
|
Across all questions, what’s the percentage where correctness is judged as |
Is the response relevant to the request?
Determine whether the response is relevant to the input request.
LLM judge:
relevance_to_query
judgeGround truth required:
None
Input evaluation set schema:
request
response
ortrace
(only ifmodel
argument is not used inmlflow.evaluate()
)
yes
: The response is relevant to the original input request.
no
: The response is not relevant to the original input request.
Outputs for each question:
Data field |
Type |
Description |
---|---|---|
|
|
|
|
|
LLM’s written reasoning for |
|
|
If there was an error computing this metric, details of the error are here, and other values are NULL. If no error, this is NULL. |
Metrics reported for the entire evaluation set:
Metric name |
Type |
Description |
---|---|---|
|
|
Across all questions, what’s the percentage where |
Is the response a hallucination, or is it grounded in the retrieved context?
Get a binary evaluation and written rationale on whether the generated response is factually consistent with the retrieved context.
LLM judge:
groundedness
judgeGround truth required: None
Input evaluation set schema:
request
retrieved_context[].content
ortrace
(only ifmodel
argument is not used inmlflow.evaluate()
)response
ortrace
(only ifmodel
argument is not used inmlflow.evaluate()
)
yes
: The retrieved context supports all or almost all generated responses.
no
: The retrieved context does not support the generated response.
Outputs provided for each question:
Data field |
Type |
Description |
---|---|---|
|
|
|
|
|
LLM’s written reasoning for |
|
|
If there was an error computing this metric, details of the error are here, and other values are NULL. If no error, this is NULL. |
Metrics reported for the entire evaluation set:
Metric name |
Type |
Description |
---|---|---|
|
|
Across all questions, what’s the percentage where |
Is there harmful content in the agent response?
Get a binary rating and a written rationale on whether the generated response has harmful or toxic content.
LLM judge:
safety
judgeGround truth required: None
Input evaluation set schema:
request
response
ortrace
(only ifmodel
argument is not used inmlflow.evaluate()
)
yes
: The generated response does not have harmful or toxic content.
no
: The generated response has harmful or toxic content.
Outputs provided for each question:
Data field |
Type |
Description |
---|---|---|
|
|
|
|
|
LLM’s written reasoning for |
|
|
If there was an error computing this metric, details of the error are here, and other values are NULL. If no error, this is NULL. |
Metrics reported for the entire evaluation set:
Metric name |
Type |
Description |
---|---|---|
|
|
What percentage of all questions were judged to be |
Custom retrieval LLM judge
Use a custom retrieval judge to perform a custom assessment for each retrieved chunk. The LLM judge is called for each chunk across all questions. For details on configuring custom judges, see Advanced agent evaluation.
Outputs provided for each assessment:
Data field |
Type |
Description |
---|---|---|
|
|
For each chunk, |
|
|
For each chunk, LLM’s written reasoning for |
|
|
For each chunk, if there was an error computing this metric, details of the error are here, and other values are NULL. If no error, this is NULL. |
|
|
What percentage of all retrieved chunks are judged as |
Metrics reported for the entire evaluation set:
Metric name |
Type |
Description |
---|---|---|
|
|
Across all questions, what’s the average value of |
Performance metrics
Performance metrics capture the overall cost and performance of the agentic applications. Overall latency and token consumption are examples of performance metrics.
What’s the token cost of executing the agentic application?
Computes the total token count across all LLM generation calls in the trace. This approximates the total cost given as more tokens, which generally leads to more cost.
Outputs for each question:
Data field |
Type |
Description |
---|---|---|
|
|
Sum of all input and output tokens across all LLM spans in the agent’s trace |
|
|
Sum of all input tokens across all LLM spans in the agent’s trace |
|
|
Sum of all output tokens across all LLM spans in the agent’s trace |
Metrics reported for the entire evaluation set:
Name |
Description |
---|---|
|
Average value across all questions |
|
Average value across all questions |
|
Average value across all questions |
What’s the latency of executing the agentic application?
Computes the entire application’s latency in seconds for the trace.
Outputs for each question:
Name |
Description |
---|---|
|
End-to-end latency based on the trace |
Metrics reported for the entire evaluation set:
Metric name |
Description |
---|---|
|
Average value across all questions |
Information about the models powering LLM judges
LLM judges might use third-party services to evaluate your GenAI applications, including Azure OpenAI operated by Microsoft.
For Azure OpenAI, Databricks has opted out of Abuse Monitoring so no prompts or responses are stored with Azure OpenAI.
For European Union (EU) workspaces, LLM judges use models hosted in the EU. All other regions use models hosted in the US.
Disabling Partner-Powered AI assistive features will prevent the LLM judge from calling Partner-Powered models.
Data sent to the LLM judge is not used for any model training.
LLM judges are intended to help customers evaluate their RAG applications, and LLM judge outputs should not be used to train, improve, or fine-tune an LLM.