View a markdown version of this page

Start an evaluation - AWS Context

Start an evaluation

You can start an evaluation in the console or with the StartEvaluation operation. Starting an evaluation returns its ID right away, and the evaluation runs in the background.

To start an evaluation in the console

  1. Open the AWS Context console and choose your Agent Context.

  2. Choose the Evaluation tab, and then choose Create evaluation.

  3. Under Evaluation name, enter a Name, or keep the generated one.

  4. Under Evaluation metrics, choose the evaluators and metrics to report. All of them are selected by default.

  5. Under Scenarios to evaluate, choose Upload scenarios to load a file, or choose Add manually from its menu to type scenarios.

  6. Choose Run evaluation.

The console doesn’t start an evaluation with Correctness unless at least one scenario has an expected answer, or with Goal success rate unless at least one has assertions. If only some scenarios lack them, the console warns you and runs the evaluation. While the Agent Context is ingesting, the console turns off Create evaluation, Duplicate, and Run evaluation. If the Agent Context has no connections or no entities yet, the console tells you what to do first.

To start an evaluation with the API

Call StartEvaluation with a name, the scenarios, the evaluators and metrics, and a clientToken. The evaluators list is required; for an evaluation with only metrics, pass an empty list. The clientToken is required. A retry with the same clientToken and the same input returns the same evaluation instead of starting a second one, for at least 8 hours. A retry with the same clientToken and different input returns ValidationException.

The following JSON shows a StartEvaluation request that evaluates two scenarios with Correctness and Goal success rate, and reports latency:

{ "agentContextId": "ac-1234567890abcdef", "name": "retrieval-quality-baseline", "clientToken": "baseline-2026-01-15", "scenarioSource": { "inline": { "scenarios": [ { "scenarioId": "top-customer", "query": "Which customer has placed the most orders?", "groundTruth": { "expectedResponse": { "text": "Harper Johansson has placed the most orders, with 9." } } }, { "scenarioId": "inactive-customers", "query": "How many customers have never placed an order?", "groundTruth": { "assertions": [ { "text": "The answer gives a single count of customers." }, { "text": "The count includes only customers with zero orders." } ] } } ] } }, "evaluators": [ { "evaluatorId": "Builtin.Correctness" }, { "evaluatorId": "Builtin.GoalSuccessRate" } ], "metrics": [ { "metricName": "RETRIEVAL_LATENCY_MILLISECONDS" } ] }

The response contains the evaluation’s id, arn, name, createdAt, and status, which is PENDING for a new evaluation.