Prerequisites
- Install the SDK.
- Build a dataset, or use an existing dataset ID from the AgentX dashboard.
- Export
AGENTX_API_KEYin your environment.
Run an evaluation
client.evaluations.run() creates the run, .execute() calls my_agent once per test case, scores each response immediately, and submits the results. .finalize() closes the run: run_context.average_rating (and .min_rating / .max_rating / .rated_count) read straight from those scores, no LLM analysis pass required. .analyze() is a separate, optional step that adds the qualitative report (strengths, weaknesses, recommendations) and returns it as report.
Link each result to its trace
Trace the agent call and return the span’s id alongside the output - three things light up at once: a View trace button on every result row, trajectory-aware judging (the judge sees the tools the agent actually called, not just the answer), and expected-trajectory matching for cases that declareexpected_tools:
Concurrency, output reuse, and resume
.execute() takes two optional knobs:
concurrency (default 1) bounds parallel agent calls; results are still submitted in case
order. reuse_outputs_from replays the recorded outputs of cases unchanged since that run and
only invokes your agent for new or edited ones - scorer iteration costs judge calls, not agent
calls. Replayed results carry reusedFromRun in their metadata.
Interrupted runs resume for free: the engine tracks which case results a run already received,
and re-running .execute() against the same run skips them (older engines without the route
just re-run everything). A batch that fails to submit is retried once and then raises
EvaluationSubmissionError instead of letting the run finish silently empty - the run is left
unfinalized, and re-running execute() picks up past the already-submitted cases.
Configuration
AgentX reads environment variables via .from_env():
Or pass configuration directly:
Next steps
Build Dataset
Create test cases instead of using an existing dataset
EvaluationSubject Fields
Describe your agent so analysis can check instruction adherence
Examples
Framework-specific integration patterns
Submit Pre-Defined Results
Score outputs you already generated, without re-running the agent
Evaluation Settings
Build one grading config once, run it against any dataset
Link a Trace to a Result
Get a full Execution Timeline per result, not just a score
Multiple judge scorers per run
One agent execution, N verdicts (self-host): passadditional_scorer_ids and every result is
also scored by each extra judge, with its own rubric and model. The primary scorer keeps the
rating column (gates and averages unchanged); extra verdicts land in each result row’s
judgeScorerResults and roll up into the run’s scorerBreakdown.
GET /custom-agent-evaluations/runs/{id}/gate?failUnder=8&scorer=Safety;
an unknown scorer id or name is a hard 400, never a silently-passing gate.)
