Skip to main content
When several Agents need the same quality standard, define it once as a versioned object and reuse it for online observation and offline evaluation. AgentScope provides two levels of definition.

Example: apply one refund standard online and offline

A support Agent reviews replies online while an evaluator replays historical answers. If one checks unsupported refund promises and the other checks only tone, offline results cannot guide rollout. Version conditions, input fields and thresholds together. Use the same definition for online Judge and offline Evaluator. For tool behavior reuse trace metrics; classifications need not become pass/fail.

1. Share a definition across draft review and sample replay

JevJudge.Definition is for draft reviews where all conditions must hold. The example shares field conventions among JevJudge, JevEvaluator and JevResponseMiddleware. JevDraftPipeline also uses Definition but its output state uses request/evidence/draft. Define matching criteria or normalize fields in your workflow rather than reusing mismatched field names.
Keep field meanings consistent: JevEvaluator supplies user_question, supporting_context and assistant_answer. For direct Judge calls supply corresponding state. Update the version when questions, thresholds or pass policies change so reports remain distinguishable.

2. Reuse combinations of Agent behavior metrics

JevTraceMetric combines deterministic prechecks, question construction and result reduction. It supports Choice classification and purely deterministic checks without requiring every metric to produce pass/fail.
Use the same traceEvaluator with JevTraceRunner for replay or JevTraceEvaluationMiddleware for live Agent observations. Integration example Metric and local question IDs start with a letter, contain letters, digits or underscores, and are at most 64 characters. Metric IDs must be unique. The evaluator namespaces questions, merges compatible state and separates conflicting fields into different requests. Deterministic metrics without questions make no model call. Definition or reducer failures affect only their own metric.

Keep statuses alongside scores

JevMetricResult.passed is nullable, and a non-DECIDED status cannot declare pass or fail. Preserve SKIPPED, INCONCLUSIVE and ERROR to distinguish missing inputs, uncertainty and failures; replacing them with zero loses the reason. Threshold examples illustrate the API. Comparable evaluations require business labels, versions, execution modes and the full sample denominator. Evaluation methodology

Run and verify

Set JEV_CP using the example build instructions, then run:
Both entry points reuse answerDefinition() from the example source: an individual review exercises status boundaries and a batch replays a positive and a negative case. Preset probabilities verify definition reuse; offline matches do not establish model accuracy. Full source