Skip to main content
Source Code: src/gaia/eval/

What Is Agent Eval?

The Agent Eval framework validates your GAIA agent’s quality by running realistic, multi-turn conversations against the live Agent UI. It uses Claude Code as both user simulator and judge — driving conversations through MCP, scoring every response across 7 dimensions, and producing a machine-readable scorecard. Unlike unit tests that check individual functions, Agent Eval tests the full system end-to-end: RAG indexing, tool dispatch, context retention, hallucination resistance, and personality compliance — through the same interface real users interact with. What you get:
  • Automated multi-turn conversation testing with persona-driven user messages
  • 7-dimension scoring rubric (correctness, tool selection, context retention, completeness, efficiency, personality, error recovery)
  • Deterministic pass/fail with weighted scoring
  • Regression detection via baseline comparison
  • Auto-fix mode that invokes Claude Code to repair failures

Prerequisites

1

Install eval dependencies

2

Authenticate Claude

The benchmark uses Claude to drive and judge each scenario. A Claude Code login (claude, then /login) is enough, and it wins over any API key. Without one, export an API key in the shell:
A key in a .env file is used only when there is no login and no exported key. The run prints which credential it uses, for example Claude eval driver: using the Claude Code CLI login.
3

Install Claude Code CLI

The runner invokes scenarios via claude -p subprocess. Verify it’s installed:
If not installed, see Claude Code installation.
4

Install the local LLM backend

The benchmark runs against a local model, so Lemonade and the model have to be on the machine. gaia init installs both — you don’t have to start anything, the daemon does that:
5

Start the Agent UI backend

Start the backend from the repository root with the eval switches set. The pre-flight check refuses to run memory, email and scripted-user scenarios without them, and a full benchmark always includes all three:
Memory scenarios also need long-term memory switched on. It is on by default; if you turned it off, switch it back on in the Memory dashboard, or with:
The Agent UI backend must be running on http://localhost:4200 (default). A scenario that touches neither memory nor email and sets no decline_commands runs against a plain gaia chat --ui. The eval’s own MCP server already gets GAIA_MEMORY_MCP_ALWAYS=1 from eval/mcp-config.json, so the backend does not need it.

Quick Start

Run your first eval in under 5 minutes:

1. Run a Single Scenario

Start with a simple RAG factual lookup test:
This will:
  1. Create a new Agent UI session via MCP
  2. Index the acme_q3_report.md document
  3. Ask about Q3 revenue (simulating a power_user persona)
  4. Judge the response against the ground truth ($14.2 million)
  5. Output a scored result

2. Run a Category

Test all RAG quality scenarios:

3. Run the Full Benchmark

Run all scenarios across every category (91 scenarios in 12 categories at the time of writing):
The full benchmark includes memory, gaia_email and scripted-user scenarios, so it needs a backend started with the eval switches from Start the Agent UI backend. Against a plain gaia chat --ui it stops at pre-flight before running any scenario. Passing pre-flight does not make a local run match CI: the gaia_* categories also rely on a fixture hub, a fixture web server and auto-approved tools that pre-flight does not check. To reproduce a CI lane’s scores, run python util/run_eval_lane.py --lane <lane>, which sets the backend up the way CI does.
Every scenario scores the flagship gaia agent. That is the --agent-type default and no scenario pins its own, so a scorecard names one agent and two scorecards are comparable. Pass --agent-type to measure a different agent, but never compare that result to a scorecard captured under another one — --compare matches on scenario ID alone and cannot tell two agents apart. The local model is different: a scorecard records it, and --compare refuses (exit 3) a baseline captured on another model or under another eval model. To score a specific model, set it as default_model in the backend’s GAIA home and pass --agent-model so every scenario is checked against it.

4. Architecture Audit (Free)

Check for structural limitations without making any LLM calls:

Reading the Scorecard

After each run, results are written to eval/results/<run_id>/:

Understanding Pass / Fail

A scenario passes when both conditions are met:
  • Overall score is 6.0 or higher (out of 10)
  • No turn has a correctness score below 4
A scenario fails if either:
  • Overall score is below 6.0, OR
  • Any single turn has correctness below 4 (hard fail on hallucination or wrong answer)

The 7 Scoring Dimensions

Each turn is scored across 7 dimensions. The overall score is a weighted sum:

Status Codes

Only PASS, FAIL, and BLOCKED_BY_ARCHITECTURE count toward the average score and judged pass rate. Infrastructure statuses are excluded from quality metrics.

Sample Output


Scenario Categories

The benchmark includes 91 scenarios across 12 categories (counts as of this writing — the runner discovers scenarios dynamically, so totals grow as new YAML is added): CI runs all of these except vision and web_system, which read the runner’s own screen, windows and clipboard into a scorecard that uploads as a public artifact. Run those two locally.

Common Workflows

Regression Testing

Save a baseline after a known-good run, then compare future runs. A baseline is only valid against runs of the same agent under the same judge model — --model drives each scenario as well as scoring it, so changing either makes the diff meaningless rather than merely noisy:
The comparison shows per-scenario deltas, regressions (PASS to FAIL), and improvements (FAIL to PASS).

Auto-Fix Mode

Let Claude Code automatically diagnose and repair failures:
Fix mode runs in a loop:
  1. Evaluate all scenarios
  2. Diagnose failures and patch source code
  3. Re-run only the failed scenarios
  4. Compare results — stop when --target-pass-rate is reached
Fix mode patches src/gaia/ source files directly, so it refuses to start while tracked files have uncommitted changes — commit your work or run it from a separate worktree. A fixer iteration that times out or fails stops the loop; check git diff for partial edits. Always review diffs before committing. Run python util/lint.py --all --fix after fix iterations.

Capturing Real Sessions

Convert a live Agent UI conversation into a replayable scenario:
This reads the session from the Agent UI database, extracts turns and indexed documents, and writes a scenario YAML to eval/scenarios/captured/. You must then edit the file to add proper ground_truth and success_criteria fields.

Filtering by Tags

Run only scenarios with specific tags:
A scenario matches when its tags: field contains at least one of the given tags. The shipped scenarios use the difficulty tiers t1_basic, t2_compound, t3_stress and t4_adversarial, plus security, usability and tui; scenarios you author can carry any tags you like. --exclude-tag drops scenarios carrying a tag, after the include filters are applied. Shipped scenarios that need a particular environment are tagged for this: for a run without Lemonade, use --exclude-tag local_blocked_no_embedder --exclude-tag live.

Output Formats


Cost Control

Typical costs:
  • Single scenario: $0.02 -- $0.10
  • Full benchmark (all scenarios): $1.00 -- $5.00 (scenarios whose corpus files aren’t on disk are skipped)
  • Architecture audit: $0.00 (no LLM calls)
Start with --audit-only (free) to understand expected failures, then run individual categories to control costs during development.

Which Claude account pays

Every eval that calls Claude (gaia eval agent, gaia eval tasks, email drafting, action items, briefings, gaia eval sessions, retrieval) and PDF corpus generation uses the first of these, and prints which one, never any part of the key or token:
  1. Your Claude Code subscription, through claude -p: CLAUDE_CODE_OAUTH_TOKEN, or the CLI’s own login (checked with claude auth status). Where no interactive login is possible (CI), set CLAUDE_CODE_OAUTH_TOKEN from claude setup-token. A subscription token is not an API key, so never export it as ANTHROPIC_API_KEY.
  2. ANTHROPIC_API_KEY from the environment: the Messages API, billed per token to that console account.
  3. ANTHROPIC_API_KEY from a .env file, the same way.
With none of them, the run stops with an error naming all three. It never falls back to a weaker scorer. On the subscription path, token counts and total_cost_usd come from the CLI’s JSON output. The cost is the list price of those tokens, not money spent. Token counting (count_tokens) and inline PDF analysis exist only on the API path.

Next Steps

Scenario Authoring

Write custom scenarios with YAML and ground truth

CI/CD Integration

Run Agent Eval in GitHub Actions with regression detection

CLI Reference

Complete flag reference for gaia eval agent

Agent Eval Benchmark

Deep-dive into architecture, scoring pipeline, and fix mode internals