cookbook/06_storage/sqlite/README.md
Examples demonstrating SQLite database integration with Agno agents, teams, and workflows.
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
db = SqliteDb(db_file="path/to/database.db")
agent = Agent(
db=db,
add_history_to_context=True,
)
Agno also supports using your SQLite database asynchronously, via the AsyncSqliteDb class:
from agno.agent import Agent
from agno.db.sqlite import AsyncSqliteDb
db = AsyncSqliteDb(db_file="path/to/database.db")
agent = Agent(
db=db,
add_history_to_context=True,
)
sqlite_for_agent.py - Agent with SQLite storagesqlite_for_team.py - Team with SQLite storagesqlite_for_workflow.py - Workflow with SQLite storage