Loading...
Loading...
MUST READ before running any ADK evaluation. ADK evaluation methodology — eval metrics, evalset schema, LLM-as-judge, tool trajectory scoring, and common failure causes. Use when evaluating agent quality, running adk eval, or debugging eval results. Do NOT use for API code patterns (use adk-cheatsheet), deployment (use adk-deploy-guide), or project scaffolding (use adk-scaffold).
npx skill4agent add google/adk-docs adk-eval-guideScaffolded project? If you used, you already have/adk-scaffold,make eval, andtests/eval/evalsets/. Start withtests/eval/eval_config.jsonand iterate from there.make evalNon-scaffolded? Usedirectly — see Running Evaluations below.adk eval
| File | Contents |
|---|---|
| Complete metrics reference — all 8 criteria, match types, custom metrics, judge model config |
| Dynamic conversation testing — ConversationScenario, user simulator config, compatible metrics |
| google_search and model-internal tools — trajectory behavior, metric compatibility |
| Multimodal inputs — evalset schema, built-in metric limitations, custom evaluator pattern |
make evaladk eval| Failure | What to change |
|---|---|
| Fix agent instructions (tool ordering), update evalset |
| Adjust agent instruction wording, or relax the expected response |
| Refine agent instructions, or adjust expected response — this is semantic, not lexical |
| Refine agent instructions to address the specific rubric that failed |
| Tighten agent instructions to stay grounded in tool output |
| Agent calls wrong tools | Fix tool descriptions, agent instructions, or tool_config |
| Agent calls extra tools | Use |
| Goal | Recommended Metric |
|---|---|
| Regression testing / CI/CD (fast, deterministic) | |
| Semantic response correctness (flexible phrasing OK) | |
| Response quality without reference answer | |
| Validate tool usage reasoning | |
| Detect hallucinated claims | |
| Safety compliance | |
| Dynamic multi-turn conversations | User simulation + |
| Multimodal input (image, audio, file) | |
references/criteria-guide.md# Scaffolded projects:
make eval EVALSET=tests/eval/evalsets/my_evalset.json
# Or directly via ADK CLI:
adk eval ./app <path_to_evalset.json> --config_file_path=<path_to_config.json> --print_detailed_results
# Run specific eval cases from a set:
adk eval ./app my_evalset.json:eval_1,eval_2
# With GCS storage:
adk eval ./app my_evalset.json --eval_storage_uri gs://my-bucket/evals--config_file_path--print_detailed_results--eval_storage_uri--log_leveladk eval_set create <agent_path> <eval_set_id>
adk eval_set add_eval_case <agent_path> <eval_set_id> --scenarios_file <path> --session_input_file <path>eval_config.json{
"criteria": {
"tool_trajectory_avg_score": {
"threshold": 1.0,
"match_type": "IN_ORDER"
},
"final_response_match_v2": {
"threshold": 0.8,
"judge_model_options": {
"judge_model": "gemini-2.5-flash",
"num_samples": 5
}
},
"rubric_based_final_response_quality_v1": {
"threshold": 0.8,
"rubrics": [
{
"rubric_id": "professionalism",
"rubric_content": { "text_property": "The response must be professional and helpful." }
},
{
"rubric_id": "safety",
"rubric_content": { "text_property": "The agent must NEVER book without asking for confirmation." }
}
]
}
}
}"response_match_score": 0.8judge_model_optionsuser_simulator_configreferences/criteria-guide.mdevalset.json{
"eval_set_id": "my_eval_set",
"name": "My Eval Set",
"description": "Tests core capabilities",
"eval_cases": [
{
"eval_id": "search_test",
"conversation": [
{
"invocation_id": "inv_1",
"user_content": { "parts": [{ "text": "Find a flight to NYC" }] },
"final_response": {
"role": "model",
"parts": [{ "text": "I found a flight for $500. Want to book?" }]
},
"intermediate_data": {
"tool_uses": [
{ "name": "search_flights", "args": { "destination": "NYC" } }
],
"intermediate_responses": [
["sub_agent_name", [{ "text": "Found 3 flights to NYC." }]]
]
}
}
],
"session_input": { "app_name": "my_app", "user_id": "user_1", "state": {} }
}
]
}intermediate_data.tool_usesintermediate_data.intermediate_responsessession_input.stateconversation_scenarioconversationreferences/user-simulation.mdgoogle_searchsave_preferencestool_trajectory_avg_scoreEXACTIN_ORDERANY_ORDERrubric_based_tool_use_quality_v1tool_trajectory_avg_score{
"conversation": [
{
"invocation_id": "inv_1",
"user_content": { "parts": [{"text": "Find me a flight from NYC to London"}] },
"intermediate_data": {
"tool_uses": [
{ "name": "search_flights", "args": {"origin": "NYC", "destination": "LON"} }
]
}
},
{
"invocation_id": "inv_2",
"user_content": { "parts": [{"text": "Book the first option"}] },
"final_response": { "role": "model", "parts": [{"text": "Booking confirmed!"}] },
"intermediate_data": {
"tool_uses": [
{ "name": "book_flight", "args": {"flight_id": "1"} }
]
}
}
]
}Appname# CORRECT - matches the "app" directory
app = App(root_agent=root_agent, name="app")
# WRONG - causes "Session not found" errors
app = App(root_agent=root_agent, name="flight_booking_assistant")before_agent_callbackKeyErrorasync def initialize_state(callback_context: CallbackContext) -> None:
state = callback_context.state
if "user_preferences" not in state:
state["user_preferences"] = {}
root_agent = Agent(
name="my_agent",
before_agent_callback=initialize_state,
instruction="Based on preferences: {user_preferences}...",
)session_input.state// WRONG — initializes feedback_history as a string, breaks .append()
"state": { "feedback_history": "" }
// CORRECT — matches the Python type (list)
"state": { "feedback_history": [] }
// NOTE: Remove these // comments before using — JSON does not support comments.tool_configmode="ANY"| Symptom | Cause | Fix |
|---|---|---|
Missing | Trajectory expects match per invocation | Add expected tool calls to all turns |
| Agent mentions data not in tool output | Hallucination | Tighten agent instructions; add |
| "Session not found" error | App name mismatch | Ensure App |
| Score fluctuates between runs | Non-deterministic model | Set |
| Agent uses | Remove trajectory metric; see |
| Trajectory fails but tools are correct | Extra tools called | Switch to |
| LLM judge ignores image/audio in eval | | Use custom metric with vision-capable judge (see |
https://google.github.io/adk-docs/evaluate/index.mdhttps://google.github.io/adk-docs/evaluate/criteria/index.mdhttps://google.github.io/adk-docs/evaluate/user-sim/index.mdgoogle_searchreferences/builtin-tools-eval.mdEXACTIN_ORDERtool_uses