Disclosure: I'm Mohammed, founder of MemorySync. I drafted this with AI assistance and checked it against Agno's official migration guide and a real install. Code status: on Oct 25, 2026 I installed agno 3.1.10 (Python 3.13) and reproduced the errors below. I then ran the "after" imports, the Agent construction and get_user_memories successfully. No model was called (no key), so memory creation itself was not run.
The error
You upgrade Agno and memory code that used to work fails on import:
ModuleNotFoundError: No module named 'agno.memory.v2'
or, in VS Code / Pylance:
Import "agno.memory.v2.memory" could not be resolved
often with a companion:
ModuleNotFoundError: No module named 'agno.storage'
This was reported in agno-agi/agno#5017 (Agno 2.1.4, Python 3.11). The maintainers' answer was to follow the memory section of the v2 migration guide. I reproduced all three errors on Agno 3.1.10:
$ python -c "from agno.memory.v2.memory import Memory"
ModuleNotFoundError: No module named 'agno.memory.v2'
$ python -c "from agno.storage.sqlite import SqliteStorage"
ModuleNotFoundError: No module named 'agno.storage'
Why it happens
Agno v2 removed the v1 memory and storage modules rather than aliasing them. Per the v2 migration guide:
-
Storageclasses moved fromagno/storagetoagno/dband are now calledDbclasses. One instance serves agents, teams and workflows, and themodeandtable_nameparameters are gone. - The
MemoryDbclasses are deprecated in favour of the mainDbclasses. - The
Memoryclass is deprecated. You setupdate_memory_on_run=Trueon an Agent that has adb.
The fix: before and after
v1 (breaks):
from agno.agent import Agent
from agno.memory.v2.db.sqlite import SqliteMemoryDb
from agno.memory.v2.memory import Memory
from agno.storage.sqlite import SqliteStorage
memory = Memory(db=SqliteMemoryDb(table_name="user_memories", db_file="agno.db"))
storage = SqliteStorage(table_name="agent_sessions", db_file="agno.db")
agent = Agent(memory=memory, storage=storage, enable_user_memories=True)
v2+ (ran on 3.1.10):
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
db = SqliteDb(db_file="agno.db") # sessions AND memories
agent = Agent(db=db, update_memory_on_run=True)
print(agent.get_user_memories(user_id="john@example.com")) # [] until a run stores something
Things to check after the swap:
-
Pass
user_idon every run. Memories are stored per user, so a missing or changinguser_idlooks like "memory isn't stored". -
Table names. If you need your old table names,
SqliteDbtakessession_table=andmemory_table=instead oftable_name=. -
Custom memory model or instructions. Build a
MemoryManager(from agno.memory import MemoryManager) and passmemory_manager=to the Agent. The parameter names I found on the currentAgentarememory_manager,enable_agentic_memory,update_memory_on_runandadd_memories_to_context. - Existing v1 data. The migration guide links a v1-to-v2 migration script. It says to use the script from the v2 release matching your environment and not to run it under Agno v3, so migrate to v2 first, verify, then upgrade. Back up your database before running anything against it.
-
TypeError: UserMemory.__init__() got an unexpected keyword argument 'summaries'. This is a different, older error from mixed v1 memory data (#2955, Agno 1.4.1). The reporter confirmed it was gone after the maintainers' follow-up, so upgrade first.
If you get ImportError: The SQLAlchemy asyncio module requires that the Python 'greenlet' library is installed when importing agno.db.sqlite, run pip install greenlet. I hit this on a clean Python 3.13 venv.
If you want memories outside the local database
update_memory_on_run writes to whatever Db you pass. If you want sessions to stay local but user memories to live in a hosted store shared across instances, MemorySync's agno-memorysync package backs Agno's MemoryManager (guide). The guide says it needs agno 2.8+, and this constructed fine on 3.1.10:
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.memory import MemoryManager
from agno_memorysync import MemorySyncDb # pip install agno-memorysync; needs MEMORYSYNC_API_KEY
agent = Agent(
db=SqliteDb(db_file="agent.db"), # sessions: local
memory_manager=MemoryManager(db=MemorySyncDb()), # memories: hosted
update_memory_on_run=True,
user_id="customer-42",
)
The guide notes that MemorySyncDb is memory-only on purpose. Pointing sessions at it raises MemorySyncMemoryOnlyError, so keep db= local.
Common questions
Is there a compatibility shim for agno.memory.v2? Not in 3.1.10. The import fails. Update the imports.
Do I still need a separate storage object? No. One Db instance handles sessions, memories, metrics, evals and knowledge in separate tables.
My memories are stored but never show up in replies. If you pass a verbatim system_message=, it replaces Agno's built system prompt, which is where memories are injected. Use instructions= instead. (This tip is from MemorySync's Agno guide and applies to any memory db.)
Which Agno version is current? PyPI served 3.1.10 on Oct 25, 2026. The v2 migration steps above still applied to it.
To see a stored fact survive a reload before wiring anything in: try MemorySync in your browser. No signup is needed.
Sources
- agno-agi/agno#5017 (the import error): https://github.com/agno-agi/agno/issues/5017
- agno-agi/agno#2955 (
summariesTypeError): https://github.com/agno-agi/agno/issues/2955 - Agno v2 migration guide: https://docs.agno.com/other/v2-migration
- Agno, Agent with Memory: https://docs.agno.com/memory/agent/agent-with-memory
- MemorySync Agno guide: https://docs.memorysync.io/guides/agno
Top comments (0)