Skip to main content

Code

mem-sqlite-memory.py
from agno.agent import Agent
from agno.db.sqlite import SqliteDb

# Setup the SQLite database
db = SqliteDb(db_file="tmp/data.db")

# Setup a basic agent with the SQLite database
agent = Agent(
    db=db,
    update_memory_on_run=True,
)

agent.print_response("My name is John Doe and I like to play basketball on the weekends.")
agent.print_response("What's do I do in weekends?")

Usage

1

Set up your virtual environment

uv venv --python 3.12
source .venv/bin/activate
2

Set environment variables

export OPENAI_API_KEY=xxx
3

Install dependencies

uv pip install -U agno openai
4

Run Example

python mem-sqlite-memory.py