Skip to main content
Async conversation stores provide non-blocking persistence for conversation sessions and messages, enabling high-performance multi-agent systems.
The user resumes a long chat; the async store loads session history without blocking other agents on the same event loop.

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 use async with for automatic resource management:

Upsert Session Helper

Use the built-in upsert_session() method for create-or-update operations:

Custom Async Store Implementation

When implementing a custom async store, inherit from AsyncConversationStore:
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.

Session export / import

PraisonAIDB.aexport_session / aimport_session give async callers a native await path against an async store (PR #5380):
From a sync caller you can still use db.export_session(...) / db.import_session(...) — since PR #5380 they dispatch correctly against an async store instead of leaking un-awaited coroutines. The async twins are for code already running inside an event loop.

Best Practices

The async context manager ensures proper resource cleanup:
The orchestrator uses isinstance() checks to dispatch correctly:
Use either sync or async consistently:

Breaking Change in PR #1829: The async_* prefixed methods have been removed from async stores:
Update your code to use the non-prefixed async methods.

Async DB Hooks

Event-driven persistence hooks for async stores

Persistence Overview

Architecture and backend options