Supported Databases
| Database | Import | Best For |
|---|---|---|
| PostgreSQL | from agno.db.postgres import PostgresDb | Production, teams |
| SQLite | from agno.db.sqlite import SqliteDb | Local development |
| MongoDB | from agno.db.mongodb import MongoDb | Document stores |
| Redis | from agno.db.redis import RedisDb | Caching, speed |
| DynamoDB | from agno.db.dynamodb import DynamoDb | AWS serverless |
| Firestore | from agno.db.firestore import FirestoreDb | GCP serverless |
| MySQL | from agno.db.mysql import MysqlDb | MySQL users |
| SingleStore | from agno.db.singlestore import SingleStoreDb | Real-time |
| SurrealDB | from agno.db.surrealdb import SurrealDb | Multi-model |
| GCS | from agno.db.gcs import GCSDb | Cloud storage |
| JSON | from agno.db.json import JsonDb | Simple files |
| In-Memory | from agno.db.memory import InMemoryDb | Testing |
Examples by Database
PostgreSQL
Production-ready persistence.cookbook/06_storage/postgres/postgres_for_agent.py
SQLite
Simple local persistence.cookbook/06_storage/sqlite/sqlite_for_agent.py
MongoDB
Document-based storage.cookbook/06_storage/mongo/mongodb_for_agent.py
Redis
High-speed caching.cookbook/06_storage/redis/redis_for_agent.py
DynamoDB
AWS serverless storage.cookbook/06_storage/dynamodb/dynamo_for_agent.py
Firestore
GCP serverless storage.cookbook/06_storage/firestore/firestore_for_agent.py
In-Memory
For testing and development.cookbook/06_storage/in_memory/in_memory_storage_for_agent.py
Storage for Teams and Workflows
Storage works the same way for teams and workflows.Team Storage
cookbook/06_storage/postgres/postgres_for_team.py
Workflow Storage
cookbook/06_storage/postgres/postgres_for_workflow.py