项目工作表 / Agent 过程评测
Agent Trace Schema 模板
本页导航
| 字段 | 值 |
|---|---|
| 版本 | v1.0 |
| 最后更新 | 2026-07 |
| 使用时机 | Agent 轨迹采集与评测设计时 |
| 填写角色 | 平台工程师+评测工程师 |
| 下游消费者 | 归因分析团队、Agent 开发者 |
适用场景
用于记录 Agent 执行过程,支撑过程评分、成本分析、归因和复现。
字段说明
| 字段 | 说明 |
|---|---|
| trace_id | 轨迹标识 |
| run_id / case_result_id | 关联本次 Run 和 Case Result |
| case_id / case_version | 关联静态 Eval Case 及其版本 |
| goal | 任务目标 |
| initial_state / environment | 初始状态与执行环境 |
| steps | 执行步骤 |
| state_before / state_after | 步骤前后状态 |
| action_type / tool_name / arguments | 动作类型、工具和参数 |
| observation | 工具或环境返回 |
| decision_evidence | 可选的规则命中、引用或其他可观察依据;不得保存隐藏思维链 |
| cost / latency | 成本与延迟 |
| final_response | 最终回答 |
| final_state | 终态 |
| metrics / evaluation | 汇总指标与轨迹评价 |
本模板是第 14.12 节 Agent Trace 语义契约的可填写实现。第 8、17、21 章出现的 Trace 字段仅为对应场景的最小视图;字段语义以第 14.12 节为准,本工作表必须与其保持一致。
模板
trace_id:
run_id:
case_result_id:
case_id:
case_version:
goal:
initial_state:
environment:
steps:
- step_id:
timestamp:
state_before:
action_type:
tool_name:
arguments:
observation:
state_after:
decision_evidence:
expected_behavior:
deviation:
evaluator_notes:
cost:
input_tokens:
output_tokens:
estimated_cost:
amount:
currency:
pricing_version:
components:
model:
tool:
sandbox:
latency_ms:
error:
final_state:
final_response:
metrics:
evaluation:
task_success:
process_safety:
tool_accuracy:
state_consistency:
cost_acceptability:
填写示例
以下 ID、版本、时间、成本和延迟均为假设性教学示例,不代表真实运行结果或服务等级。
trace_id: trace_refund_001
run_id: run_refund_001
case_result_id: case_result_refund_001
case_id: eval_refund_member_partial_001
case_version: v2
goal: 判断会员部分退款对优惠券和积分的影响
initial_state:
identity_verified: true
refund_type: partial
steps:
- step_id: 1
timestamp: "2026-07-08T10:30:00Z"
state_before:
refund_type: partial
action_type: tool_call
tool_name: refund_rule_calc
arguments:
order_id: O123
item_id: I456
refund_type: partial
observation:
points_adjustment: requires_recalculation
state_after:
refund_rule_checked: true
decision_evidence:
policy_rule: high_risk_refund_requires_rule_check
source: refund_policy_20260701
expected_behavior: 正确调用退款规则工具
deviation: none
evaluator_notes: 工具选择与参数均符合 Case 约束
cost:
input_tokens: 1200
output_tokens: 300
estimated_cost:
amount: 0.012
currency: CNY
pricing_version: refund_agent_pricing_202607
components:
model: 0.010
tool: 0.002
sandbox: 0
latency_ms: 850
final_state:
answer_based_on_tool: true
final_response: 需要结合订单明细重新计算优惠券分摊和积分调整
metrics:
total_steps: 1
total_latency_ms: 850
evaluation:
task_success: pass
process_safety: pass
tool_accuracy: pass
state_consistency: pass
cost_acceptability: pass
常见误区
| 误区 | 修正方式 |
|---|---|
| 只记录最终回答 | 记录步骤、状态、工具和观察 |
| Trace 过于自由文本 | 使用结构化字段 |
| 保存模型隐藏思维链 | 只记录规则命中、引用和可观察决策依据,不采集隐藏推理过程 |
| 不记录成本 | 每步记录 token、工具和延迟 |
| 终态成功就忽略过程风险 | 同时评分任务成功和过程安全 |