Creating threads
Thread status
Threads have a status that reflects their current state:The snippets below assume you are inside an
async def function with an initialized client — see the example above.Getting thread state
The state contains the current values of all state fields, information about what nodes will execute next, and any pending interrupts.Updating thread state
You can modify thread state directly, for example to inject data or correct values:Checkpoint history
Every state change creates a checkpoint. You can browse the full history:Get state at a specific checkpoint
Searching threads
Find threads by status or metadata:Listing threads
Deleting threads
Deleting a thread cancels any active runs and removes all state, including the checkpoint history stored in the graph backend:Thread metadata
Threads automatically track metadata about their usage:owner: User identity at creation time (mirrorsuser_idon the Thread object, which is used for access control)assistant_id: Last assistant usedgraph_id: Last graph executed