Documentation Index
Fetch the complete documentation index at: https://agno-v2-rbac-doc-update.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Code
from agno.agent import Agent
from agno.db.postgres import PostgresDb
# Setup Postgres
db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai"
db = PostgresDb(db_url=db_url)
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
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activate
Set environment variables
export OPENAI_API_KEY=xxx
Install dependencies
uv pip install -U agno openai sqlalchemy 'psycopg[binary]'
Run Example
python mem-postgres-memory.py