Skip to main content

What is Evaluation?

Evaluation analyzes the conversation transcripts produced by simulation and scores your agent across multiple dimensions. The output is a set of files summarizing your agent’s performance across turns, conversations, and error types.
Evaluation

What Gets Evaluated

Each agent response is scored on five metrics per turn: Scores range from 1 (poor) to 5 (excellent), with 3–4 considered good and 4–5 excellent. You can add domain-specific custom metrics (e.g. product suitability, compliance) via Python files. At the conversation level, two additional scores are computed on a 0–1 scale:
  • Goal Completion: whether the user’s goal was fully addressed by the end of the conversation.
  • Turn Success Ratio: proportion of turns with no detected behavior failure.
These combine into an Overall Agent Score per conversation:
overall_agent_score = turn_success_ratio × 0.75 + goal_completion_score × 0.25Each conversation is assigned a status based on this score. For the exact status values and thresholds, see Evaluation output in the Schema Reference.

Behavior Failure Detection

Beyond numeric scores, evaluation detects the type of failure in each underperforming turn: Across all conversations, duplicate failures are deduplicated into a unique errors list with occurrence counts. When errors are found and a scenario file is available, the evaluator automatically generates focus files for targeted reruns (see Focus Files below).

Inputs

The input to evaluation is the simulation output file (e.g. simulation.json) from the Simulation step. Knowledge referenced during evaluation comes from your Scenarios file. Evaluation is configured via a YAML file:
For all evaluation config keys, types, and defaults, see Run configuration → Evaluation keys in the Schema Reference.

Custom Metrics

In addition to the built-in metrics (helpfulness, coherence, relevance, verbosity, faithfulness, goal completion, behavior failure), you can define custom metrics in Python and load them via config.
list[str]
List of paths to Python files. Each file is loaded and every public QuantitativeMetric or QualitativeMetric subclass is instantiated and run. Custom metrics always run — they are not filtered by metrics_to_run.
list[str]
Names of built-in metrics to run. If empty, all built-in metrics run. Use this to restrict evaluation to a subset of built-ins while still running all custom metrics from custom_metrics_file_paths.

Scope

Every custom metric has a scope that controls when it runs: Use "turn" for response-quality checks (clarity, tone, compliance statements). Use "conversation" for end-to-end assessments that only make sense after the whole conversation (goal completion, needs assessment, product suitability).

Metric Types

Produces a numeric score (e.g. 0–5).

Available fields

Both metric types receive a ScoreInput:

Threshold Gates

Threshold gates let you fail the CLI with a non-zero exit code when evaluation results fall below acceptable levels. All three gate types are evaluated after every arksim evaluate or arksim simulate-evaluate run.

numeric_thresholds

Per-metric minimum scores on each metric’s native scale. The mean score across all turns per conversation is compared against the threshold. Any conversation that falls below the threshold fails the run with exit code 1.

qualitative_failure_labels

Hard-gate failure labels for qualitative metrics. Any evaluated turn whose label appears in the list fails the run with exit code 1. Turns where the metric did not run are skipped.
If any gate fails, the CLI exits with code 1 and logs which conversations and turns did not meet the requirement. See Exit codes for the full list of exit codes.

Programmatic threshold gates

When running ArkSim programmatically (e.g. with a custom agent class), you can apply the same gates by importing check_numeric_thresholds and check_qualitative_failure_labels directly from arksim.evaluator:
You can also write your own custom gate by inspecting evaluator_output.conversations directly and applying any logic you need:

Running Evaluation

1

Install ArkSim

2

Run evaluation


Output Files


Reading the Output

Results go to evaluation.json: conversations (one per run), unique_errors (deduplicated failures), and error_scenario_mappings (which scenarios triggered each error).

Focus Files

When evaluation detects unique errors and a scenario file is provided, the evaluator generates focus files in a focus/ subdirectory. These are filtered scenario files that let you rerun only the failing subset without any manual config.

How it works

Each unique error group is mapped back to the scenarios that triggered it. The evaluator writes one JSON file per error group plus a combined file with all failing scenarios:
Error files are numbered by severity (critical first, then high, medium, low) and by occurrence count within the same severity level. Each focus file uses the standard Scenarios schema, so it works directly with --scenario_file_path:
Pass a separate --output_dir for each rerun so results do not overwrite the original evaluation. Each rerun produces its own evaluation, report, and focus files (or no focus files if everything passes).

Iterative fix workflow

Focus files support an iterative fix-and-verify loop:
  1. Run arksim simulate-evaluate config.yaml and review the errors
  2. Fix the highest-severity bug in your agent
  3. Rerun with the focus file: --scenario_file_path ./evaluation/focus/error_1.json --output_dir ./results/rerun_1
  4. If the error is resolved, move to the next error group
  5. When all targeted reruns pass, do a full battle test with the original scenario file
The focus set shrinks as you fix bugs. Scenarios that pass on rerun will not appear in the new run’s focus files.