에이전트 주석
15개 프레임워크의 트레이스를 변환하고, 에이전트 트레이스 표시 유형으로 렌더링하며, 트레이스 수준과 단계 수준에서 주석하여 Potato에서 AI 에이전트를 평가합니다.
v2.3.0에서 신규 추가
How agentic annotation works
에이전트는 도구 호출, 중간 추론, 스크린샷, 분기 결정에 걸쳐 수십 단계를 실행합니다. 에이전트가 올바른 일을 했는지 판단하려면 이 모든 것이 화면에 있고, 탐색할 수 있고, 트레이스 수준과 단계 수준 모두에서 구조화된 질문이 있어야 합니다.
Potato는 이를 세 단계로 처리하며, 이 단계들은 의도적으로 분리되어 있습니다.
potato.trace_converterCLI로 원시 트레이스를 Potato의 표준 형식으로 변환합니다- 에이전트의 모달리티에 맞는 유형을 골라
instance_display로 표시합니다 - 일반 주석 스키마로 트레이스 수준에서 또는 단계별로 주석합니다
agentic: 구성 블록은 없습니다. 변환은 데이터에 대해 한 번 실행하는 명령이며, 그 이후는 어떤 작업에든 작성하는 일반 구성입니다.
트레이스 변환
에이전트 로그는 프레임워크마다 다릅니다. 변환기는 그중 15가지를 하나의 표준 JSONL 파일로 정규화합니다.
python -m potato.trace_converter \
--input raw_traces.json \
--input-format react \
--output data/traces.jsonl변환기 레퍼런스
| 변환기 | 원본 형식 |
|---|---|
openai | OpenAI Chat Completions 및 Assistants API 트레이스 |
anthropic | tool_use 블록이 있는 Anthropic Messages API |
claude_code | Claude Code 및 유사한 코딩 에이전트 세션 로그 |
aider | Aider 페어 프로그래밍 채팅 기록 |
swebench | SWE-bench 작업 트레이스 |
swe_agent_trajectory | SWE-Agent 궤적 파일 |
react | ReAct 방식의 thought / action / observation 로그 |
langchain | LangChain 및 LangSmith 실행 내보내기 |
langfuse | Langfuse 관찰 내보내기 |
otel | GenAI 규약을 사용하는 OpenTelemetry 내보내기 |
mcp | Model Context Protocol 세션 |
multi_agent | CrewAI, AutoGen, LangGraph 멀티 에이전트 로그 |
webarena | WebArena 및 VisualWebArena 트레이스 |
web_agent | Mind2Web과 computer-use를 포함한 브라우저 에이전트 녹화 |
atif | Agent Trace Interchange Format |
--list-formats는 설치된 버전에서 같은 목록을 출력하며, 둘이 어긋날 경우 신뢰해야 할 쪽은 이 사본입니다.
자동 감지
어떤 형식인지 확실하지 않을 때는 다음과 같이 합니다.
python -m potato.trace_converter \
--input traces.json \
--auto-detect \
--output data/traces.jsonl감지는 필드 시그니처를 읽으며 순서가 중요합니다. 더 구체적인 형식을 먼저 검사하므로 SWE-bench는 ReAct보다, Anthropic은 OpenAI보다 먼저 확인됩니다. 형식을 알게 되면 명시적으로 지정하십시오. 표본에서 맞게 추측한 감지기도 나머지 코퍼스에서는 틀리게 추측할 수 있기 때문입니다.
사용자 정의 변환기
목록에 없는 프레임워크에는 기본 변환기를 상속하여 등록합니다. 변환기는 Potato가 구성을 읽기 전에 실행되므로 구성이 아니라 Python입니다.
from typing import Any, Dict, List, Optional
from potato.trace_converter.base import BaseTraceConverter, CanonicalTrace
from potato.trace_converter.registry import converter_registry
class MyConverter(BaseTraceConverter):
format_name = "my_framework"
def detect(self, data: Any) -> bool:
return isinstance(data, list) and bool(data) and "log" in data[0]
def convert(self, data: Any, options: Optional[Dict] = None) -> List[CanonicalTrace]:
return [
CanonicalTrace(
id=str(run["run_id"]),
task_description=run["task"],
conversation=[
{"speaker": entry.get("kind", "Agent"), "text": entry["text"]}
for entry in run["log"]
],
)
for run in data
]
converter_registry.register(MyConverter())트레이스 표시
변환된 파일은 일반 데이터이므로 트레이스는 다른 콘텐츠와 똑같이 선언합니다. 어떤 표시 유형을 고르느냐가 주된 설계 결정입니다.
에이전트 트레이스 표시
도구를 사용하는 에이전트의 기본값입니다. 각 단계는 유형별로 색상이 구분된 카드로 렌더링됩니다.
instance_display:
fields:
- key: task_description
type: text
label: "Task"
- key: conversation
type: agent_trace
label: "Agent trace"
span_target: true
display_options:
show_step_numbers: true
show_summary: true
collapse_observations: false
step_type_colors:
thought: "#e8f4fd"
action: "#fff3e0"
observation: "#e8f5e9"span_target: true는 스팬 스키마가 트레이스 안의 텍스트를 표시할 수 있게 하며, 주장 단위 환각 표시가 이렇게 동작합니다.
대화 표시
dialogue 표시는 더 가벼운 선택지이며, 인라인 단계별 평가를 지원하는 것이 이 표시입니다.
instance_display:
fields:
- key: conversation
type: dialogue
label: "Agent trace"
span_target: true
display_options:
show_turn_numbers: true
alternating_shading: true
max_height: 600웹 에이전트 트레이스
브라우징 에이전트에는 web_agent_trace가 클릭과 입력 오버레이가 있는 스크린샷을 렌더링합니다.
instance_display:
fields:
- key: trace
type: web_agent_trace
label: "Browsing session"
display_options:
show_overlays: true
show_filmstrip: true
filmstrip_size: 150
screenshot_max_width: 900
show_thought: true
show_element_info: true코딩 트레이스
코딩 에이전트에는 coding_trace가 diff, 터미널 블록, 파일 읽기를 렌더링합니다.
instance_display:
fields:
- key: steps
type: coding_trace
label: "Coding session"
span_target: true
display_options:
diff_view: unified
show_file_tree: true
show_reasoning: true
terminal_theme: dark
collapse_long_outputs: true
max_output_lines: 50전체 레퍼런스는 코딩 에이전트 주석을 참조하십시오.
대화형 에이전트
interactive_chat은 대화를 렌더링하고 턴별 평가를 받습니다.
instance_display:
fields:
- key: messages
type: interactive_chat
label: "Conversation"
display_options:
show_turn_numbers: true
alternating_shading: true스크린샷 시퀀스
트레이스가 대부분 그림이라면 트레이스 표시보다 gallery가 더 간단합니다.
instance_display:
fields:
- key: screenshots
type: gallery
label: "Screenshots"
display_options:
layout: horizontal
thumbnail_size: 300
zoomable: true트레이스 수준 스키마
이들 중 에이전트에만 해당하는 것은 없습니다. 모두 일반 스키마이며, 각각 name과 description이 필요합니다.
annotation_schemes:
- annotation_type: radio
name: task_success
description: "Did the agent complete the task?"
labels:
- name: success
tooltip: "Fully completed correctly"
- name: partial
tooltip: "Partially completed, or completed with errors"
- name: failure
tooltip: "Not completed"
sequential_key_binding: true
- annotation_type: likert
name: efficiency
description: "How efficient was the agent's path?"
size: 5
min_label: "Very inefficient"
max_label: "Optimal"
- annotation_type: radio
name: safety
description: "Did the agent take any unsafe action?"
labels:
- name: safe
- name: minor_concern
- name: major_violation오류 분류 체계
MAST 분류 체계는 에이전트 실패 양상에 대한 공통 어휘를 제공하며, 이 덕분에 트레이스 전반에서 오류를 합칠 수 있습니다.
- annotation_type: multiselect
name: mast_errors
description: "Select every failure mode observed in this trace"
labels:
- name: disobey_task_spec
tooltip: "Does not follow the task specification"
- name: step_repetition
tooltip: "Repeats the same action unnecessarily"
- name: loss_of_history
tooltip: "Forgets prior context"
- name: unaware_of_termination
tooltip: "Does not recognize when to stop"
- name: fail_to_clarify
tooltip: "Fails to ask for needed clarification"
- name: task_derailment
tooltip: "Goes off track from the main task"
- name: reasoning_action_mismatch
tooltip: "Reasoning contradicts the action taken"
- name: premature_termination
tooltip: "Stops before the task is complete"
- name: incomplete_verification
tooltip: "Does not verify the result"
- name: no_errors
tooltip: "No errors observed"트레이스 안의 주장 표시
표시 필드에 span_target: true를 지정하면 스팬 스키마가 텍스트 자체를 표시합니다.
- annotation_type: span
name: hallucination_spans
description: "Mark claims the trace does not support"
labels:
- name: hallucination
tooltip: "Claim not grounded in the observations"
- name: incorrect_fact
tooltip: "Factually incorrect statement"단계 수준 평가
단계별로 판단을 수집하는 메커니즘이 두 가지 있으며, 서로 적합한 질문이 다릅니다.
인라인 턴별 평가
per_turn_ratings는 dialogue 또는 interactive_chat 표시에서 일치하는 각 턴 옆에 평가 위젯을 놓습니다. speakers를 제한하면 위젯이 판단 대상인 턴에만 남습니다.
display_options:
show_turn_numbers: true
per_turn_ratings:
speakers: ["Agent (Action)"]
schema_name: "action_correctness"
scheme:
type: likert
size: 3
labels: ["Wrong", "Right"]단계마다 여러 판단이 필요하면 scheme 대신 schemes를 사용하십시오. 각각 자체 주석 열을 가집니다.
display_options:
per_turn_ratings:
speakers: ["Agent (Action)"]
schemes:
- schema_name: action_correctness
scheme:
type: likert
size: 3
labels: ["Wrong", "Right"]
- schema_name: reasoning_quality
scheme:
type: likert
size: 5
labels: ["Poor", "Excellent"]데이터에서 가져오는 동적 행
트레이스의 길이가 다양할 때 options_from_data는 구성이 아니라 항목의 필드에서 행렬의 행을 만듭니다.
- annotation_type: multirate
name: step_ratings
description: "Rate each step"
options_from_data: step_summaries
labels: ["Incorrect", "Questionable", "Correct"]{"id": "trace_001", "step_summaries": ["Search for flights", "Compare prices", "Book cheapest"]}전용 평가 유형
에이전트 작업을 위해 만들어진 주석 유형이 네 가지 있습니다.
**trajectory_eval**은 두 단계 분류 체계, 심각도 가중치, 누적 점수로 단계별 오류 위치를 파악합니다. error_types는 범주의 목록이며, 각 범주에는 subtypes의 평평한 목록이 있습니다.
- annotation_type: trajectory_eval
name: step_eval
description: "Mark each step and classify any error"
steps_key: steps
step_text_key: content
error_types:
- name: reasoning
subtypes:
- logical_error
- incorrect_assumption
- name: action
subtypes:
- wrong_tool
- wrong_arguments
- premature_termination
severities:
- name: minor
weight: -1
- name: major
weight: -5
show_score: true궤적 평가 가이드를 참조하십시오.
**rubric_eval**은 실행을 여러 기준에서 한꺼번에 채점합니다. scale_labels는 목록이며 척도 지점마다 레이블이 하나씩입니다.
- annotation_type: rubric_eval
name: agent_rubric
description: "Rate this run on each criterion"
scale_points: 5
scale_labels: ["Very poor", "Poor", "Acceptable", "Good", "Excellent"]
criteria:
- name: correctness
description: "Did the agent produce the correct result?"
- name: efficiency
description: "Did the agent take an efficient path?"
- name: safety
description: "Did the agent avoid unsafe actions?"
show_overall: true루브릭 평가 튜토리얼을 참조하십시오.
**pairwise**는 이진, 척도, 다차원 모드로 두 실행을 비교합니다.
- annotation_type: pairwise
name: agent_comparison
description: "Which run was better?"
mode: multi_dimension
items_key: runs
labels: ["Agent A", "Agent B"]
dimensions:
- name: correctness
description: "Which result is correct?"
allow_tie: true
- name: efficiency
description: "Which took the shorter path?"
allow_tie: true쌍대 비교 가이드를 참조하십시오.
**process_reward**는 프로세스 보상 모델 학습을 위한 단계별 보상 레이블을 수집합니다.
- annotation_type: process_reward
name: step_rewards
description: "Click the first step where the agent went wrong"
mode: first_error
steps_key: steps
step_text_key: content프로세스 보상 주석을 참조하십시오.
실시간 에이전트 관찰
live_agent는 주석자가 지켜보는 동안 에이전트를 실행하며, 개입할 수 있는 컨트롤이 있습니다. 최상위 블록입니다.
live_agent:
endpoint_type: anthropic_vision # or openai_vision, ollama_vision
max_steps: 30
step_delay: 1.0
history_window: 5
timeout: 60
viewport:
width: 1280
height: 720
system_prompt: "Complete the task using the browser."
ai_config:
model: claude-sonnet-4-20250514
api_key: ${ANTHROPIC_API_KEY}
max_tokens: 4096
temperature: 0.3
instance_display:
fields:
- key: task
type: live_agent
label: "Live session"
display_options:
show_controls: true
allow_instructions: true
allow_takeover: true
show_overlays: true실시간 에이전트 평가와 라이브 코딩 에이전트를 참조하십시오.
에이전트 프록시
실시간 대화 작업에서 agent_proxy는 주석 인터페이스와 에이전트 사이에 놓여 주고받는 내용을 기록합니다. 이것도 최상위 블록이며, type이 백엔드를 선택합니다.
agent_proxy:
type: openai
model: "gpt-4o"
api_key: ${OPENAI_API_KEY}
system_prompt: "You are a helpful customer service agent."
temperature: 0.7
max_tokens: 1024
sandbox:
max_steps: 20
max_session_seconds: 600
rate_limit_per_minute: 10
request_timeout_seconds: 60설정은 유형 이름을 딴 중첩 키 아래가 아니라 블록에 직접 놓입니다.
HTTP 프록시는 자신의 에이전트 서버로 전달하며, 템플릿을 받는 대신 보내고 읽을 필드를 지정합니다.
agent_proxy:
type: http
url: "https://my-agent.example.com/chat"
headers:
Authorization: "Bearer ${AGENT_API_KEY}"
message_key: message
response_key: response
session_id_key: session_id
send_history: true
history_key: messages에코 프록시는 미리 정해 둔 답변을 반환하므로, 에이전트가 생기기 전에 인터페이스를 만들고 테스트하기에 충분합니다.
agent_proxy:
type: echo
responses:
- "Thanks, let me look into that."
- "I have found your order."sandbox 블록은 모든 프록시 유형에 적용되며, 실시간 세션을 제한하는 유일한 장치입니다. 이것이 없으면 멈춘 에이전트는 주석자가 포기할 때까지 실행됩니다.
전체 예시
annotation_task_name: "ReAct Agent Evaluation"
task_dir: "."
data_files:
- "data/traces.jsonl"
item_properties:
id_key: trace_id
text_key: task_description
instance_display:
fields:
- key: task_description
type: text
label: "Task"
- key: conversation
type: agent_trace
label: "Agent trace"
span_target: true
display_options:
show_step_numbers: true
show_summary: true
collapse_observations: true
step_type_colors:
thought: "#e8f4fd"
action: "#fff3e0"
observation: "#e8f5e9"
annotation_schemes:
- annotation_type: radio
name: task_success
description: "Did the agent complete the task?"
labels:
- name: success
- name: partial
- name: failure
sequential_key_binding: true
- annotation_type: likert
name: efficiency
description: "How efficient was the agent's path?"
size: 5
min_label: "Very inefficient"
max_label: "Optimal"
- annotation_type: multiselect
name: mast_errors
description: "Select every failure mode observed"
labels:
- name: step_repetition
- name: task_derailment
- name: reasoning_action_mismatch
- name: premature_termination
- name: no_errors
- annotation_type: text
name: failure_reason
description: "If the agent failed, describe what went wrong"
rows: 3
label_requirement:
required: false
output_annotation_dir: "annotation_output/"
export_annotation_format: jsonl
user_config:
allow_all_users: true데이터를 준비하고 서버를 시작합니다.
python -m potato.trace_converter --input raw_traces.json --input-format react --output data/traces.jsonl
potato start config.yaml -p 8000더 읽을거리
- 코딩 에이전트 주석 - diff, 터미널 출력, 파일 트리
- 프로세스 보상 주석 - 단계별 보상 레이블
- 코드 리뷰 주석 - 인라인 코멘트와 판정
- 라이브 코딩 에이전트 - 롤백이 있는 실시간 관찰
- 실시간 에이전트 평가 - 실시간 웹 에이전트 관찰
- 웹 에이전트 주석 - 미리 녹화된 브라우징 트레이스
- 내보내기 형식 - 주석을 꺼내는 방법
구현 세부 정보는 소스 문서를 참조하십시오.