mem0
Drop-in memory layer that extracts salient facts from agent conversations and serves them back as personalized context across sessions, users, and agents.
Description
Mem0 is a managed and open-source memory layer for AI agents that turns ongoing conversations into a stored set of user facts, preferences, and episodes which the agent can search on subsequent turns. The agent sends raw messages to `add`; an LLM extracts salient items, deduplicates them against prior memory, and writes them to a vector store scoped by `user_id`, `agent_id`, or `run_id`. On later turns the agent calls `search` to retrieve the most relevant memories instead of replaying the full chat history. The project ships Python and TypeScript SDKs plus a hosted platform, and is described in the paper 'Mem0: Building Production-Ready AI Agents with Scalable Long-Term Memory'.
Solution
Sidecar memory loop wrapped around an external agent. On every user turn the agent calls `mem0.search(query, user_id)` to retrieve relevant prior memories and injects them into the LLM prompt; after the turn the agent calls `mem0.add(messages, user_id)` which sends the messages through an extraction LLM that derives facts, resolves conflicts against existing memories, and writes the survivors to managed vector storage. Memory operations are add / search / update / delete; identity is keyed by user_id, agent_id, or run_id.
Primary use cases
- persistent user memory across sessions
- personalized assistants that learn preferences over time
- reducing prompt bloat and token cost on long conversations
- cross-agent shared memory in multi-agent systems
Open the full interactive page →
Diagram, neighbourhood map, code examples, related patterns and full provenance.