Agno v1; How to implement memory and storage for Team?

I am working on Agno v1.8.5 (shifting to v2 could break my project).

I implemented a Team, which has control of 2 other teams (each with 3 agents) and one other agent. In my Team code, I had this

db_file = "tmp/orchestrator.db"
memory = Memory(
    model=config.GEMINI_,
    db=SqliteMemoryDb(table_name="orchestrator", db_file=db_file),
)
storage = SqliteStorage(table_name="agent_sessions", db_file=db_file)

and I had the following params to my Team

memory=memory
storage=storage
add_session_summary_references=True
enable_session_summaries=True
enable_team_history=True

Now, the good part is I am getting a db named “agent_sessions” that has the messages on each runs, token sizes and duration, etc based off of user_id and session_id… But memory isn’t working. Do I tweak my parameters? Or is it related to the initialization of memory itself? I need serious help here.

Hi @TheMaster24, thanks for reaching out and supporting Agno. I’ve shared this with the team, we’re working through all requests one by one and will get back to you soon.If it’s urgent, please let us know. We appreciate your patience!

Hey @TheMaster24
Thanks for reaching out! I see the issue with your memory configuration. There are a few things that need to be corrected:

1. Wrong class names:

  • Memory → should be MemoryManager

  • SqliteMemoryDb → should be SqliteDb

2. Wrong parameter name:

  • memory=memory → should be memory_manager=memory_manager

3. Missing flag:

  • You need enable_user_memories=True to actually create memories

Corrected code:

from agno.db.sqlite import SqliteDb

from agno.memory import MemoryManager

db_file = “tmp/orchestrator.db”

db = SqliteDb(db_file=db_file)

memory_manager = MemoryManager(

model=config.GEMINI\_,

db=db,

)

team = Team(

*# ... your other params*

db=db,

memory_manager=memory_manager,  *# NOT memory=memory*

enable_user_memories=True,       *# Required to create memories*

add_memories_to_context=True,    *# Optional: include memories in context*

enable_session_summaries=True,

add_session_summary_to_context=True,

enable_team_history=True,

)

Memory modes available:

  • enable_user_memories=True - Automatically extracts and stores memories after each run

  • enable_agentic_memory=True - Gives the agent tools to actively manage memories during run