Quick Start
Use Built-in Async Store
Use a built-in async conversation store with automatic resource management:
How It Works
| Component | Role |
|---|---|
| Agent | Initiates conversation requests |
| Orchestrator | Routes requests based on store type using isinstance() |
| AsyncConversationStore | Handles async persistence operations |
| Database | Stores session and message data |
Configuration Options
AsyncConversationStore API Reference
Complete method signatures and configuration options
Common Patterns
Context Manager Usage
Always useasync with for automatic resource management:
Upsert Session Helper
Use the built-inupsert_session() method for create-or-update operations:
Custom Async Store Implementation
When implementing a custom async store, inherit fromAsyncConversationStore:
Best Practices
Always Use async with Context Manager
Always Use async with Context Manager
The async context manager ensures proper resource cleanup:
Inherit AsyncConversationStore for Custom Stores
Inherit AsyncConversationStore for Custom Stores
The orchestrator uses
isinstance() checks to dispatch correctly:Don't Mix Sync and Async APIs
Don't Mix Sync and Async APIs
Use either sync or async consistently:
Related
Async DB Hooks
Event-driven persistence hooks for async stores
Persistence Overview
Architecture and backend options

