Skip to main content
Use Cases
  • Viewing all turns of a multi-turn conversation as a single trace in observability.
  • Debugging agent workflows by inspecting the full request sequence end-to-end.
  • Organizing support conversations to analyze resolution patterns across sessions.
  • Separating concurrent conversations from the same user to avoid mixing traces.

Group related requests into conversation Threads so they appear together in observability. Threads are a labeling mechanism and do not store or inject message history.

Quick Start

Configuration

ParameterTypeRequiredDescription
idstringYesUnique thread identifier for grouping requests
tagsstring[]NoMetadata tags for filtering and categorization

Best Practices

  1. Consistent Naming: Use predictable thread ID patterns
  2. Meaningful Tags: Choose tags that aid in filtering and analysis
  3. Session Management: Tie thread IDs to user sessions
  4. Unique IDs: Use UUIDs or composite keys to avoid cross-session overlap

Use Cases

ScenarioThread ID StrategyTags Example
User Sessionsuser-{userId}-{sessionId}["user-session", "support"]
Support Ticketsticket-{ticketId}["support", "priority-high"]
A/B Testingtest-{variant}-{userId}["experiment", "variant-a"]
Multi-Step Workflowsworkflow-{processId}["onboarding", "step-2"]

Implementation Examples

Session-Based Threading

Assign the same thread.id to all requests in a session to group them together in observability. Your application manages the messages array for each request.

Multi-Language Support

Advanced Patterns

Dynamic Thread Management

Batch Thread Processing

Conversation Flow Tracking

Troubleshooting

IssueCauseSolution
Requests not grouping togetherDifferent thread IDs used across requestsUse a consistent thread ID for all requests in the same session or workflow
Thread overlapNon-unique thread IDs shared across sessionsUse UUID or timestamp-based IDs