What are Threads?
Threads allow you to maintain stateful conversation context across multiple runs within a deployment. Each thread is scoped to a single deployment and tracks conversation history, state, and checkpoints. This is modeled after LangGraph’s Threads API and works with CrewAI, LangGraph Python, and LangGraph JS frameworks.Key Concepts
- Thread: A stateful conversation context scoped to a deployment
- Thread State: JSON values representing the current conversation state
- Checkpoints: Historical snapshots of thread state after each run
- Thread Status:
idle(ready),busy(running),interrupted, orerror
Creating a Thread
Running in a Thread
When you create a run in a thread context, the runner receives the thread state and can update it after completion.Concurrency
Only one run can execute in a thread at a time. If a thread isbusy, new run requests will be rejected with a 409 status. Wait for the current run to complete before starting a new one.