Quick Start
How It Works
SQLite stores conversation data in tables within a single file:| Table | Content | Purpose |
|---|---|---|
sessions | Session metadata | Track conversation sessions |
messages | User and agent messages | Complete conversation history |
runs | Agent execution runs | Track agent processing steps |
tool_calls | Tool usage | Record function calls and results |
Configuration Options
Database URL Format
Advanced Configuration
Session Resume Example
Direct Database Access
For advanced use cases, query the SQLite database directly:Production Considerations
File Permissions and Location
File Permissions and Location
- Ensure the application has write permissions to the database directory
- Use absolute paths for production deployments
- Consider using environment variables for database paths
- Back up the .db file regularly
Concurrent Access
Concurrent Access
- SQLite supports multiple readers but only one writer
- Use WAL mode for better concurrency:
PRAGMA journal_mode=WAL - Consider connection pooling for multi-threaded applications
- For high concurrency, migrate to PostgreSQL or MySQL
Database Maintenance
Database Maintenance
- Monitor database file size growth
- Use
VACUUMperiodically to reclaim space - Implement log rotation for old conversations
- Set up automated backups of the .db file
Migration Path
Migration Path
- Start with SQLite for development and MVP
- SQLite can handle thousands of conversations efficiently
- Migrate to PostgreSQL when you need multi-instance deployment
- Export data using SQL dumps for migration
Related
PostgreSQL Persistence
Scale up to production PostgreSQL when you outgrow SQLite
Database Persistence Overview
Compare all available persistence backends

