跳转到主要内容
Evaluation closes the “develop → deploy → evaluate → tune” loop: use a fixed dataset and one or more evaluators to score a deployed runtime, then iterate on the quantified results. This page walks through the full flow from initializing a project to viewing evaluation results using a question-answering agent as the example. For details on each command, see View evaluation backend, Manage datasets, Manage evaluators, Manage evaluation targets, Run an experiment, and View experiments and results.
Before you start, configure Volcengine AK/SK credentials or obtain valid short-lived STS credentials through agentkit login. Evaluation is currently in Preview. The CLI first resolves whether the current account uses the Coze or TEA evaluation backend; run agentkit eval backend to inspect the resolved backend.

End-to-end flow

1

Initialize and deploy an agent

Create the project and deploy it to obtain a target runtime to evaluate:
Once deployed, run agentkit invoke run "hello" to confirm the runtime responds.
2

Create a dataset and add cases

The dataset is the data source for an experiment. Create it with the input and reference_output fields, then add cases one at a time or in bulk:
cases.json is an array of {field: value} objects:
cases.json
After adding, run agentkit eval dataset show qa-set to verify the cases.
3

Create an evaluator

An evaluator is the judging model that assigns scores. Derive one from a built-in template and point it at your own Ark model endpoint:
The TEA backend requires an evaluator version when submitting an experiment. After creating or updating the draft, submit a version:
4

Run an experiment

Submit the dataset, evaluator, and target runtime as one experiment. On the first run, add --dry-run to confirm the resolved dataset version, evaluator version, target, and field mapping are correct:
On Coze you may omit --evaluator-version; on TEA you must pass one --evaluator-version for each --evaluator. To confirm available target versions, first run agentkit eval target version-list --source-target-id <source-target-id>.
5

View results

Use the returned experiment id to view the aggregate scores and per-case results:
6

Iterate

Improve the agent’s prompt, tools, or model based on the results, redeploy, then run the experiment again with the same dataset and evaluator. Compare the aggregate scores and per-case results of the two runs to judge whether the change is an improvement or a regression:

Wire it into CI

The evaluation commands need no browser login and all support --json, so they can be orchestrated directly in a CI pipeline: the experimentId returned by eval run feeds into eval experiment show or results.

Practical guidance

  • Fix the dataset: use the same dataset across iterations so results can be compared side by side. Stabilize it before changing the agent.
  • Keep only stable inputs and reference answers: a dataset typically needs only input and reference_output. The model’s actual output is produced by the evaluated target during the experiment and should not be written into the dataset.
  • Prefer deriving evaluators from built-in templates: evaluator template list provides mature scoring rubrics; clone one and swap in your own judge model rather than writing one from scratch.
  • Use a strong judging model: point --model at a capable Ark endpoint; weaker models produce noisier scores.
  • Weight multiple evaluators: a single eval run can take several --evaluator flags to score across dimensions such as relevance and completeness.
  • Confirm the target runtime is online: --target must point to a deployed, responsive runtime, or cases will fail. When cases fail without an experiment-level error, the target runtime usually did not respond correctly — it is not an evaluation-config problem.
最后修改于 2026年9月19日