MemOS Documentation

repository·main·Indexed 27 days ago

https://github.com/memtensor/memos

A Memory Operating System for LLMs and AI agents providing a unified, graph-based API for long-term memory management, multi-modal support, and composable knowledge bases. Includes documentation for the MemOS Cloud OpenClaw Plugin and the MemOS OpenClaw Memory Plugin for persistent local conversation memory, semantic indexing, and task summarization.

Tokens
267.3K
Snippets
474
Records
1.3K
Agent score
94%

What's inside MemOS

  1. Overview of MemOS Open-Source REST API

    main

    MemOS is a high-performance REST API service built with FastAPI that provides memory capabilities for LLM and AI agents. It uses a Component + Handler architecture to support memory extraction, semantic search, and asynchronous scheduling.

    Core Capabilities

    • Multidimensional memory production: Convert conversations, text, or documents into structured memories using AddHandler.
    • Physical isolation with MemCube: Use Cube IDs to isolate data and indexes across different users or knowledge bases.
    • End-to-end chat loop: Orchestrate retrieval, generation, and asynchronous storage using ChatHandler.
    • Asynchronous task scheduling: Use the MemScheduler engine to manage large memory-production workloads and track task status.
    • Self-correction workflow: Correct or mark stored memories using natural language via feedback endpoints.
  2. Overview of MemOS (Memory Operating System)

    main

    MemOS is a Python package designed to provide a unified memory layer for LLM-based applications. It treats memory as a first-class resource with unified structure, lifecycle management, and scheduling strategies. It is intended to solve issues related to weak memory structuring, high knowledge update costs, and difficulty in accumulating user preferences in mainstream LLM architectures.

    Key Capabilities:

    • Modular Memory Architecture: Supports textual, activation (KV cache), and parametric (adapters/LoRA) memory.
    • MemCube: A unified container for all memory types that provides easy load/save functionality and API access.
    • MOS (Memory-augmented chat orchestration): Orchestrates LLM chats with plug-and-play memory modules.
    • Graph-based Backends: Native support for Neo4j and other graph databases to enable structured, explainable memory.
    • Integration: Compatible with HuggingFace, Ollama, and custom LLMs.
  3. Overview of the MemOS Local Hermes Adapter

    main

    The adapters/hermes adapter bridges the Python-based hermes-agent with the TypeScript-based memos-local-plugin core. It uses a JSON-RPC 2.0 protocol over stdio to allow the stateless Python MemTensorProvider to communicate with the Node.js bridge.cts process.

    All core memory logic (L1/L2/L3, skills, retrieval, feedback, and decision repair) is executed in the TypeScript core, while the Python side acts as a thin proxy.

  4. Overview of MemOS REST API Service

    main

    MemOS provides a REST API service built with FastAPI, allowing users to perform all memory-related operations via HTTP interfaces.

    Key capabilities include:

    • Add new memory: Create a new memory entry for a specific user.
    • Search memories: Search through existing memory content for a specific user.
    • Get all user memories: Retrieve the complete memory history for a specific user.
    • Memory feedback: Provide feedback on specific memory content for a user.
    • Chat with MemOS: Engage in a dialogue with MemOS, which returns responses via Server-Sent Events (SSE) streaming.
  5. Overview of MemOS (memos-local)

    main

    MemOS provides OpenClaw agents with persistent local memory. It is designed for 100% on-device operation with zero cloud uploads, ensuring privacy and ease of use without requiring API keys or registration.

    Key Capabilities:

    • Task Summarization: Organizes conversations into structured tasks with LLM-generated summaries.
    • Skill Evolution: Distills successful executions into reusable, auto-upgrading skills.
    • Team Sharing: Uses a Hub-Client architecture for collaborative memory across multiple agents.
    • Memory Viewer: A web-based UI for visual management of memories, tasks, and skills.

    Storage and Access:

    • Data Location: All data is stored locally in a SQLite database at ~/.openclaw/memos-local/memos.db.
    • Memory Viewer URL: Access the UI at http://127.0.0.1:18799.
  6. Overview of MemOS

    main

    MemOS (Memory Operating System) is a Python package designed to provide advanced modular memory capabilities for Large Language Models (LLMs). It addresses the limitations of standard LLM architectures in managing structured memory, knowledge updates, and user preferences by treating memory as a first-class resource with unified structures, lifecycle management, and scheduling policies.

    Key capabilities include:

    • Modular Memory Architecture: Supports plaintext, activation (KV cache), and parameter (adapter/LoRA) memory.
    • MemCube: A unified container for all memory types, facilitating easy loading, saving, and API access.
    • MOS (Memory Operating System): A plug-and-play memory enhancement system for LLMs.
    • Graph-based Backend: Native support for Neo4j and other graph databases for structured, interpretable memory.
    • Integration & Extensibility: Compatible with HuggingFace, Ollama, and custom LLMs, with support for custom memory modules or backends.
  7. Overview of MemOS REST API

    main

    MemOS provides a high-performance REST API service built on FastAPI. The system uses a Component + Handler architecture, allowing core logic such as memory extraction, semantic search, and asynchronous scheduling to be invoked via standard REST interfaces.

    Core Features

    • Multi-dimensional Memory Production: Uses AddHandler to process dialogues, text, or documents into structured memory.
    • MemCube Physical Isolation: Uses Cube ID to ensure data isolation and independent indexing between different users or knowledge bases.
    • End-to-End Dialogue Loop: Uses ChatHandler to orchestrate the "Retrieve -> Generate -> Asynchronous Store" workflow.
    • Asynchronous Task Scheduling: Includes a MemScheduler engine for managing large-scale memory production tasks and tracking status.
    • Self-Correction Mechanism: Provides feedback interfaces to correct or mark stored memories using natural language.
  8. Overview of MemOS: Memory Operating System for LLM & AI Agents

    main

    MemOS is a memory operating system designed for LLMs and AI Agents. It provides a unified interface for the storage, retrieval, and management of long-term memory. Unlike traditional black-box vector databases, MemOS organizes memory using a graph structure that is inspectable and editable.

    Key Features

    • Unified Memory API: Single API for CRUD operations (Create, Read, Update, Delete) on memory organized in a graph structure.
    • Multimodal Memory: Native support for text, images, tool trajectories, and personas within a single retrieval and reasoning system.
    • Multi-Cube Knowledge Base Management: Allows combining multiple knowledge bases into reusable "Memory Cubes" for isolation, controlled sharing, and dynamic composition across users, projects, or agents.
    • MemScheduler Asynchronous Writing: Executes memory operations asynchronously with millisecond latency to ensure stability under high concurrency.
    • Memory Feedback & Refinement: Supports refining memory through natural language feedback to correct, supplement, or replace existing memories.
  9. Overview of MemOS: Memory Operating System

    main

    MemOS is a Memory Operating System designed for LLMs and AI agents. It provides a unified system to store, retrieve, and manage long-term memory. Unlike black-box embedding stores, MemOS uses a structured graph approach that is inspectable and editable.

    Key Capabilities:

    • Unified Memory API: Single interface for adding, retrieving, editing, and deleting memory.
    • Multi-Modal Memory: Supports text, images, tool traces, and personas.
    • Multi-Cube Knowledge Base Management: Manage multiple knowledge bases as composable "memory cubes" for isolation or controlled sharing.
    • Asynchronous Ingestion: Uses MemScheduler for high-concurrency, low-latency memory operations.
    • Memory Feedback & Correction: Allows refining memory using natural-language feedback to correct or supplement existing data.
  10. Overview of MemOS REST API Server features

    main

    MemOS provides a REST API service built with FastAPI, allowing users to perform all memory operations via REST interfaces. Supported operations include:

    • Add new memory: Create a new memory for a specific user.
    • Search memories: Search for memory content for a specific user.
    • Get all user memories: Retrieve all memory content for a specific user.
    • Memory feedback: Provide feedback on memory content for a specific user.
    • Chat with MemOS: Interact with MemOS via chat, which returns responses using Server-Sent Events (SSE) streaming.
  11. Understand the MemOS Dream Plugin architecture

    main

    The MemOS Dream plugin is a motivation-driven offline memory reorganization system. Unlike simple batch summarization, Dream identifies underlying motivations (unresolved goals, recurring patterns, or emotional events) and uses them to perform directed recall and integration of heterogeneous memories.

    It persists results into two distinct tracks:

    1. Dream Diary: Human-readable, explainable traces of the reasoning process.
    2. Dream Memory: Integrated insights that influence future AI behavior.

    The Dream Pipeline

    The process follows four sequential stages:

    StepStageDescription
    1MotiveFormationLLM analyzes memories to identify cross-conversation patterns and unresolved tensions, grouping them into motive clusters.
    2DirectRecallPerforms semantic recall across UserMemory and LongTermMemory using embeddings from the source memories.
    3ConsolidationReasoningLLM-driven deep reasoning that reconstructs problems and produces DreamAction (e.g., CREATEInsightMemory) with deductive arguments.
    4aStructuredDiarySummaryWraps reasoning output into a human-readable diary entry (title, summary, dream content, motive context).
    4bDreamPersistenceExecutes DreamActions on the graph_db and persists the diary. Triggers dream.before_persist and dream.after_persist hooks.
  12. MemOS Use Cases

    main

    MemOS provides long-term memory capabilities for AI agents in several typical scenarios:

    • AI Assistants: Maintaining context consistency during continuous dialogues.
    • Customer Service Systems: Retrieving historical tickets and user information to provide targeted assistance.
    • Personalized Agents: Adapting to user preferences through continuous learning and adjustment.
    • Multi-Agent Collaboration: Managing shared or isolated memory spaces between different agents.