Skip to main content

Overview

Sessions work as both sync and async context managers. The API is identical — use async with instead of with.

Usage

Thread safety

Sessions use Python’s contextvars, which are natively async-safe. Each async task sees its own active session — no locking required.
Each session is isolated — agent-1’s trace never leaks into agent-2.