Before you begin
Before you start, make sure you have:- Working eval: An eval that runs, as in Run your first eval.
- Two versions: The deployed version of your agent and the candidate, both callable as task functions.
1
Fix everything except task
A comparison is fair only when one thing changed. Hold these fixed and record what changed in
config:- Same eval name. Scorers are registered under the eval name, so
"baseline"and"candidate"as names would create two different scorers. The run’s identity belongs inconfig. - Same dataset. Each experiment pins a snapshot, and results pair on
dataset_record_id. If you change the cases and the agent together, you can’t tell which change moved the score. - Same scorers. If you change a scorer’s rubric, the new scorer version applies only to later runs.
2
Run baseline and candidate
This script runs the deployed version and a candidate over the same three cases.
baseline_experiment_id records which run the candidate is compared with: the app shows the pair side by side under Evals → Experiments, and client.experiments.list(baseline_experiment_id=...) lists every run compared with a baseline.compare.py
3
Diff results by case
Join the two runs’ results on The output shows identical means, yet the candidate broke a math case:
dataset_record_id, and label each case with its categories from the run’s snapshot. experiment.dataset_snapshot.records carries each record’s categories as they were when the run started, so you can see which kind of case regressed.4
Verify regression in trace
Open the regressed case’s trace in the app, or read its spans:Compare it with the baseline’s trace for the same record: the model’s reply, a tool call or its arguments, or a retrieval result. The regression is confirmed when the candidate’s trace shows the step that produced the wrong answer.
5
Track series over time (optional)
Every run of the same eval on the same dataset is one point in a series. List them newest first, and filter on For runs bound to an agent,
config to follow one model or branch:client.experiments.list(subject_kind="agent", subject_id=...) gives the agent’s history, and the agent’s page in the app shows it.Troubleshooting
If the baseline and candidate have different scorer IDs, they ran under different eval names. For this and other run errors, see Eval errors.Next steps
- Gate pull requests with evals: Run this comparison on every pull request, with a threshold and a minimum count of regressed cases.
See also
- Gate in other CI systems: The same rule as a script for any CI.
- Configure eval runs: Pin the context that changed between versions.