Quick Start
How It Works
| Component | Purpose | Example backends |
|---|---|---|
| ConversationStore | Messages, sessions, metadata | SQLite, PostgreSQL, MySQL |
| StateStore | Application state, key-value data | Redis, MongoDB |
| DefaultSessionStore | File-based sessions | JSON files on disk |
Storage Backend Options
The registry supports 12 conversation, 9 state, and 20 knowledge backends — configure each store by URL scheme.- Conversation
- State
- Knowledge
| Backend | Aliases | Best for |
|---|---|---|
sqlite | — | Local development, single instance |
sync_sqlite | sqlite_sync | Synchronous file access |
async_sqlite | aiosqlite, sqlite_async | Async file access |
postgres | neon, cockroachdb, crdb, cockroach, xata | Production SQL |
async_postgres | asyncpg, postgres_async | Async Postgres |
mysql | — | Existing MySQL infrastructure |
async_mysql | aiomysql, mysql_async | Async MySQL |
turso | libsql | Serverless SQLite over the network |
supabase | — | Managed Postgres platform |
singlestore | — | Distributed SQL |
surrealdb | — | Multi-model database |
json | — | Zero-dependency file storage |
SQLite
Local file database for development and single-instance apps
PostgreSQL
Production SQL with JSONB and connection pooling
MySQL
Popular SQL database with broad tooling support
Redis
Fast in-memory state store
MongoDB
Flexible document store for complex state
ClickHouse
Analytics database for large-scale data
JSON Files
Simple file-based storage with cross-platform locking
The registry is the authoritative list, not the docs. Call
list_available_backends() at runtime to discover the current set:Backend Aliases
Configure with either name — the registry resolves aliases before instantiating the factory (PraisonAI PR #2669).| Alias | Resolves to | Store |
|---|---|---|
neon, xata, cockroachdb, crdb, cockroach | postgres | Conversation |
asyncpg, postgres_async | async_postgres | Conversation |
aiomysql, mysql_async | async_mysql | Conversation |
sqlite_sync | sync_sqlite | Conversation |
aiosqlite, sqlite_async | async_sqlite | Conversation |
libsql | turso | Conversation |
motor, mongodb_async | async_mongodb | State |
mongodb_atlas, mongo_vector | mongodb_vector | Knowledge |
chromadb | chroma | Knowledge |
cosmos, azure_cosmos, cosmosdb_vector | cosmosdb | Knowledge |
llama_index, llamaindex_adapter | llamaindex | Knowledge |
langchain_adapter | langchain | Knowledge |
PersistenceConfig(state_store="motor").validate() now succeeds and resolves to AsyncMongoDBStateStore. Unknown names still fail loudly, listing the current registry backends.
Configuration Options
| Parameter | Description |
|---|---|
database_url | Conversation store URL |
state_url | State / run history store |
knowledge_url | Vector or knowledge store |
Database backends require the
praisonai wrapper (pip install praisonai). The core SDK defines DbAdapter; implementations live in praisonai.persistence.Best Practices
Choose the right backend
Choose the right backend
SQLite for development; PostgreSQL or MySQL for multi-user production; Redis for fast state; JSON files for minimal dependencies.
Use meaningful session IDs
Use meaningful session IDs
Set
session_id="user-123" so conversations resume reliably across restarts.Read credentials from the environment
Read credentials from the environment
Never hardcode database URLs — use
os.getenv("PRAISON_CONVERSATION_URL").Separate stores by concern
Separate stores by concern
Conversation history, run traces, and vectors scale differently — configure each URL independently.
Related
Database Persistence (Advanced)
MemoryConfig, CLI commands, and Docker setup
Session Persistence
JSON file sessions without a database

