Memory with SQLite
Code
1from kern.agent import Agent2from kern.db.sqlite import SqliteDb34# Setup the SQLite database5db = SqliteDb(db_file="tmp/data.db")67# Setup a basic agent with the SQLite database8agent = Agent(9 db=db,10 update_memory_on_run=True,11)1213agent.print_response("My name is John Doe and I like to play basketball on the weekends.")14agent.print_response("What's do I do in weekends?")Usage
Set up your virtual environment
1uv venv --python 3.122source .venv/bin/activate1uv venv --python 3.122.venv\Scripts\activateSet environment variables
1export OPENAI_API_KEY=xxxInstall dependencies
1uv pip install -U kern-ai openaiRun Example
1python mem-sqlite-memory.py1python mem-sqlite-memory.py