If you are running multi-user Agno agents, you need to check your memory configuration immediately. A critical flaw in agno-agi/agno issue #9983 reveals that the clear_memory tool provided by MemoryManager calls db.clear_memories() without filtering by user_id. This means one user's request to clear their memory can wipe the entire database, deleting the context and preferences of every other user on the system. As of October 26, 2026, this bug persists in the latest PyPI release, agno 3.1.10.

The Scope of the Bug

The issue lies in how MemoryManager constructs its toolset. While add_memory, update_memory, and delete_memory correctly pass the current user_id, clear_memory does not. The underlying clear_memories() function is designed to delete the whole memories table across all supported database drivers, including SQLite, PostgreSQL, MySQL, and MongoDB. A proposed fix, PR #9986, attempts to route the tool through clear_user_memories(user_id=...), but it remains open and unmerged. Until that patch lands, any agent with clear_memories=True in its MemoryManager configuration is vulnerable to accidental global wipes.

Mitigation Strategies

For developers who cannot wait for the upstream fix, there are two primary mitigation paths. First, audit your flags: ensure clear_memories is set to False in your MemoryManager initialization, which is the default but can be overridden. If you need users to delete their own data, use delete_memories=True instead, which scopes the action to the current user. Second, implement a hard guard by subclassing your database class. By overriding clear_memories() to raise a RuntimeError, you can prevent the global wipe entirely while still allowing clear_user_memories() to function correctly for scoped deletions.

Alternative Backends

Third-party memory layers like MemorySync offer a different approach by decoupling memory storage from the agent's local database. In the MemorySync Agno guide, the MemorySyncDb class explicitly raises an error when clear_memories() is called, forcing developers to use the scoped forget_user_memories(user_id) method. This design prevents the ambiguous global wipe by default. However, note that MemorySyncDb is strictly for memory management; pointing sessions or knowledge bases at it will result in a MemorySyncMemoryOnlyError.

Key Takeaways

  • The bug exists in agno 3.1.10 and affects all major database backends.
  • clear_memory tool calls db.clear_memories(), which is unscoped by default.
  • Set clear_memories=False in MemoryManager to disable the dangerous tool.
  • Use MemoryManager.clear_user_memories(user_id=...) for safe, scoped deletion.
  • A subclassing guard can forcibly disable global clears in production code.

The Bottom Line

Agno's default safety mechanisms are insufficient for shared multi-user environments until PR #9986 merges. Until then, developers must explicitly disable global clear tools or implement database-level guards to prevent catastrophic data loss.