Quick Start
How It Works
Database Backends
- SQLite
- PostgreSQL
- MySQL
- Redis
- MongoDB
- ClickHouse
- JSON Files
Zero external dependencies, file-based storage:Prerequisites: None (built into Python)
Configuration Options
ManagedAgent API Reference
Complete ManagedAgent configuration options
PraisonDB Reference
Database adapter configuration options
| Component | Purpose | Key Parameters |
|---|---|---|
ManagedAgent | Anthropic execution backend | provider, config, api_key, timeout |
ManagedConfig | Agent definition | model, system, tools, packages |
PraisonDB | Database adapter | database_url, state_url, analytics_url |
DbSessionAdapter | Session bridge | Auto-configured based on database URL |
Common Patterns
Session Resume Pattern
Session Resume Pattern
The most common pattern for persistent managed agents:
Multi-Backend Pattern
Multi-Backend Pattern
Use different backends for different data types:
Session ID Management
Session ID Management
Best practices for session identification:
Best Practices
Session Management
Session Management
- Use meaningful session IDs (user-based, not random)
- Implement session rotation for long conversations
- Store session metadata for debugging
- Handle concurrent access with proper locking
Database Selection
Database Selection
- SQLite: Development, single-user apps, file-based persistence
- PostgreSQL: Production apps, complex queries, ACID compliance
- MySQL: Existing MySQL infrastructure, compatibility requirements
- Redis: High-speed state, session caching, temporary data
- MongoDB: Document-based state, flexible schemas
- ClickHouse: Analytics, large-scale logging, data warehousing
- JSON Files: Prototyping, zero dependencies, simple use cases
Performance Optimization
Performance Optimization
- Use connection pooling for database connections
- Implement message compaction for long sessions
- Cache frequently accessed session data
- Use async database operations when possible
- Monitor database performance metrics
Error Handling
Error Handling
- Implement retry logic for transient database failures
- Handle session corruption gracefully
- Log database errors for debugging
- Provide fallback behavior when persistence fails
- Test database connection before agent creation
Related
Database Persistence
Traditional Agent persistence patterns
Session Management
Advanced session handling techniques

