# MemOS > MemOS is a long-term memory system for AI agents and applications. It automatically extracts, stores, and retrieves personalized memories from conversations so your AI remembers users across sessions. ## For agents reading this file - To get raw Markdown of any page below, append `.md` to its URL. - **Locale**: links use their actual language paths. Chinese pages start with `/cn/`; some pages are available in only one language. Chinese documentation index: [/cn/llms.txt](/cn/llms.txt). - Full documentation text: [/llms-full.txt](/llms-full.txt) - OpenAPI spec (Cloud): [/cn/api_docs/api.json](/cn/api_docs/api.json) - Source repo: https://github.com/MemTensor/MemOS - CLI: `pip install memos-cli` — see [CLI guide](/mcp_agent/cli/guide) - Dashboard: https://memos-dashboard.openmem.net ### Quick integration ```bash pip install MemoryOS -U ``` ```python import os import requests import json os.environ["MEMOS_API_KEY"] = "YOUR_API_KEY" # Get from https://memos-dashboard.openmem.net/apikeys/ os.environ["MEMOS_BASE_URL"] = "https://memos.memtensor.cn/api/openmem/v1" headers = { "Content-Type": "application/json", "Authorization": f"Token {os.environ['MEMOS_API_KEY']}" } # 1. Store a conversation as memory data = { "user_id": "memos_user_123", "conversation_id": "0610", "messages": [ {"role": "user", "content": "I've planned to travel to Guangzhou this summer. What chain hotels are available?"}, {"role": "assistant", "content": "You can consider 7 Days Inn, All Seasons, Hilton, etc."}, {"role": "user", "content": "I'll choose 7 Days Inn."}, {"role": "assistant", "content": "Alright, feel free to ask if you have any other questions."} ] } res = requests.post( f"{os.environ['MEMOS_BASE_URL']}/add/message", headers=headers, data=json.dumps(data) ) print(f"add result: {res.json()}") # 2. Recall relevant memories later data = { "query": "I want to travel during National Day. Recommend a city I haven't been to and a hotel I haven't stayed at.", "user_id": "memos_user_123", "conversation_id": "0928" } res = requests.post( f"{os.environ['MEMOS_BASE_URL']}/search/memory", headers=headers, data=json.dumps(data) ) print(f"search result: {res.json()}") ``` ### Routing guide | User wants to... | Start here | |---|---| | Add memory to their app (API) | [Integrate into Your App](/memos_cloud/getting_started/quick_start) | | Use via MCP / CLI / Plugin | [Use in Agents](/memos_cloud/getting_started/agent_usage) | | Understand concepts | [Overview](/memos_cloud/getting_started/overview) | | Self-host open source | [Installation Guide](/open_source/getting_started/installation) | | API reference | [API Overview](/api_docs/start/overview) | --- ## MemOS Cloud ### Getting Started - [MemOS Overview](/memos_cloud/getting_started/overview): Memory Operation System, giving AI applications long-term memory. - [Cloud Service & Open Source](/memos_cloud/getting_started/cloud_and_opensource): Choose the MemOS memory solution that best fits your needs. - [Use in Agents](/memos_cloud/getting_started/agent_usage): Connect MemOS to Agent workflows through plugins, MCP, CLI, and APIs. - [Integrate into Your App](/memos_cloud/getting_started/quick_start): Configure a MemOS Cloud account and create your first memory in five minutes. ### Concepts - [Raw Input Content](/memos_cloud/introduction/raw_inputs): MemOS can generate memories from different kinds of raw input content. - [Memory Categories](/memos_cloud/introduction/memory_types): Understand the different categories of memories generated and used by MemOS. - [Multi-user / Multi-Agent Isolation](/memos_cloud/introduction/isolation_filters): Implement memory sharing and isolation across users, Agents, conversations, and more. - [Time Awareness](/memos_cloud/introduction/time_awareness): How memories update over time, keep history, and understand "now" and "before" during retrieval. - [FAQ](/memos_cloud/introduction/faq): Understand MemOS concepts such as RAG, open source deployment, private deployment, memory lifecycle, and scheduling. #### How MemOS Works - [Memory Production](/memos_cloud/introduction/mem_production): Memory production turns raw conversations, behavior events, tool calls, and knowledge content into structured memories that can be searched, updated, and scheduled. - [Memory Scheduling](/memos_cloud/introduction/mem_schedule): Memory scheduling decides which memories should be prepared in advance, prioritized, or temporarily downgraded while conversations and tasks are running. - [Memory Recall](/memos_cloud/introduction/mem_recall): Memory recall finds the content that is most relevant, trustworthy, and suitable to inject into context when a user makes a request. - [Memory Lifecycle Management](/memos_cloud/introduction/mem_lifecycle): Memory lifecycle management keeps memories evolving through generation, use, merging, archiving, and cleanup, so the memory base stays accurate, clean, and traceable. - [MemOS Algorithm Overview](/memos_cloud/introduction/algorithm): Transforming large models from disposable dialogue tools into intelligent agents with true long-term memory and adaptive capabilities. ### Core Operations - [Add Message](/memos_cloud/mem_operations/add_message): MemOS automatically processes multimodal content such as text, files, and images into retrievable personal memories. - [Search Memory](/memos_cloud/mem_operations/search_memory): MemOS recalls relevant memories through semantic retrieval and filtering. - [Delete Memory](/memos_cloud/mem_operations/delete_memory): Delete memories for a specified user or Agent. Supports precise deletion of individual memories, or deleting all memories for a user or Agent at once. - [Update Memory](/memos_cloud/mem_operations/update_memory): Manually update memory. - [Add Feedback](/memos_cloud/mem_operations/add_feedback): Add natural-language user feedback, and MemOS automatically updates memories. - [Continuous Conversation Chat](/memos_cloud/mem_operations/chat): MemOS provides a conversation API with built-in memory management, so you do not need to manually assemble context. ### More Features - [Memory Filters](/memos_cloud/features/filters): Use memory filters during retrieval to filter by memory source, tags, metadata, time range, and other conditions. - [Async Mode](/memos_cloud/features/async_mode): Use async mode when adding messages; the interface returns immediately while actual processing is queued in the background by MemOS. - [Custom Tags](/memos_cloud/features/custom_tags): Use tags according to your business needs when adding messages. - [Knowledge Base](/memos_cloud/features/knowledge_base): Create a knowledge base associated with the project, and combine user memory with knowledge base to supplement knowledge when retrieving memories. - [Profile](/memos_cloud/features/profile): Maintain a structured profile for a user or AI Agent, automatically distilled from conversations and continuously updated. - [Event Memory](/memos_cloud/features/event_memory): Automatically extract structured events from conversations, including time, location, participants, and other key elements. - [Self-Evolving](/memos_cloud/features/self-evolving): Memory is not just storage — MemOS automatically distills reusable structured methods from conversations, letting Agent capabilities evolve continuously with use. - [Group Chat](/memos_cloud/features/group_chat): Multiple users and Agents converse in the same session; MemOS distinguishes participants when extracting memory. - [Tool Calling](/memos_cloud/features/tool_calling): Add tool calling information, integrating tool calling decisions, execution results, and usage trajectories into MemOS memory. - [Multimodal Messages](/memos_cloud/features/multimodal): Integrate images and documents into interactions with MemOS when adding messages. ### Support and Troubleshooting - [Cloud FAQs](/memos_cloud/support/faq): Troubleshoot common MemOS Cloud issues related to accounts, projects, API Keys, quotas, knowledge bases, and API calls. - [Limits](/memos_cloud/support/limit): Register and log in to enjoy free quota, facilitating quick experience and verification of memory functions. ## Open Source - [Search memories](/api-reference/search-memories) `POST /product/search`: Search memories for a specific user. - [Add memories](/api-reference/add-memories) `POST /product/add`: Add memories for a specific user. - [Get all memories for user](/api-reference/get-all-memories-for-user) `POST /product/get_all`: Get all memories or subgraph for a specific user. If search_query is provided, returns a subgraph based on the query. Otherwise, returns all memories of the specified type. - [Get memories for user](/api-reference/get-memories-for-user) `POST /product/get_memory`: Get memories for user with pagination support. - [Get memory by id](/api-reference/get-memory-by-id) `GET /product/get_memory/{memory_id}`: Get a specific memory by its ID. - [Delete memories for user](/api-reference/delete-memories-for-user) `POST /product/delete_memory`: Delete memories for a specific user. - [Chat with MemOS (Complete Response)](/api-reference/chat-with-memos-(complete-response)) `POST /product/chat/complete`: Chat with MemOS for a specific user. Returns complete response (non-streaming). - [Chat with MemOS](/api-reference/chat-with-memos) `POST /product/chat/stream`: Chat with MemOS for a specific user. Returns SSE stream. - [Chat with MemOS playground](/api-reference/chat-with-memos-playground) `POST /product/chat/stream/playground`: Chat with MemOS for a specific user in playground. Returns SSE stream. - [Get suggestion queries](/api-reference/get-suggestion-queries) `POST /product/suggestions`: Get suggestion queries for a specific user with language preference. - [Feedback memories](/api-reference/feedback-memories) `POST /product/feedback`: Feedback memories for a specific user. - [Get detailed scheduler status](/api-reference/get-detailed-scheduler-status) `GET /product/scheduler/allstatus`: Get detailed scheduler status including running tasks and queue metrics. - [Get scheduler running status](/api-reference/get-scheduler-running-status) `GET /product/scheduler/status`: Get scheduler running status. - [Get scheduler task queue status](/api-reference/get-scheduler-task-queue-status) `GET /product/scheduler/task_queue_status`: Get scheduler task queue backlog/pending status for a user. - [Wait until scheduler is idle for a specific user](/api-reference/wait-until-scheduler-is-idle-for-a-specific-user) `POST /product/scheduler/wait`: Wait until scheduler is idle for a specific user. - [Stream scheduler progress for a user](/api-reference/stream-scheduler-progress-for-a-user) `GET /product/scheduler/wait/stream`: Stream scheduler progress via Server-Sent Events (SSE). - [Get user names by memory ids](/api-reference/get-user-names-by-memory-ids) `POST /product/get_user_names_by_memory_ids`: Get user names by memory ids. - [Check if mem cube id exists](/api-reference/check-if-mem-cube-id-exists) `POST /product/exist_mem_cube_id`: Check if mem cube id exists. ### Getting Started - [Installation Guide](/open_source/getting_started/installation): Complete installation guide for MemOS. - [Your First Memory](/open_source/getting_started/your_first_memory): Let’s build your first plaintext memory in MemOS! **GeneralTextMemory** is the easiest way to get hands-on with extracting, embedding, and searching simple text memories. - [Core Concepts](/open_source/home/core_concepts): MemOS treats memory as a first-class citizen. Its core design revolves around how to orchestrate, store, retrieve, and govern memory for your LLM applications. - [Architecture](/open_source/home/architecture): MemOS is made up of **core modules** that work together to turn your LLM into a truly **memory-augmented system** — from orchestration to storage to retrieval. - [REST API Server](/open_source/getting_started/rest_api_server): MemOS provides a REST API service written using FastAPI. Users can perform all operations via REST interfaces. - [MemOS Examples](/open_source/getting_started/examples): Congratulations - you've mastered the Quick Start and built your first working memory! Now it's time to see how far you can take MemOS by combining different memory types and features. Use these curat ### MOS - [MemOS API Development Guide (Components & Handlers Architecture)](/open_source/modules/mos/overview): MemOS v2.0 adopts a more modular and decoupled architecture. The legacy MOS class is deprecated; Components + Handlers is now recommended for development. - [MemCube](/open_source/modules/mem_cube): `MemCube` is your memory container that manages three types of memories: textual memory, activation memory, and parametric memory. It provides a simple interface for loading, saving, and operating on - [MemReader](/open_source/modules/mem_reader): MemReader is your "memory translator". It translates messy user inputs (chat, documents, images) into structured memory fragments the system can understand. - [MemScheduler](/open_source/modules/mem_scheduler): MemScheduler is your "memory organization scheduler". It asynchronously manages memory flow and updates in the background, coordinating interactions between working memory, long-term memory, and activ - [MemChat](/open_source/modules/mem_chat): MemChat is your "memory diplomat". It coordinates user input, memory retrieval, and LLM generation to create coherent conversations with long-term memory. - [MemFeedback](/open_source/modules/mem_feedback): MemFeedback is your "memory error notebook". It enables your Agent to understand 'You remembered it wrong' and automatically correct the memory database. It is a key component for achieving self-evolv ### Memories - [Memory Modules Overview](/open_source/modules/memories/overview): Complete guide to MemOS memory systems - from lightweight text memory to advanced graph structures, choose the right memory module for your needs - [KVCacheMemory: Key-Value Cache for Activation Memory](/open_source/modules/memories/kv_cache_memory): `KVCacheMemory` is a specialized memory module in MemOS for storing and managing key-value (KV) caches, primarily used to accelerate large language model (LLM) inference and support efficient context - [Parametric Memory *(Coming Soon)*](/open_source/modules/memories/parametric_memory) #### Plaintext Memory - [NaiveTextMemory: Simple Plain Text Memory](/open_source/modules/memories/naive_textual_memory): The most lightweight memory module in MemOS, designed for rapid prototyping and simple scenarios. No vector database required—quickly retrieve memories using keyword matching. - [GeneralTextMemory: General-Purpose Textual Memory](/open_source/modules/memories/general_textual_memory): `GeneralTextMemory` is a flexible, vector-based textual memory module in MemOS, designed for storing, searching, and managing unstructured knowledge. It is suitable for conversational agents, personal - [PreferenceTextMemory: Textual Memory for User Preferences](/open_source/modules/memories/preference_textual_memory): `PreferenceTextMemory` is a textual memory module in MemOS for storing and managing user preferences. It is suitable for scenarios where memory retrieval needs to be based on user preferences. - [TreeTextMemory: Structured Hierarchical Textual Memory](/open_source/modules/memories/tree_textual_memory): > - [Neo4j Graph Database](/open_source/modules/memories/neo4j_graph_db): This module provides graph-based memory storage and querying for memory-augmented systems such as RAG, cognitive agents, or personal memory assistants.
It defines a clean abstraction (`BaseGraphD - [PolarDB Graph Database](/open_source/modules/memories/polardb_graph_db): Configuration and usage of PolarDB graph database in the MemOS framework. MemOS supports using **PolarDB** (based on Apache AGE extension) as a graph database backend for storing and retrieving knowle ### Best Practice - [Performance Tuning](/open_source/best_practice/performance_tuning) - [Network Workarounds](/open_source/best_practice/network_workarounds): Here are some solutions to address the network issues you may encounter during developing. - [Common Errors and Solutions](/open_source/best_practice/common_errors_solutions) - [MemOS MCP Integration Guide](/open_source/best_practice/mcp_for_cozespace_and_tools) ### Contribution - [Contributing to MemOS](/open_source/contribution/overview): Welcome to the MemOS contribution guide! Learn how to set up your development environment, follow our workflow, write good commit messages, improve documentation, and add tests. - [Setting Up Your Development Environment](/open_source/contribution/setting_up): To contribute to MemOS, you'll need to set up your local development environment. - [Development Workflow](/open_source/contribution/development_workflow) - [Commit Guidelines](/open_source/contribution/commit_guidelines) - [Documentation Writing Guidelines](/open_source/contribution/writing_docs): This project uses Nuxt Content to build a documentation system that supports Markdown and rich Vue components. - [How to Write Unit Tests](/open_source/contribution/writing_tests): This project uses [pytest](https://docs.pytest.org/) for unit testing. ## Self-developed Models Overview ### Extraction Model - [Usage Examples](/self_developed_model/extraction_usage_example): Extract fact and preference memories from dialogue using the in-house memos-extractor-0.6b model. ### Reranker Model - [Usage Examples](/self_developed_model/reranker_usage_example): Rerank memory relevance based on the self-developed memos-reranker small model. ## Agent - [Cloud Plugin vs Local Plugin](/openclaw/plugin_compare): The cloud plugin hosts memory on MemOS Cloud for a quick start and cross-device use. The local plugin runs on your machine and brings long-term memory and self-evolution to OpenClaw, Hermes, and DeepS - [OpenClaw Plugin Changelog](/openclaw/changes) ### Installation Guide - [Cloud Plugin](/openclaw/guide): Enhance your OpenClaw's memory and reduce token by 72%. MemOS OpenClaw plugin is now live! - [Local Plugin](/openclaw/local_plugin): Use @memtensor/memos-local-plugin to bring local-first long-term memory, three-tier retrieval, skill crystallization, and an observable management panel to OpenClaw, Hermes Agent, and DeepSeek Harness ### Usage Examples - [Knowledge Base Usage](/openclaw/examples/knowledge_base): Create a knowledge base in MemOS Cloud Dashboard and configure its knowledge base ID in the OpenClaw cloud plugin. - [Multi-Agent Memory Isolation](/openclaw/examples/multi_agent) - [Secondary Filtering for Memory Recall](/openclaw/examples/recall_filter) - [Local Plugin Usage](/openclaw/examples/hermes_usage): Basic usage, memory tools, team sharing, and multi-agent examples for the MemOS local plugin in OpenClaw and Hermes. ## Agent Framework Support ### MCP Services - [MemOS MCP Usage Guide](/mcp_agent/mcp/guide) ### CLI - [MemOS CLI](/mcp_agent/cli/guide): Connect MemOS to local terminals and Agent workflows through command-line tools. ### Agent Development - [User Guide](/mcp_agent/agent/guide): Published plugin tools directly access the MemOS cloud service API, quickly adding long-term memory capabilities to your Agent, making conversations more considerate and continuous. ## API Documentation ### Get Started - [Overview](/api_docs/start/overview) - [Project Configuration](/api_docs/start/configuration): Understand how projects, API Keys, knowledge base associations, and request logs work together for multi-project management, knowledge base binding, and configuration troubleshooting. ### Core Operations - [Add Message](/api_docs/core/add_message) `POST /add/message`: This API allows you to add one or more messages to a specific conversation. As illustrated in the examples bellow, you can add messages in real time during a user-assistant interaction, import histori - [Search Memory](/api_docs/core/search_memory) `POST /search/memory`: This API retrieves memories for a specified user or Agent and returns the fragments most relevant to the query. - [Get Memories](/api_docs/core/get_memory) `POST /get/memory`: Retrieve paginated memories for a user or Agent. - [Get Memory](/api_docs/core/get_memory_by_id) `GET /get/memory/{memory_id}`: Retrieve the details of a single memory by its ID. - [Delete Memory](/api_docs/core/delete_memory) `POST /delete/memory`: Delete memories for a user or Agent. Supports deletion by memory_ids or clearing all memories by user_id/agent_id. - [Update Memory](/api_docs/core/update_memory) `POST /update/memory`: Manually update the content, title, or status of an existing memory. Supports all memory categories, including fact memories, preference memories, Event Memory, and Profile attribute values. - [Add Feedback](/api_docs/message/add_feedback) `POST /add/feedback`: This API is used to add feedback to current session messages, allowing MemOS to correct memories based on user feedback. ### Profile - [Add Profile Template](/api_docs/core/add_profile_template) `POST /add/profile_template`: Create a Profile template in the project and return the template ID. Once created, bind it to users or Agents via Bind Profile Template to create Profile instances. - [List Profile Templates](/api_docs/core/list_profile_template) `POST /list/profile_template`: Return a paginated list of Profile template summaries in the project, sorted by creation time descending; ties are sorted by template ID descending. - [Get Profile Template](/api_docs/core/get_profile_template) `POST /get/profile_template`: Return the full structure and summary of a Profile template. - [Update Profile Template](/api_docs/core/update_profile_template) `POST /update/profile_template`: Update the template name or attribute structure. Changes are synced to every Profile instance bound to the template. - [Delete Profile Template](/api_docs/core/delete_profile_template) `POST /delete/profile_template`: Delete a Profile template along with all of its active instances and bindings; other templates and memories are unaffected. To delete only the instance of a specific user or Agent, use /delete/profile - [Bind Profile Template](/api_docs/core/bind_profile_template) `POST /bind/profile_template`: Bind a Profile template to a user or Agent, creating a Profile memory instance. After binding, the corresponding attribute fields are automatically updated whenever new messages are added. - [Edit Profile](/api_docs/core/edit_profile) `POST /edit/profile`: Edit a Profile memory instance: add fields, update field values, remove fields, or lock fields against automatic updates by the algorithm. Only the target instance is affected; the template and other - [Delete Profile](/api_docs/core/delete_profile) `POST /delete/profile`: Delete a user's or Agent's Profile memory instance. All field values and bindings for that instance are removed. This does not affect the template itself or other instances. ### Self-developed Models - [Extract Memory](/api_docs/core/extract_memory) `POST /extract/memory`: Uses MemOS’s self-developed extraction model to extract and return fact and preference memories directly from conversation messages. - [Rerank](/api_docs/core/rerank) `POST /rerank`: Provides a memory reranking API based on the memos-reranker small model. It takes a user query and a list of candidate memories and completes memory relevance reranking with a single call. ### Messages - [Get Message](/api_docs/message/get_message) `POST /get/message`: This API retrieves the historical conversation records between a user and the assistant for a specified session, with the option to limit the number of results. As shown in the examples bellow, you ca - [Get Task Status](/api_docs/message/get_status) `POST /get/status`: Query the processing status of async tasks such as add/message and add/feedback. When a task completes, the response includes memory_views with added/updated/deleted counts and memory IDs grouped by < ### Chat - [Chat](/api_docs/chat/chat) `POST /chat` ### Knowledge Base - [Create Knowledge Base](/api_docs/knowledge/create_kb) `POST /create/knowledgebase`: Create a knowledgebase associated with the project. - [Delete Knowledge Base](/api_docs/knowledge/remove_kb) `POST /delete/knowledgebase`: Delete a knowledge base or remove its association with the current project. - [Create Knowledge Base File](/api_docs/knowledge/add_kb_doc) `POST /add/knowledgebase-file`: Upload files to a specified Knowledge Base. By default, files are uploaded as documents. When file[].type is skill, upload a Markdown Skill file or ZIP Skill package. - [Get Knowledge Base File](/api_docs/knowledge/get_kb_doc) `POST /get/knowledgebase-file`: Get file information in one of two ways: pass file_ids to retrieve specific file details, or pass knowledgebase_id to list files under a Knowledge Base. Choose only one mode; passing both knowledgebas - [Delete Knowledge Base File](/api_docs/knowledge/delete_kb_doc) `POST /delete/knowledgebase-file`: Delete files from a specified Knowledge Base. When a Skill file is deleted, the associated Skill is deleted as well. ### Help & Support - [Error Codes](/api_docs/help/error_codes) ## Best Practices ### Tutorials - [Build a Memory-Enhanced Knowledge Base Q&A Assistant](/usecase/knowledge_qa_assistant): Combine long-term memory with a knowledge base to move beyond “one-size-fits-all” retrieval results—deliver personalized, more accurate answers based on each user’s background and preferences, and tur - [Help Your Customer Service Agent Remember Users: Cross-Session Memory with MemOS](/usecase/customer_service_assistant): Separate user memories, Agent Skills, and policy knowledge so a customer service Agent can continue user cases across sessions and reuse general workflows. - [Let the Financial Assistant Understand Customer Preferences Behind Behaviors](/usecase/financial_assistant): With MemOS, user operations and conversational behaviors are abstracted into "memories," enabling the identification and extraction of underlying investment preferences to deliver more personalized se - [A Writing Assistant with Memory is More Useful](/usecase/writting_assistant): With MemOS, your product will automatically remember the user's writing habits and context, making the creative process more coherent and effortless. - [Building a Home Life Assistant with Memory](/usecase/home_assistant): With the support of MemOS, a home assistant can connect daily chores and long-term plans, quickly understanding and responding to the user’s real needs. - [Claude MCP](/usecase/frameworks/claude_mcp) - [Coze Plugin](/usecase/frameworks/coze_plugin): The Coze plugin tool directly accesses MemOS cloud service interfaces to quickly add long-term memory capabilities to your Agent, making conversations more thoughtful and continuous. ### Blog - [Agent Memory Is Not RAG: A 2026 Production Field Guide](/usecase/blog/agent_memory_is_not_rag) - [Claude Made Memory Editable. Production Agents Still Need a Governed Memory Layer](/usecase/blog/claude_editable_memory_governed_layer) - [How to Keep Bad Assumptions Out of Agent Memory](/usecase/blog/keep_bad_assumptions_out_of_agent_memory) ## MemOS 云服务 ### 开始使用 - [MemOS 概览](/cn/memos_cloud/getting_started/overview): 记忆操作系统(Memory Operation System),让 AI 应用获得长期记忆。 - [云平台与开源方案](/cn/memos_cloud/getting_started/cloud_and_opensource): 选择最适合您需求的 MemOS “记忆”方案。 - [在 Agent 中使用](/cn/memos_cloud/getting_started/agent_usage): 通过插件、MCP、CLI 等形式,把 MemOS 接入 Agent 工作流。 - [在应用中集成](/cn/memos_cloud/getting_started/quick_start): 配置 MemOS 云服务账户,在 5 分钟内创建你的第一条记忆。 ### 概念介绍 - [原始输入内容](/cn/memos_cloud/introduction/raw_inputs): MemOS 支持基于不同种类的原始内容,生成记忆。 - [记忆种类](/cn/memos_cloud/introduction/memory_types): 解释 MemOS 生成并使用的不同种类的记忆。 - [多用户 / 多 Agent 隔离](/cn/memos_cloud/introduction/isolation_filters): 实现记忆共享与隔离,区分不同用户、Agent、会话等。 - [时间感知](/cn/memos_cloud/introduction/time_awareness): 记忆如何随时间更新、保留历史,并在检索时理解"现在"和"过去"。 - [常见问题](/cn/memos_cloud/introduction/faq): 理解 MemOS 与 RAG、开源方案、私有化部署、记忆生命周期和调度等概念。 #### MemOS 工作原理 - [记忆生产](/cn/memos_cloud/introduction/mem_production): 记忆生产负责把原始对话、行为事件、工具调用和知识内容加工成可检索、可更新、可调度的结构化记忆。 - [记忆调度](/cn/memos_cloud/introduction/mem_schedule): 记忆调度负责在对话和任务进行时,判断哪些记忆应该被提前准备、优先使用或暂时降级。 - [记忆召回](/cn/memos_cloud/introduction/mem_recall): 记忆召回负责在用户发起请求时,从已有记忆中找出与当前任务最相关、最可信、最适合注入上下文的内容。 - [记忆生命周期管理](/cn/memos_cloud/introduction/mem_lifecycle): 记忆生命周期管理负责让记忆在生成、使用、合并、归档和清理之间持续演化,保持记忆库准确、干净、可追溯。 - [MemOS算法原理概述](/cn/memos_cloud/introduction/algorithm): 让大模型从一次性对话工具,进化为真正具有长期记忆和自适应能力的智能体。 ### 核心操作 - [Add Message](/cn/memos_cloud/mem_operations/add_message): MemOS 会将您添加的多模态内容如文本、文件、图片等,自动处理为可检索的个人记忆。 - [Search Memory](/cn/memos_cloud/mem_operations/search_memory): 通过语义检索和过滤功能,MemOS 召回相关记忆。 - [删除记忆](/cn/memos_cloud/mem_operations/delete_memory): 删除指定用户或 Agent 的记忆,支持精确删除记忆条目、或直接删除某个用户或 Agent 的全部记忆。 - [修改记忆](/cn/memos_cloud/mem_operations/update_memory): 手动修改某条记忆。 - [Add Feedback](/cn/memos_cloud/mem_operations/add_feedback): 添加用户自然语言反馈,MemOS 将自动更新记忆。 - [持续对话 Chat](/cn/memos_cloud/mem_operations/chat): MemOS 提供对话接口,内置完整的记忆管理能力,无需手动拼接上下文。 ### 更多功能 - [记忆过滤器 Filter](/cn/memos_cloud/features/filters): 检索记忆时使用记忆过滤器,可以按记忆来源、标签、元信息、时间范围等条件进行过滤。 - [异步模式AsyncMode](/cn/memos_cloud/features/async_mode): 添加消息时使用异步模式,接口请求立即返回,而实际处理在MemOS后台排队完成。 - [自定义标签Tags](/cn/memos_cloud/features/custom_tags): 添加消息时按照你的业务需求使用标签。 - [知识库Knowledgebase](/cn/memos_cloud/features/knowledge_base): 创建项目关联的知识库,检索时结合记忆与知识库。 - [属性记忆 Profile](/cn/memos_cloud/features/profile): 为用户或 AI 角色维护一份结构化画像,从对话中自动沉淀并持续更新。 - [事件记忆 Event](/cn/memos_cloud/features/event_memory): 从对话中自动抽取结构化事件,包含时间、地点、参与者等要素。 - [记忆自进化 Self-Evolving](/cn/memos_cloud/features/self-evolving): 记忆不只是存储——MemOS 会自动从对话中提炼可复用的结构化方法,让 Agent 的能力随使用持续进化。 - [群聊](/cn/memos_cloud/features/group_chat): 多用户与 Agent 在同一会话中对话,MemOS 抽取记忆时区分不同参与者。 - [工具调用ToolCall](/cn/memos_cloud/features/tool_calling): 添加工具调用信息,将工具调用的决策、执行结果及其使用轨迹统一纳入 MemOS 记忆。 - [多模态消息](/cn/memos_cloud/features/multimodal): 添加消息时,将图片和文档集成到与MemOS的交互中。 ### 支持与问题排查 - [云服务 FAQs](/cn/memos_cloud/support/faq): 排查使用 MemOS Cloud 时常见的账号、项目、API Key、额度、知识库和接口调用问题。 - [配额和限制](/cn/memos_cloud/support/limit): 注册登录即享有免费额度,便于快速体验和验证记忆功能。 ## 开源项目 - [Search memories](/cn/api-reference/search-memories) `POST /product/search`: Search memories for a specific user. - [Add memories](/cn/api-reference/add-memories) `POST /product/add`: Add memories for a specific user. - [Get all memories for user](/cn/api-reference/get-all-memories-for-user) `POST /product/get_all`: Get all memories or subgraph for a specific user. If search_query is provided, returns a subgraph based on the query. Otherwise, returns all memories of the specified type. - [Get memories for user](/cn/api-reference/get-memories-for-user) `POST /product/get_memory`: Get memories for user with pagination support. - [Get memory by id](/cn/api-reference/get-memory-by-id) `GET /product/get_memory/{memory_id}`: Get a specific memory by its ID. - [Delete memories for user](/cn/api-reference/delete-memories-for-user) `POST /product/delete_memory`: Delete memories for a specific user. - [Chat with MemOS (Complete Response)](/cn/api-reference/chat-with-memos-(complete-response)) `POST /product/chat/complete`: Chat with MemOS for a specific user. Returns complete response (non-streaming). - [Chat with MemOS](/cn/api-reference/chat-with-memos) `POST /product/chat/stream`: Chat with MemOS for a specific user. Returns SSE stream. - [Chat with MemOS playground](/cn/api-reference/chat-with-memos-playground) `POST /product/chat/stream/playground`: Chat with MemOS for a specific user in playground. Returns SSE stream. - [Get suggestion queries](/cn/api-reference/get-suggestion-queries) `POST /product/suggestions`: Get suggestion queries for a specific user with language preference. - [Feedback memories](/cn/api-reference/feedback-memories) `POST /product/feedback`: Feedback memories for a specific user. - [Get detailed scheduler status](/cn/api-reference/get-detailed-scheduler-status) `GET /product/scheduler/allstatus`: Get detailed scheduler status including running tasks and queue metrics. - [Get scheduler running status](/cn/api-reference/get-scheduler-running-status) `GET /product/scheduler/status`: Get scheduler running status. - [Get scheduler task queue status](/cn/api-reference/get-scheduler-task-queue-status) `GET /product/scheduler/task_queue_status`: Get scheduler task queue backlog/pending status for a user. - [Wait until scheduler is idle for a specific user](/cn/api-reference/wait-until-scheduler-is-idle-for-a-specific-user) `POST /product/scheduler/wait`: Wait until scheduler is idle for a specific user. - [Stream scheduler progress for a user](/cn/api-reference/stream-scheduler-progress-for-a-user) `GET /product/scheduler/wait/stream`: Stream scheduler progress via Server-Sent Events (SSE). - [Get user names by memory ids](/cn/api-reference/get-user-names-by-memory-ids) `POST /product/get_user_names_by_memory_ids`: Get user names by memory ids. - [Check if mem cube id exists](/cn/api-reference/check-if-mem-cube-id-exists) `POST /product/exist_mem_cube_id`: Check if mem cube id exists. ### 快速入门 - [安装指南](/cn/open_source/getting_started/installation): MemOS 完整安装指南。 - [创建你的第一个记忆](/cn/open_source/getting_started/your_first_memory): 动手实战!我们将带您使用 **SimpleStructMemReader** 从对话中提取记忆,并把它存进 **TreeTextMemory** 进行管理与检索。 - [核心概念](/cn/open_source/home/core_concepts): MemOS 将记忆视为一等资源。其核心设计围绕如何为您的 LLM 应用程序组织、存储、检索和治理记忆。 - [架构设计](/cn/open_source/home/architecture): MemOS 采用模块化设计,各核心组件协同工作,将传统 LLM 升级为具备完整记忆生命周期管理能力的记忆增强系统。 - [REST API 服务](/cn/open_source/getting_started/rest_api_server): MemOS 提供了一个使用 FastAPI 编写的 REST API 服务。用户可以通过 REST 接口执行所有操作。 - [MemOS 示例](/cn/open_source/getting_started/examples): 恭喜你——你已经掌握了快速入门并构建了第一个可用的记忆!现在是时候通过结合不同的记忆类型和功能,看看 MemOS 可以实现多大的可能性。使用这些精选示例来激发你自己的智能体、聊天机器人或知识系统的灵感。 ### MemOS - [API 开发指南 (Component & Handler 架构)](/cn/open_source/modules/mos/overview): MemOS v2.0 采用了更加模块化和解耦的架构。旧版的 MOS 类已被弃用,现在推荐使用 Components (组件) + Handlers (处理器) 的模式进行开发。 - [MemCube](/cn/open_source/modules/mem_cube): MemCube 是你的“记忆收纳箱”,统一管理三种类型的记忆:明文记忆、激活记忆和参数化记忆。它提供简洁的接口,方便加载、保存和操作多个记忆模块,让开发者轻松构建、保存和共享记忆增强应用。 - [MemReader](/cn/open_source/modules/mem_reader): “MemReader 是你的“记忆翻译官”。它负责把杂乱的输入(聊天、文档、图片)翻译成系统能理解的、结构化的记忆片段。" - [MemScheduler](/cn/open_source/modules/mem_scheduler): MemScheduler 是你的“记忆组织调度器”,它在后台异步管理记忆的流转和更新,协调工作记忆、长时记忆和激活记忆之间的交互,让对话系统能够动态地组织和利用记忆。 - [MemChat](/cn/open_source/modules/mem_chat): MemChat 是你的“记忆外交官”,它协调用户输入、记忆检索与 LLM 生成,打造连贯且具备长期记忆的对话体验。 - [MemFeedback](/cn/open_source/modules/mem_feedback): MemFeedback 是你的“记忆错题本”,让你的 Agent 能够听懂“你记错了”,并自动修正记忆库。它是实现记忆自进化的关键组件。 ### 记忆系统 - [记忆模块总览](/cn/open_source/modules/memories/overview): MemOS 记忆系统完整指南 - MemOS 提供了丰富的记忆模块,满足从轻量级文本记忆到高级图结构的各种需求。本指南帮助你快速找到最适合的记忆解决方案。 - [KVCacheMemory: 激活记忆](/cn/open_source/modules/memories/kv_cache_memory): `KVCacheMemory` 是MemOS中用于存储和管理KV cache的专用记忆模块,主要用于加速大语言模型(LLMs)推理并支持有效的上下文复用。作为激活记忆,它有助于提升会话式和生成式人工智能系统的性能。 - [参数记忆 (正在开发中)](/cn/open_source/modules/memories/parametric_memory) #### 明文记忆 - [NaiveTextMemory: 简单明文记忆](/cn/open_source/modules/memories/naive_textual_memory): "MemOS 中最轻量级的记忆模块,专为快速原型开发和简单场景设计。无需向量数据库,使用关键词匹配即可快速检索。让我们用最简单的方式开始使用 MemOS 记忆系统! - [GeneralTextMemory: 通用明文记忆](/cn/open_source/modules/memories/general_textual_memory): `GeneralTextMemory` 是MemOS中一个灵活的、基于向量的明文记忆模块,用于存储、搜索和管理非结构化知识。如果说 Naive 模块是‘关键词匹配’,那么 GeneralTextMemory 就是‘理解意思’的智能索引,它适用于会话代理、个人助理和任何需要语义记忆检索的系统。 - [PreferenceTextMemory: 存储和管理用户偏好的明文记忆](/cn/open_source/modules/memories/preference_textual_memory): `PreferenceTextMemory` 是MemOS中用于存储和管理用户偏好的明文记忆模块。它适用于需要根据用户偏好进行记忆检索的场景。 - [TreeTextMemory: 树形明文记忆](/cn/open_source/modules/memories/tree_textual_memory): > - [Neo4j 图数据库](/cn/open_source/modules/memories/neo4j_graph_db): 该模块为记忆增强系统(如RAG、认知代理或个人内存助手)提供基于图结构的记忆存储和查询。
它定义了一个干净的抽象类(`BaseGraphDB`),并使用**Neo4j**实现了一个可用于生产环境的实现。 - [PolarDB 图数据库](/cn/open_source/modules/memories/polardb_graph_db): MemOS 支持使用 **PolarDB**(基于 Apache AGE 扩展)作为图数据库后端,用于存储和检索知识图谱式的记忆数据。PolarDB 结合了 PostgreSQL 的强大功能和图数据库的灵活性,特别适合需要同时进行关系型和图数据查询的场景。 ### 最佳实践 - [性能调优](/cn/open_source/best_practice/performance_tuning) - [网络问题解决方案](/cn/open_source/best_practice/network_workarounds): 以下是一些在开发过程中可能遇到的网络问题的应对方案。 - [常见错误与解决方案](/cn/open_source/best_practice/common_errors_solutions) - [MemOS MCP集成指南](/cn/open_source/best_practice/mcp_for_cozespace_and_tools) ### 贡献指南 - [参与 MemOS 开发](/cn/open_source/contribution/overview): 欢迎阅读 MemOS 贡献指南!了解如何配置开发环境、遵循我们的开发流程、撰写规范的提交信息、完善文档以及添加测试用例。 - [配置开发环境](/cn/open_source/contribution/setting_up): 若要参与 MemOS 的开发,你需要在本地配置开发环境。 - [开发流程](/cn/open_source/contribution/development_workflow) - [提交规范](/cn/open_source/contribution/commit_guidelines) - [文档编写指南](/cn/open_source/contribution/writing_docs): 本项目使用 Nuxt Content 构建支持 Markdown 和富 Vue 组件的文档系统。 - [如何编写单元测试](/cn/open_source/contribution/writing_tests): 本项目使用 [pytest](https://docs.pytest.org/) 进行单元测试。 ## 自研模型说明 ### 抽取模型 - [使用示例](/cn/self_developed_model/extraction_usage_example): 基于自研 memos-extractor-0.6b 模型,从对话中抽取事实与偏好记忆。 ### 重排模型 - [使用示例](/cn/self_developed_model/reranker_usage_example): 基于自研 memos-reranker 模型,提供记忆相关性重排能力。 ## Agent框架支持 ### MCP 服务 - [MemOS MCP 使用指南](/cn/mcp_agent/mcp/guide) ### CLI - [MemOS CLI](/cn/mcp_agent/cli/guide): 通过命令行把 MemOS 接入本地终端和 Agent 工作流。 ### Agent开发 - [使用指南](/cn/mcp_agent/agent/guide): 上架的插件工具直接访问MemOS云服务接口,快速为您的Agent添加长期记忆功能,让对话更贴心、更连续。 ## Agent - [云插件 vs 本地插件](/cn/openclaw/plugin_compare): 云插件把记忆托管在 MemOS Cloud,适合快速接入和跨设备使用。本地插件在本机提供长期记忆和自进化能力,支持 OpenClaw、Hermes 与 DeepSeek Harness。本文将帮你理解两者差异,选择适合自己的方案。 - [OpenClaw 插件更新日志](/cn/openclaw/changes) ### 安装指南 - [云插件](/cn/openclaw/guide): 增强 OpenClaw 的记忆能力并减少 72% 的 Token 消耗:MemOS OpenClaw 插件现已上线! - [本地插件](/cn/openclaw/local_plugin): 使用 @memtensor/memos-local-plugin 为 OpenClaw、Hermes Agent 与 DeepSeek Harness 提供本地优先的长期记忆、三层检索、技能结晶和可观测管理面板。 ### 使用示例 - [知识库使用](/cn/openclaw/examples/knowledge_base): 在 MemOS Cloud 控制台创建知识库,并在 OpenClaw 云插件中配置知识库 ID 进行检索。 - [多智能体记忆隔离](/cn/openclaw/examples/multi_agent) - [记忆召回的二次过滤](/cn/openclaw/examples/recall_filter) - [本地插件使用](/cn/openclaw/examples/hermes_usage): MemOS 本地插件在 OpenClaw 与 Hermes 中的基础使用、工具调用、团队共享和多 Agent 场景示例。 ## API文档 ### 开始使用 - [概述](/cn/api_docs/start/overview) - [项目配置](/cn/api_docs/start/configuration): 了解项目、API Key、知识库关联和调用日志的关系,用于多项目管理、知识库绑定和配置排查。 ### 核心操作 - [Add Message](/cn/api_docs/core/add_message) `POST /add/message`: 该接口用于添加会话消息,支持多类型内容、批量添加。MemOS 会自动解析消息并处理记忆,用于后续对话时召回参考。 - [Search Memory](/cn/api_docs/core/search_memory) `POST /search/memory`: 该接口用于检索指定用户或 Agent 的记忆,返回与查询内容最相关的记忆片段。 - [Get Memories](/cn/api_docs/core/get_memory) `POST /get/memory`: 分页获取某个用户或 Agent 的记忆。 - [Get Memory](/cn/api_docs/core/get_memory_by_id) `GET /get/memory/{memory_id}`: 查询单条记忆信息。 - [Delete Memory](/cn/api_docs/core/delete_memory) `POST /delete/memory`: 删除指定用户或 Agent 的记忆,支持按 memory_ids 精确删除,或按 user_id/agent_id 清空全部记忆。 - [Update Memory](/cn/api_docs/core/update_memory) `POST /update/memory`: 手动修改一条已有记忆的内容、标题或状态。支持所有记忆种类,包括事实记忆、偏好记忆、事件记忆、属性记忆的属性值等。 - [Add Feedback](/cn/api_docs/message/add_feedback) `POST /add/feedback`: 该接口用于添加对当前会话消息的反馈,MemOS能够基于用户的反馈更正记忆。 ### 属性记忆 - [Add Profile Template](/cn/api_docs/core/add_profile_template) `POST /add/profile_template`: 在项目中创建属性记忆模板,返回模板 ID。创建成功后可通过绑定接口为用户或 Agent 创建属性记忆实例。 - [List Profile Templates](/cn/api_docs/core/list_profile_template) `POST /list/profile_template`: 分页返回项目内的属性记忆模板摘要,按创建时间倒序排列,创建时间相同的按模板 ID 倒序排列。 - [Get Profile Template](/cn/api_docs/core/get_profile_template) `POST /get/profile_template`: 返回指定属性记忆模板的完整结构和摘要信息。 - [Update Profile Template](/cn/api_docs/core/update_profile_template) `POST /update/profile_template`: 修改模板名称或属性结构,变更同步到所有绑定该模板的用户或 Agent 属性记忆。 - [Delete Profile Template](/cn/api_docs/core/delete_profile_template) `POST /delete/profile_template`: 删除属性记忆模板,同时删除该模板的全部有效实例和绑定关系,其他模板和记忆保持原状。只需删除某个用户或 Agent 的实例时,请使用 /delete/profile。 - [Bind Profile Template](/cn/api_docs/core/bind_profile_template) `POST /bind/profile_template`: 为用户或 Agent 绑定属性记忆模板,创建属性记忆实例。绑定后,后续添加消息时自动更新对应的属性字段值。 - [Edit Profile](/cn/api_docs/core/edit_profile) `POST /edit/profile`: 编辑属性记忆实例,支持新增字段、更新字段值、删除字段、锁定字段不被算法自动更新。只影响当前实例,不修改模板也不影响其他实例。 - [Delete Profile](/cn/api_docs/core/delete_profile) `POST /delete/profile`: 删除某个用户或 Agent 的属性记忆实例,该实例的所有字段值和绑定关系一并清除。不影响模板本身,也不影响其他主体的实例。 ### 自研模型 - [Extract Memory](/cn/api_docs/core/extract_memory) `POST /extract/memory`: 基于 MemOS 自研抽取模型,从对话消息中直接抽取并返回事实与偏好记忆。 - [Rerank](/cn/api_docs/core/rerank) `POST /rerank`: 提供记忆重排接口,基于 memos-reranker 小模型,传入用户查询与候选记忆列表,一键完成记忆相关性重排。 ### 消息 - [Get Message](/cn/api_docs/message/get_message) `POST /get/message`: 该接口用于获取指定会话的用户与助手历史对话记录,可按数量限制返回结果。 - [Get Task Status](/cn/api_docs/message/get_status) `POST /get/status`: 查询 add/message、add/feedback 等异步任务的处理状态。任务完成后返回 memory_views,汇总本次任务新增/更新/删除数量,以及各记忆种类下触达的记忆 ID。 ### 对话 - [Chat](/cn/api_docs/chat/chat) `POST /chat` ### 知识库 - [创建知识库](/cn/api_docs/knowledge/create_kb) `POST /create/knowledgebase`: 创建与项目关联的知识库 - [删除知识库](/cn/api_docs/knowledge/remove_kb) `POST /delete/knowledgebase`: 删除知识库,或解除知识库与当前项目的关联。 - [添加知识库文件](/cn/api_docs/knowledge/add_kb_doc) `POST /add/knowledgebase-file`: 向指定知识库上传文件。默认上传普通文档;当 file[].type 为 skill 时,上传 Markdown Skill 文件或 ZIP 技能包。 - [获取知识库文件](/cn/api_docs/knowledge/get_kb_doc) `POST /get/knowledgebase-file`: 通过两种方式获取文件信息:传 file_ids 获取指定文件详情,或传 knowledgebase_id 获取某个知识库下的文件列表。两种方式只能选择一种;同时传 knowledgebase_id 和 file_ids 会报错。 - [删除知识库文件](/cn/api_docs/knowledge/delete_kb_doc) `POST /delete/knowledgebase-file`: 从指定知识库中删除文件。删除 Skill 文件时,与该文件关联的 Skill 会同步删除。 ### 帮助与支持 - [错误码](/cn/api_docs/help/error_codes) ## 最佳实践 ### 技术教程 - [构建记忆增强型的知识库问答助手](/cn/usecase/knowledge_qa_assistant): 融合长期记忆与知识库,告别 “千人一面” 的检索结果,基于用户背景与偏好提供个性化、精准化解答,让知识库成为懂你的专属顾问。 - [让客服 Agent 记住用户:用 MemOS 实现跨会话客服记忆](/cn/usecase/customer_service_assistant): 分离用户记忆、Agent Skill 与政策知识库,让客服 Agent 跨会话延续用户事项,并复用通用处理流程。 - [让理财助手读懂客户行为背后的偏好](/cn/usecase/financial_assistant): 借助 MemOS,将用户的操作与对话行为抽象为“记忆”,从而识别并提炼背后的投资偏好,实现更懂客户的个性化服务。 - [有记忆的写作助手更好用](/cn/usecase/writting_assistant): 借助 MemOS,你的产品将自动记住用户的写作习惯与上下文,让创作过程更连贯、更省心。 - [构建拥有记忆的家庭生活助手](/cn/usecase/home_assistant): 在MemOS的加持下,家庭助手能把日常琐事与长期计划串联起来,快速理解并回应用户真正的需求。 - [Claude MCP](/cn/usecase/frameworks/claude_mcp) - [Coze 插件工具](/cn/usecase/frameworks/coze_plugin): Coze 插件工具直接访问MemOS云服务接口,快速为您的Agent添加长期记忆功能,让对话更贴心、更连续。 ### 博客 - [ChatGPT 升级后台记忆合成:企业 Agent 为什么需要独立的长期记忆基础设施?](/cn/usecase/blog/chatgpt_dreaming_long_term_memory) - [Memory Poisoning:企业 Agent 必须建立的六道长期记忆控制](/cn/usecase/blog/memory_poisoning_controls) - [长任务 Agent 的记忆管理,从会话恢复到经验复用](/cn/usecase/blog/long_task_agent_memory_management)