annotate-spans

Write consistent annotations on LLM spans and traces using project annotation configs.

11.3k|1.1k|Updated Nov 9, 2022
One-click install
npx skills add https://github.com/Arize-ai/phoenix --skill annotate-spans
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: annotate-spans
Source: https://github.com/Arize-ai/phoenix/tree/main/src/phoenix/server/agents/prompts/skills/annotate-spans
Command: npx skills add https://github.com/Arize-ai/phoenix --skill annotate-spans

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Recording feedback on LLM and agent spans often produces inconsistent, unfilterable labels that cannot be aggregated or audited later. This Skill enforces a disciplined annotation practice so every judgment is grounded, consistently named, and reusable across review sessions.

Core Features & Use Cases

  • Config-driven annotation: Pulls the project's existing annotation configs via GraphQL and reuses their names, labels, and score bounds instead of inventing ad-hoc rubrics, and creates or extends configs when a new failure category emerges.
  • Grounded judgment rules: Enforces one dimension per annotation, targeting the most specific responsible span, judging the first failure rather than downstream symptoms, and writing evidence-based explanations.
  • Coaching mode: Teaches users to build a failure taxonomy from real traces through open coding and axial coding before codifying categories as annotation configs.
  • Use Case: After debugging a failing agent run, ask the assistant to annotate the retrieval spans with a relevance label; it reuses the project's existing config, batches the annotations into one ui.spans.annotate call, and reports the label distribution with links to annotated spans.

Quick Start

Ask the assistant to annotate the failing spans in this trace with the project's relevance rubric and explain each judgment.

Frequently Asked Questions about annotate-spans

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I annotate spans and traces in Phoenix?

Use the ui.spans.annotate operation with a name, label or score, and explanation per annotation, batched into one call. First query the project's annotation configs and reuse an existing config's name and label vocabulary so results stay filterable and aggregatable.

How do I build a failure taxonomy for LLM traces?

Start from real failures by open-coding free-form notes on a handful of traces, then group them into 5-10 distinct, actionable categories. Define a clear label set per category and codify each as an annotation config so the rubric persists across sessions.

Should I use labels or numeric scores for span annotations?

Prefer crisp binary or small categorical labels like pass/fail or relevant/irrelevant because they apply consistently and aggregate cleanly. Use numeric scores only when the scale is genuinely meaningful, and record the rubric or threshold in metadata.

Which span should I annotate when an agent fails?

Annotate the most specific responsible span: the LLM span for model output, the tool span for tool behavior, the retriever span for retrieval quality. Judge the first failure rather than every downstream symptom, and reserve root spans for end-to-end judgments.

When should I not use span annotation?

Do not annotate during pure analysis with no intent to persist feedback; use trace debugging instead. It is also not suited for latency or cost statistics or for prompt authoring, which belong to other workflows.