BAI-LAB/MemoryOS

[EMNLP 2025 Oral] MemoryOS is designed to provide a memory operating system for personalized AI agents.

What it solves

MemoryOS addresses the challenge of maintaining coherent, personalized, and context-aware interactions in AI agents over long periods. It prevents agents from "forgetting" user preferences and historical context by providing a structured way to manage short, mid, and long-term memories.

How it works

Inspired by operating system memory management, it uses a hierarchical storage architecture consisting of four core modules:

  1. Storage: Organizes memory into layers (short-term, mid-term, and long-term).
  2. Updating: Automatically promotes information between layers. For example, when short-term memory fills up, it is consolidated into mid-term memory. If mid-term segments become "hot" (frequently accessed), they are analyzed to update the long-term user profile and knowledge base.
  3. Retrieval: Fetches relevant context from all memory layers based on the current query.
  4. Generation: Combines the retrieved context with the user query to produce an informed response via an LLM.

Who it’s for

  • Developers building personalized AI agents that require long-term memory.
  • AI researchers focusing on memory management and agent coherence.
  • Users of AI clients like Claude Desktop, Cline, or Cursor who want to inject persistent memory capabilities via the MCP (Model Context Protocol) server.

Highlights

  • Hierarchical Memory: Manages short-term, mid-term, and long-term persona memory with automated profile updating.
  • Plug-and-Play Architecture: Supports interchangeable storage engines, update strategies, and retrieval algorithms.
  • MemoryOS-MCP: Allows seamless integration of memory tools (add, retrieve, and profile fetching) into various agent clients.
  • Broad Compatibility: Works with multiple LLMs (OpenAI, Deepseek, Qwen) and supports vector databases like ChromaDB.
  • Proven Performance: Demonstrated significant improvements in F1 and BLEU-1 scores on the LoCoMo benchmark.