AsyncSqliteDb class.
Usage
Install thesqlalchemy, aiosqlite, and openai packages:
uv pip install sqlalchemy aiosqlite openai
async_sqlite_for_agent.py
from agno.agent import Agent
from agno.db.sqlite import AsyncSqliteDb
# Setup the SQLite database
db = AsyncSqliteDb(db_file="tmp/data.db")
# Setup a basic agent with the SQLite database
agent = Agent(db=db)
Params
| Parameter | Type | Default | Description |
|---|---|---|---|
id | Optional[str] | - | The ID of the database instance. UUID by default. |
db_engine | Optional[AsyncEngine] | - | The SQLAlchemy async database engine to use. |
db_url | Optional[str] | - | The database URL to connect to. |
db_file | Optional[str] | - | The database file to connect to. |
session_table | Optional[str] | - | Name of the table to store Agent, Team and Workflow sessions. |
memory_table | Optional[str] | - | Name of the table to store user memories. |
metrics_table | Optional[str] | - | Name of the table to store metrics. |
eval_table | Optional[str] | - | Name of the table to store evaluation runs data. |
knowledge_table | Optional[str] | - | Name of the table to store knowledge documents data. |
culture_table | Optional[str] | - | Name of the table to store cultural knowledge. |
traces_table | Optional[str] | - | Name of the table to store traces. |
spans_table | Optional[str] | - | Name of the table to store spans. |
versions_table | Optional[str] | - | Name of the table to store schema versions. |
learnings_table | Optional[str] | - | Name of the table to store learnings. |
schedules_table | Optional[str] | - | Name of the table to store cron schedules. |
schedule_runs_table | Optional[str] | - | Name of the table to store schedule run history. |
approvals_table | Optional[str] | - | Name of the table to store human approval requests. |
auth_tokens_table | Optional[str] | - | Name of the table to store OAuth tokens for external services. |
service_accounts_table | Optional[str] | - | Name of the table to store service accounts. |