Quick Start
1
Use Built-in Async Store
Use a built-in async conversation store with automatic resource management:
2
Implement Custom Async Store
Create a custom async store by inheriting from
AsyncConversationStore:How It Works
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:
Fixed in PR #3588 (
0ba6829). When an AsyncConversationStore was wired into a sync agent through PersistenceOrchestrator, the very first create_session call was silently dropped — the sync helper was calling the async store.create_session(...) and discarding the returned coroutine. The orchestrator now passes an explicit create_session= dispatcher that routes the coroutine through _sync, so the session row is written on the first turn regardless of whether your store is sync or async. Custom AsyncConversationStore subclasses need no code changes.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

