mem0

A memory layer for AI apps that keeps growing on its own

What it is

mem0 is an open-source memory layer for LLM applications and agents, built to fix the problem of every conversation starting from zero. It extracts durable facts from conversations, documents and tool results into structured memories, writes them into a vector store plus a graph store, and retrieves them semantically in later sessions so an app can remember user preferences, past decisions and work already done. Memory is scoped across user, session and agent levels, with conflict resolution and expiry so stale facts do not slowly poison the context window. The project ships Python and TypeScript SDKs and can be plugged into clients such as Claude and Cursor over MCP. You can use the hosted platform to avoid operations work, or self-host and keep the data in your own store. As of October 2026 the repository has roughly 67,000 stars, is mainly Python and is licensed under Apache-2.0.

Highlights

  • Memory scoped across user, session and agent levels so contexts do not bleed
  • Vector search combined with a graph store answers follow-ups that involve relationships
  • Python and TypeScript SDKs plus MCP support for direct client integration
  • Self-hostable, keeping data and vectors in your own store
  • Built-in conflict resolution and expiry stop the context window degrading
  • Apache-2.0 licensed with no extra restrictions on commercial use

How to use

On the Python side, pip install mem0ai, create a Memory instance, use add to write conversations or documents and search to retrieve relevant memories, then splice the results into your system prompt. The TypeScript package mirrors the same interface. If you want control over storage, configure your vector and graph databases and run the self-hosted service; otherwise take an API key from the hosted platform and skip the operations. To plug into Claude or Cursor, enable the MCP server it provides and the client handles memory reads and writes itself. Before production, decide on memory scope and retention periods, because cleaning up six months later is expensive.

License

Released under Apache-2.0. Read the terms before commercial use or redistribution, especially if you plan to offer it as a service.