Guides

Datasets overview

Generate pinned dataset evals, record baselines, sync regression suites, and gate releases with the dataset CLI.

Dataset evals run a pinned version of labeled examples through a challenge pack and deployment, then compare candidate runs against recorded baselines. They complement ad-hoc eval runs when you need reproducible regression signal tied to curated examples.

Lifecycle

  1. Create or import a dataset in the workspace (web UI, API, or the agentclash dataset CLI commands below).
  2. Pin a version with examples linked to challenge cases.
  3. Run a dataset eval — AgentClash executes each example and aggregates pass/fail.
  4. Record a baseline from a green eval run.
  5. Gate CI with agentclash dataset test (see Dataset CI Gates).
bash
1export AGENTCLASH_API_URL="https://api.agentclash.dev"
2export AGENTCLASH_TOKEN="<token>"
3export AGENTCLASH_WORKSPACE="<workspace-id>"
4
5# Start an eval against a pinned version
6agentclash dataset eval <datasetId> \
7  --version <dataset-version-id> \
8  --pack <challenge-pack-version-id> \
9  --challenge support \
10  --deployment <deployment-id>

Manage datasets from the CLI

The whole dataset lifecycle is available under agentclash dataset.

bash
1# Create, inspect, list, archive
2agentclash dataset create --name "Support set" --slug support \
3  --description "Curated support questions" \
4  --default-challenge-pack-version-id <challenge-pack-version-id>
5agentclash dataset list --limit 20
6agentclash dataset view <datasetId>
7agentclash dataset delete <datasetId>        # archives the dataset

dataset create also accepts --input-schema (a JSON Schema), --enforce-schema to reject examples that do not match it, and --from-file to load the whole create payload from JSON.

Examples

bash
1agentclash dataset example add <datasetId> \
2  --external-id refund-001 \
3  --input '{"question":"Can I get a refund?"}' \
4  --expected '{"answer":"Yes, within 30 days"}' \
5  --tag refunds
6agentclash dataset example list <datasetId>
7agentclash dataset example edit <datasetId> <exampleId> --status muted
8agentclash dataset example rm <datasetId> <exampleId>   # archives the example

--external-id makes example add an idempotent upsert. --source accepts manual, import, trace, synthetic, or promotion. example edit --status accepts active, archived, or muted.

Import and export

bash
1# Preview first, then import
2agentclash dataset import <datasetId> ./examples.jsonl --format jsonl --dry-run
3agentclash dataset import <datasetId> ./examples.jsonl --format jsonl --mode add
4
5# Export a pinned version
6agentclash dataset export <datasetId> --version <dataset-version-id> --format csv

--format is one of openai, braintrust, langsmith, phoenix, jsonl, or csv. --mode is add (default) or replace. For generic JSONL or CSV files, describe the columns with --mapping '<json>' or repeatable --map key=value entries (comma-separated values are allowed for input_keys, output_keys, and metadata_keys). dataset export defaults to jsonl.

Versions

bash
1agentclash dataset version create <datasetId> --label "before prompt change"
2agentclash dataset version list <datasetId>

version create snapshots the current examples. Use the resulting version ID with dataset eval, dataset test, and dataset export.

Production traces

Import traces as reviewable candidates, then promote the good ones into examples.

bash
1agentclash dataset import-traces <datasetId> ./traces.json --source otel
2agentclash dataset trace-candidates list <datasetId> --status pending
3agentclash dataset promote <datasetId> <candidateId> --tag from-prod

--source is one of otel, braintrust, langsmith, phoenix, or agentclash. For agentclash traces pass --run and --run-agent instead of a file, or reference an existing artifact with --artifact. --redaction takes a JSON config that drops or hashes metadata keys. trace-candidates list --status filters by pending, promoted, or rejected. promote accepts --expected to replace the expected output with an edited JSON value.

Record a baseline

A baseline snapshots the per-example outcomes of one completed, green eval run so later candidates can be compared against it. Record it with agentclash dataset baseline create. The command prints the baseline id. Give that ID to agentclash dataset test --baseline <id> to gate candidates against it.

bash
1agentclash dataset baseline create <datasetId> \
2  --run <eval-run-id> \
3  --label "support v1 baseline"
4
5# List the baselines of the dataset, newest first
6agentclash dataset baseline list <datasetId>

Each call adds a new baseline. The server does not replace an older one. A server-side dataset baseline is not the same as agentclash baseline set, which saves a local bookmark of a run in your CLI config.

The API form is POST /v1/workspaces/{workspaceID}/datasets/{datasetID}/baselines with the eval run_id and an optional label.

Baselines and regression suites

Syncing a pinned dataset version into a regression suite copies each example's provenance — its dataset-example ID and trace metadata — into the workspace regression suite, so manifest-based release gates can reference the same curated examples. (Under the hood these land in the workspace_regression_cases table keyed by dataset_example_id.)

bash
1agentclash dataset sync-regression-suite <datasetId> \
2  --version <dataset-version-id> \
3  --pack <challenge-pack-version-id> \
4  --challenge support \
5  --suite-name "Support dataset regression"

Re-running sync is idempotent: cases that already exist for an example are skipped, so you can safely re-sync after adding new examples.

CI gate output formats

agentclash dataset test supports human text, JSON gate payloads, and JUnit XML for CI parsers. Use --max-regressions 0 to fail on any newly failing example versus the baseline.

Info

Dataset gates are complementary to CI/CD agent gates and eval workflows. Use datasets when examples are curated and pinned; use eval scorecards when you are comparing agent revisions on a live pack.

See also