5a558eb09e
TypeScript SDK Compatibility V1.x E2E Tests / Select Node version matrix (push) Has been cancelled
TypeScript SDK Compatibility V1.x E2E Tests / TypeScript SDK Compatibility V1.x E2E Tests Node ${{matrix.node_version}} (push) Has been cancelled
TypeScript SDK E2E Tests / TypeScript SDK E2E Tests Node ${{matrix.node_version}} (push) Has been cancelled
Opik Optimizer - E2E Tests / build-opik (push) Has been cancelled
TypeScript SDK Compatibility V1.x E2E Tests / build-opik (push) Has been cancelled
Python SDK E2E Tests / Select Python version matrix (push) Has been cancelled
Python SDK E2E Tests / Python SDK E2E Tests ${{matrix.python_version}} (push) Has been cancelled
Python SDK E2E Tests / build-opik (push) Has been cancelled
Python SDK Compatibility V1.x E2E Tests / Select Python version matrix (push) Has been cancelled
Python SDK Compatibility V1.x E2E Tests / Python SDK Compatibility V1.x E2E Tests ${{matrix.python_version}} (push) Has been cancelled
Python SDK Compatibility V1.x E2E Tests / build-opik (push) Has been cancelled
TypeScript SDK E2E Tests / Select Node version matrix (push) Has been cancelled
TypeScript SDK E2E Tests / build-opik (push) Has been cancelled
Opik Optimizer - E2E Tests / Opik Optimizer E2E Tests Python ${{matrix.python_version}} (push) Has been cancelled
Opik Optimizer - E2E Tests / Opik Optimizer Integration Smoke Tests (push) Has been cancelled
🐙 Code Quality / detect (push) Has been cancelled
🐙 Code Quality / lint (${{ matrix.leg.name }}) (push) Has been cancelled
🐙 Code Quality / summary (push) Has been cancelled
TypeScript SDK Library Integration Tests / Check Secrets (push) Has been cancelled
TypeScript SDK Library Integration Tests / opik-vercel (Vercel AI SDK / eve) (push) Has been cancelled
SDK Library Integration Tests Runner / Check Secrets (push) Has been cancelled
SDK Library Integration Tests Runner / Missed OpenAI API Key Warning (push) Has been cancelled
SDK Library Integration Tests Runner / Build (push) Has been cancelled
SDK Library Integration Tests Runner / openai_tests (push) Has been cancelled
SDK Library Integration Tests Runner / langchain_tests (push) Has been cancelled
SDK Library Integration Tests Runner / langchain_legacy_tests (push) Has been cancelled
SDK Library Integration Tests Runner / llama_index_tests (push) Has been cancelled
SDK Library Integration Tests Runner / anthropic_tests (push) Has been cancelled
SDK Library Integration Tests Runner / mistral_tests (push) Has been cancelled
SDK Library Integration Tests Runner / groq_tests (push) Has been cancelled
SDK Library Integration Tests Runner / aisuite_tests (push) Has been cancelled
SDK Library Integration Tests Runner / haystack_tests (push) Has been cancelled
SDK Library Integration Tests Runner / dspy_tests (push) Has been cancelled
SDK Library Integration Tests Runner / crewai_v0_tests (push) Has been cancelled
SDK Library Integration Tests Runner / crewai_v1_tests (push) Has been cancelled
SDK Library Integration Tests Runner / genai_tests (push) Has been cancelled
SDK Library Integration Tests Runner / adk_tests (push) Has been cancelled
SDK Library Integration Tests Runner / adk_legacy_1_3_0_tests (push) Has been cancelled
SDK Library Integration Tests Runner / evaluation_metrics_tests (push) Has been cancelled
SDK Library Integration Tests Runner / bedrock_tests (push) Has been cancelled
SDK Library Integration Tests Runner / litellm_tests (push) Has been cancelled
SDK Library Integration Tests Runner / harbor_tests (push) Has been cancelled
SDK Library Integration Tests Runner / Slack Notification (push) Has been cancelled
Lint Opik Helm Chart / render-equality (push) Has been cancelled
Opik Optimizer - Unit Tests / Opik Optimizer Unit Tests Python ${{matrix.python_version}} (push) Has been cancelled
Python BE E2E Tests / Python BE E2E (push) Has been cancelled
Python Backend Tests / run-python-backend-tests (push) Has been cancelled
Python SDK Unit Tests / Python SDK Unit Tests ${{matrix.python_version}} (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
SDK E2E Libraries Integration Tests / Check Secrets (push) Has been cancelled
SDK E2E Libraries Integration Tests / Missed OpenAI API Key Warning (push) Has been cancelled
SDK E2E Libraries Integration Tests / build-opik (push) Has been cancelled
SDK E2E Libraries Integration Tests / E2E Lib Integration Python ${{matrix.python_version}} (push) Has been cancelled
TypeScript SDK Integration Build & Publish / build-and-publish (opik-gemini) (push) Has been cancelled
TypeScript SDK Integration Build & Publish / build-and-publish (opik-langchain) (push) Has been cancelled
TypeScript SDK Integration Build & Publish / build-and-publish (opik-openai) (push) Has been cancelled
TypeScript SDK Integration Build & Publish / build-and-publish (opik-otel) (push) Has been cancelled
TypeScript SDK Integration Build & Publish / build-and-publish (opik-vercel) (push) Has been cancelled
TypeScript SDK Build & Publish / build-and-publish (push) Has been cancelled
TypeScript SDK Unit Tests / Test on Node ${{ matrix.node-version }} (push) Has been cancelled
Backend Tests / discover-tests (push) Has been cancelled
Backend Tests / ${{ matrix.name }} (push) Has been cancelled
Build and Publish SDK / build-and-publish (push) Has been cancelled
Build Opik Docker Images / set-version (push) Has been cancelled
Build Opik Docker Images / build-backend (push) Has been cancelled
Build Opik Docker Images / build-sandbox-executor-python (push) Has been cancelled
Build Opik Docker Images / build-python-backend (push) Has been cancelled
Build Opik Docker Images / build-frontend (push) Has been cancelled
Build Opik Docker Images / create-git-tag (push) Has been cancelled
ClickHouse Migration Cluster Check / validate-clickhouse-migrations (push) Has been cancelled
Docs - Publish / run (push) Has been cancelled
E2E Tests - Post Merge (v2) / 🧪 E2E v2 Tests (${{ github.event.inputs.tier || 't1' }}) (push) Has been cancelled
E2E Tests - Post Merge (v2) / 📢 Slack Notification (push) Has been cancelled
Frontend Unit Tests / Test on Node 20 (push) Has been cancelled
Guardrails E2E Tests / Select Python version matrix (push) Has been cancelled
Guardrails E2E Tests / Guardrails E2E Tests ${{matrix.python_version}} (push) Has been cancelled
Guardrails E2E Tests / 📢 Slack Notification (push) Has been cancelled
Guardrails Backend Unit Tests / Guardrails Backend Unit Tests (push) Has been cancelled
Guardrails Backend Unit Tests / 📢 Slack Notification (push) Has been cancelled
Lint Opik Helm Chart / lint-helm-chart (Helm v3.21.0) (push) Has been cancelled
Lint Opik Helm Chart / lint-helm-chart (Helm v4.2.0) (push) Has been cancelled
Lint Opik Helm Chart / unittest-helm-chart (push) Has been cancelled
403 lines
11 KiB
Plaintext
403 lines
11 KiB
Plaintext
---
|
|
headline: Annotation Queues | Opik Documentation
|
|
og:description: Optimize your AI projects by enabling SMEs to efficiently review and
|
|
annotate outputs using Opik's intuitive Annotation Queues feature.
|
|
og:site_name: Opik Documentation
|
|
og:title: Streamline Annotation Queues with Opik
|
|
subtitle: Enable subject matter experts to review and annotate agent outputs with
|
|
easy queues, invitations, and a clean annotation UI
|
|
title: Annotation Queues
|
|
canonical-url: https://www.comet.com/docs/opik/evaluation/advanced/annotation_queues
|
|
---
|
|
|
|
Involving subject matter experts in AI projects is essential because they provide the domain knowledge and contextual judgment that ensures model outputs are accurate, relevant, and aligned with real-world expectations. Annotation Queues in Opik make it simple for subject matter experts (SMEs) to review and annotate agent outputs. This feature streamlines the human-in-the-loop process by providing easy queue management, simple invitation flows, and a distraction-free annotation experience designed for non-technical users.
|
|
|
|

|
|
|
|
Annotation Queues are collections of traces or threads that need human review and feedback. They enable you to organize content for review, share with SMEs easily, collect structured feedback, and track progress across all your evaluation workflows.
|
|
|
|
## Creating and Managing Annotation Queues
|
|
|
|
Each annotation queue is defined by a collection of traces or threads, evaluation instructions, and feedback definitions:
|
|
|
|
1. **Queue Configuration**: Set up the queue with clear instructions and scope
|
|
2. **Content Selection**: Add traces or threads that need human review
|
|
3. **SME Access**: Share queue links with subject matter experts for annotation
|
|
|
|
### Setting Up Your First Queue
|
|
|
|
Navigate to the **Annotation Queues** page in your project and click **Create Queue**.
|
|
|
|
<Frame>
|
|
<img src="/img/evaluation/create_new_annotation_queue.png" />
|
|
</Frame>
|
|
|
|
Configure your queue with:
|
|
|
|
- **Name**: Clear identification for your queue
|
|
- **Scope**: Choose between traces or threads
|
|
- **Instructions**: Provide context and guidance for reviewers
|
|
- **Feedback Definitions**: Select the metrics SMEs will use for scoring
|
|
|
|
### Adding Content to Your Queue
|
|
|
|
You can add items to your queue in several ways:
|
|
|
|
**From Traces/Threads Lists:**
|
|
|
|
- Select one or multiple items
|
|
- Click **Add to -> Add to annotation queue**
|
|
- Choose an existing queue or create a new one
|
|
|
|
**From Individual Trace/Thread Details:**
|
|
|
|
- Open the trace or thread detail view
|
|
- Click **Add to -> Add to annotation queue** in the actions panel
|
|
- Select your target queue
|
|
|
|
<Frame>
|
|
<img src="/img/evaluation/add_to_annotation_queue.png" />
|
|
</Frame>
|
|
|
|
### Sharing with Subject Matter Experts
|
|
|
|
Once your queue is set up, you can share it with SMEs:
|
|
|
|
**Copy Queue Link:**
|
|
|
|
<Tip>
|
|
**SME Access Required**: Subject matter experts must be invited to your
|
|
workspace before they can access annotation queues. Make sure to invite them
|
|
to your project first, then share the queue link.
|
|
</Tip>
|
|
|
|
- Click the **Share queue** button on your queue to copy the queue link
|
|
- Share the link directly with SMEs via email, Slack, or other communication tools
|
|
|
|
## SME Annotation Experience
|
|
|
|
When SMEs access a queue, they experience a streamlined, distraction-free interface designed for efficient review.
|
|
|
|
<Frame>
|
|
<img src="/img/evaluation/sme_instruction_page.png" />
|
|
</Frame>
|
|
|
|
The annotation workflow begins with clear instructions and context, allowing SMEs to understand what they're evaluating and how to provide meaningful feedback.
|
|
|
|
<Frame>
|
|
<img src="/img/evaluation/sme_annotation_page.png" />
|
|
</Frame>
|
|
|
|
The SME interface provides:
|
|
|
|
1. **Clean, focused design**: No technical jargon or complex navigation
|
|
2. **Clear instructions**: Queue-specific guidance displayed prominently
|
|
3. **Structured feedback**: Predefined metrics with clear descriptions
|
|
4. **Progress tracking**: Visual indicators of completion status
|
|
5. **Comment system**: Optional text feedback for additional context
|
|
|
|
### Annotation Workflow
|
|
|
|
1. **Access the queue**: SME clicks the shared link
|
|
2. **Review content**: Examine the trace or thread output
|
|
3. **Provide feedback**: Score using predefined metrics
|
|
4. **Add comments**: Optional text feedback
|
|
5. **Submit and continue**: Move to the next item
|
|
|
|
## Managing Queues programmatically
|
|
|
|
You can create and manage annotation queues programmatically using the Python or TypeScript SDK. This is useful for automating the process of adding items to queues based on specific criteria.
|
|
|
|
### Creating an Annotation Queue
|
|
|
|
<Tabs>
|
|
<Tab value="Python" title="Python">
|
|
|
|
### Creating a Traces Annotation Queue
|
|
|
|
```python
|
|
import opik
|
|
|
|
client = opik.Opik()
|
|
|
|
# Create a traces annotation queue
|
|
queue = client.create_traces_annotation_queue(
|
|
name="High Priority Traces",
|
|
description="Traces that need review",
|
|
instructions="Check for accuracy and completeness",
|
|
feedback_definition_names=["relevance", "accuracy"]
|
|
)
|
|
|
|
print(f"Created queue: {queue.name} (ID: {queue.id})")
|
|
```
|
|
|
|
</Tab>
|
|
<Tab value="TypeScript" title="TypeScript">
|
|
|
|
```typescript
|
|
import { Opik } from "opik";
|
|
|
|
const client = new Opik();
|
|
|
|
// Create a trace annotation queue
|
|
const queue = await client.createTracesAnnotationQueue({
|
|
name: "High Priority Traces",
|
|
description: "Traces that need review",
|
|
instructions: "Check for accuracy and completeness",
|
|
feedbackDefinitionNames: ["relevance", "accuracy"],
|
|
});
|
|
|
|
console.log(`Created queue: ${queue.name} (ID: ${queue.id})`);
|
|
```
|
|
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
### Adding Traces to a Queue
|
|
|
|
<Tabs>
|
|
<Tab value="Python" title="Python">
|
|
|
|
```python
|
|
import opik
|
|
|
|
client = opik.Opik()
|
|
|
|
# Get an existing traces queue
|
|
queue = client.get_traces_annotation_queue("queue-id")
|
|
|
|
# Search for traces and add them to the queue
|
|
traces = client.search_traces(
|
|
project_name="my-project",
|
|
filter_string='feedback_scores.user_frustration > 0.5'
|
|
)
|
|
queue.add_traces(traces)
|
|
|
|
# For a single trace, wrap it in a list
|
|
single_trace = client.get_trace_content("trace-id")
|
|
queue.add_traces([single_trace])
|
|
```
|
|
|
|
</Tab>
|
|
<Tab value="TypeScript" title="TypeScript">
|
|
|
|
```typescript
|
|
import { Opik } from "opik";
|
|
|
|
const client = new Opik();
|
|
|
|
// Get an existing traces queue
|
|
const queue = await client.getTracesAnnotationQueue("queue-id");
|
|
|
|
// Search for traces and add them to the queue
|
|
const traces = await client.searchTraces({
|
|
projectName: "my-project",
|
|
filterString: 'feedback_scores.user_frustration > 0.5',
|
|
});
|
|
await queue.addTraces(traces);
|
|
|
|
// For a single trace, wrap it in an array
|
|
const singleTraceResponse = await client.api.traces.getTraceById("trace-id");
|
|
await queue.addTraces([singleTraceResponse.data]);
|
|
```
|
|
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
### Working with Thread Queues
|
|
|
|
<Tabs>
|
|
<Tab value="Python" title="Python">
|
|
|
|
```python
|
|
import opik
|
|
|
|
client = opik.Opik()
|
|
|
|
# Create a threads annotation queue
|
|
thread_queue = client.create_threads_annotation_queue(
|
|
name="Thread Review Queue",
|
|
description="Threads needing review"
|
|
)
|
|
|
|
# Get threads and add them to the queue
|
|
threads_client = client.get_threads_client()
|
|
important_threads = threads_client.search_threads(
|
|
project_name="my-project",
|
|
filter_string='tags contains "important"'
|
|
)
|
|
thread_queue.add_threads(important_threads)
|
|
```
|
|
|
|
</Tab>
|
|
<Tab value="TypeScript" title="TypeScript">
|
|
|
|
```typescript
|
|
import { Opik } from "opik";
|
|
|
|
const client = new Opik();
|
|
|
|
// Create a thread annotation queue
|
|
const threadQueue = await client.createThreadsAnnotationQueue({
|
|
name: "Thread Review Queue",
|
|
description: "Threads needing review",
|
|
});
|
|
|
|
// Search for threads and add them to the queue
|
|
const threads = await client.searchThreads({
|
|
projectName: "my-project",
|
|
filterString: 'tags contains "important"',
|
|
});
|
|
await threadQueue.addThreads(threads);
|
|
```
|
|
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
### Updating and Deleting Queues
|
|
|
|
<Tabs>
|
|
<Tab value="Python" title="Python">
|
|
|
|
```python
|
|
import opik
|
|
|
|
client = opik.Opik()
|
|
|
|
# Get an existing traces queue
|
|
queue = client.get_traces_annotation_queue("queue-id")
|
|
|
|
# Update queue properties
|
|
queue.update(
|
|
description="Traces that need a thorough review",
|
|
instructions="Check the conversation tone"
|
|
)
|
|
|
|
# Remove traces from the queue
|
|
short_traces = client.search_traces(
|
|
project_name="my-project",
|
|
filter_string='duration < 10'
|
|
)
|
|
queue.remove_traces(short_traces)
|
|
|
|
# Delete the queue
|
|
queue.delete()
|
|
```
|
|
|
|
### Listing Annotation Queues
|
|
|
|
```python
|
|
import opik
|
|
|
|
client = opik.Opik()
|
|
|
|
# Get all traces annotation queues for a project
|
|
traces_queues = client.get_traces_annotation_queues(project_name="my-project")
|
|
|
|
for queue in traces_queues:
|
|
print(f"Traces Queue: {queue.name}, Items: {queue.items_count}")
|
|
|
|
# Get all threads annotation queues for a project
|
|
threads_queues = client.get_threads_annotation_queues(project_name="my-project")
|
|
|
|
for queue in threads_queues:
|
|
print(f"Threads Queue: {queue.name}, Items: {queue.items_count}")
|
|
```
|
|
|
|
</Tab>
|
|
<Tab value="TypeScript" title="TypeScript">
|
|
|
|
```typescript
|
|
import { Opik } from "opik";
|
|
|
|
const client = new Opik();
|
|
|
|
// Get an existing traces queue
|
|
const queue = await client.getTracesAnnotationQueue("queue-id");
|
|
|
|
// Update queue properties
|
|
await queue.update({
|
|
description: "Traces that need a thorough review",
|
|
instructions: "Check the conversation tone",
|
|
});
|
|
|
|
// Remove traces from the queue
|
|
const shortTraces = await client.searchTraces({
|
|
projectName: "my-project",
|
|
filterString: "duration < 10",
|
|
});
|
|
await queue.removeTraces(shortTraces);
|
|
|
|
// Delete the queue
|
|
await queue.delete();
|
|
```
|
|
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
### Listing Annotation Queues
|
|
|
|
<Tabs>
|
|
<Tab value="Python" title="Python">
|
|
|
|
```python
|
|
import opik
|
|
|
|
client = opik.Opik()
|
|
|
|
# Get all traces annotation queues for a project
|
|
traces_queues = client.get_traces_annotation_queues(project_name="my-project")
|
|
|
|
for queue in traces_queues:
|
|
print(f"Traces Queue: {queue.name}, Items: {queue.items_count}")
|
|
|
|
# Get all threads annotation queues for a project
|
|
threads_queues = client.get_threads_annotation_queues(project_name="my-project")
|
|
|
|
for queue in threads_queues:
|
|
print(f"Threads Queue: {queue.name}, Items: {queue.items_count}")
|
|
```
|
|
|
|
</Tab>
|
|
<Tab value="TypeScript" title="TypeScript">
|
|
|
|
```typescript
|
|
import { Opik } from "opik";
|
|
|
|
const client = new Opik();
|
|
|
|
// Get all traces annotation queues for a project
|
|
const tracesQueues = await client.getTracesAnnotationQueues({
|
|
projectName: "my-project",
|
|
});
|
|
|
|
for (const queue of tracesQueues) {
|
|
const itemsCount = await queue.getItemsCount();
|
|
console.log(
|
|
`Queue: ${queue.name}, Scope: ${queue.scope}, Items: ${itemsCount}`
|
|
);
|
|
}
|
|
|
|
// Get all threads annotation queues for a project
|
|
const threadsQueues = await client.getThreadsAnnotationQueues({
|
|
projectName: "my-project",
|
|
});
|
|
|
|
for (const queue of threadsQueues) {
|
|
const itemsCount = await queue.getItemsCount();
|
|
console.log(
|
|
`Queue: ${queue.name}, Scope: ${queue.scope}, Items: ${itemsCount}`
|
|
);
|
|
}
|
|
```
|
|
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
## Learn more
|
|
|
|
You can learn more about Opik's annotation and evaluation features in:
|
|
|
|
1. [Evaluation overview](/v1/evaluation/overview)
|
|
2. [Feedback definitions](/v1/administration/workspace-settings/feedback_definitions)
|