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