SQLiteDb class provides SQLite storage for agents, sessions, memories, and more. It’s perfect for development, testing, and lightweight deployments.
Constructor
Parameters
Path to the SQLite database file.
If True, automatically creates required tables.
Name of the sessions table.
Name of the memories table.
Name of the knowledge table.
Name of the metrics table.
Methods
Inherits all methods fromBaseDb.
close()
Close database connections.Example Usage
Configuration
Custom Database Location
Custom Table Names
In-Memory Database
Best Practices
- Close connections: Call
db.close()when shutting down - Use for development: SQLite is great for development and small deployments
- PostgreSQL for production: Use PostgreSQL for production workloads
- Backup regularly: SQLite is just a file - back it up regularly
- One writer at a time: SQLite doesn’t handle concurrent writes well
Limitations
- Limited concurrency (single writer)
- Not suitable for high-traffic production deployments
- No built-in replication
- Use PostgreSQL for production environments