Teams with Memory

Store and recall user-specific memories across team runs.

Set update_memory_on_run=True to run MemoryManager on every team run. Automatic extraction can create, update, and delete user memories based on the latest input. It does not expose clearing all memories; the manager's delete/clear flags control the separate agentic path, not automatic extraction.

Install dependencies and set your key before running the examples:

pip install agno openai sqlalchemy
export OPENAI_API_KEY="your-api-key"
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.models.openai import OpenAIResponses
from agno.team import Team

db = SqliteDb(db_file="agno.db")
user_id = "john_doe@example.com"

member = Agent(model=OpenAIResponses(id="gpt-5.2"))

team_with_memory = Team(
    name="Team with Memory",
    model=OpenAIResponses(id="gpt-5.2"),
    members=[member],
    db=db,
    update_memory_on_run=True,
)

team_with_memory.print_response("Hi! My name is John Doe.", user_id=user_id)
team_with_memory.print_response("What is my name?", user_id=user_id)

Developer Resources