Back to Agno

SQLite Integration

cookbook/06_storage/sqlite/README.md

2.6.4871 B
Original Source

SQLite Integration

Examples demonstrating SQLite database integration with Agno agents, teams, and workflows.

Configuration

python
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,
)

Async usage

Agno also supports using your SQLite database asynchronously, via the AsyncSqliteDb class:

python
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,
)

Examples