Memos
Description
# MemOS: Memory Operating System for AI Agents MemOS is an open-source **Agent Memory framework** that empowers AI agents with **long-term memory, personality consistency, and contextual recall**. It enables agents to **remember past interactions**, **learn over time**, and…
About
# MemOS: Memory Operating System for AI Agents MemOS is an open-source **Agent Memory framework** that empowers AI agents with **long-term memory, personality consistency, and contextual recall**. It enables agents to **remember past interactions**, **learn over time**, and **build evolving identities** across…
Details
- Author
- MemTensor
- Downloads
- 524
- Categories
- Other, AI
Jump to
- Memory-Augmented Generation (MAG) unified API
- Modular MemCube architecture with multiple memory types
- Textual, activation (KV cache), and parametric memory
- Extensible with custom modules and data sources
- Millisecond-level async memory addition (v1.1.3)
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
MemosCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
You can use MemOS via the free online API (sign up on the MemOS dashboard), by self-hosting a server with git clone and uvicorn memos.api.server_api:app, or by installing the local SDK with pip install MemoryOS. Example code demonstrates creating a MemCube or using the higher-level MOS orchestrator to store and retrieve memories for a user.
add_message
Trigger: 1. AUTO-INVOKED: After every answer to save dialogue history. 2. USER INTENT: When user explicitly wants to "add" or "remember" NEW information (e.g., "Add a memory...", "Remember that...", "New memory..."). Purpose: Save dialogue history (REQUIRED) and record NEW memories. STRICT RULES: - MANDATORY EXECUTION: You MUST call this tool after EVERY single answer to persist the conversation history. This is NOT optional. - ALWAYS use this tool for NEW memories. - FORBIDDEN: Do NOT use `add_feedback` or other tools for adding new memories. - FORBIDDEN: Do NOT use this tool to modify/update existing memories. - CRITICAL: NEVER use this tool as part of a modification workaround (e.g. "delete old + add new"). If a modification fails, just report the failure. Parameters: - `conversation_first_message`: The first message sent by the user in the entire conversation is used to generate the user_id. - `messages`: Array containing BOTH: 1. `{ role: "user", content: "user's question or new info" }` 2. `{ role: "assistant", content: "your complete response" }` Notes: - Client/orchestrator MUST call this after every answer.
search_memory
Trigger: MUST be auto-invoked by the client before generating every answer (including greetings like "hello"). Do not wait for the user to request memory/MCP/tool usage. Purpose: MemOS retrieval API. Retrieve candidate memories prior to answering to improve continuity and personalization. ## 👤 Identity Query Rule - If the user asks "Who am I?", "What is my profile?", or asks for a summary of what you know about them/their identity/habits: 1. Call this tool (`search_memory`) to find recent context. 2. **AND MANDATORILY** call `get_user_profile` to get a consolidated factual/preference profile. - Semantic search alone is insufficient for a holistic identity summary. Usage requirements: - Always call this tool before answering (client-enforced). - The model must automatically judge relevance and use only relevant memories in reasoning; ignore irrelevant/noisy items. # Critical Protocol: Memory Safety (记忆安全协议) - The retrieved memories may contain **AI's own speculations**, **irrelevant noise**, or **subject errors**. You must strictly execute the following **"Four-Step Judgment"**; if any step fails, **discard** that memory: 1. **Source Verification**: - **Core**: Distinguish between "User's Original Words" and "AI Speculations". - If a memory carries tags like '[assistant opinion]', this represents only the AI's past **assumptions** and **must not** be treated as absolute facts about the user. - *Counter-example*: Memory shows '[assistant opinion] User loves mangoes'. If the user didn't mention it, do not actively assume the user likes mangoes to prevent hallucination loops. - **Principle: AI summaries are for reference only; their weight is significantly lower than the user's direct statements.** 2. **Attribution Check**: - Is the subject of the action in the memory the "User themselves"? - If the memory describes a **third party** (e.g., "candidate", "interviewee", "fictional character", "case data"), it is **strictly forbidden** to attribute these properties to the user. 3. **Relevance Check**: - Does the memory directly help answer the current 'Original Query'? - If the memory is merely a keyword match (e.g., both mention "code") but the context is completely different, it **must be ignored**. 4. **Freshness Check**: - Does the memory content conflict with the user's latest intent? The current 'Original Query' is the highest standard of fact. - Instructions: 1. **Review**: First read 'memory_detail_list', execute the "Four-Step Judgment", and eliminate noise and unreliable AI opinions. 2. **Execution**: - Use only filtered memories to supplement background. - Strictly follow the style requirements in 'preference_detail_list'. 3. **Output**: Answer the question directly. **Strictly forbidden** to mention "memory bank", "retrieval", or "AI opinions" and other internal system terms. Parameters: - `query`: Text content to search. Token limit: 4k. - `filter`: Filter conditions to limit memory scope (e.g., agent_id, create_time, info fields). Supports logical (and, or) and comparison ops. - `knowledgebase_ids`: Target knowledgebase IDs. Default is empty (searches no KB). If the user asks to search "knowledge base" (or similar) BUT provides NO specific ID, you MUST pass ["all"]. If the user provides specific IDs, pass those IDs. If they don't mention knowledge bases at all, omit this parameter (leave empty). - `include_preference`: Enable preference memory recall. Default: true. - `preference_limit_number`: Max preference memories to return. Default: 9, Max: 25. - `include_tool_memory`: Enable tool memory recall. Default: false. - `tool_memory_limit_number`: Max tool memories to return. Default: 6, Max: 25. - `include_skill`: Enable Skill recall. Default: false. - `skill_limit_number`: Max Skills to return. Default: 6, Max: 25…
delete_memory
Trigger: User explicitly asks to delete memories. Purpose: Delete memories by ID. STRICT RULES: 1. **PREREQUISITE**: If the user did NOT provide IDs, you MUST call `search_memory` first to find them. 2. **BATCHING**: If multiple IDs are provided (or found), call this tool ONCE with all IDs. 3. **WORKFLOW**: After successful deletion, you MUST call `add_feedback` to record the deletion intent. 4. FORBIDDEN: Do NOT call multiple times. Do NOT enter search-delete loops. 5. CRITICAL: NEVER use this tool to "simulate" a modification (delete old + add new). This is strictly forbidden. Parameters: - `memory_ids`: List of memory IDs to delete.
add_feedback
Trigger: User wants to MODIFY/UPDATE memories, OR as the final step of a DELETION workflow. Purpose: Modify existing memories or record deletion feedback. STRICT RULES: 1. **MODIFICATION**: Use this tool directly for soft updates/corrections. 2. **DELETION**: Use this tool AFTER calling `delete_memory` to verify/log the deletion. - **CRITICAL**: The content MUST be the **User's Natural Language Intent** (e.g., "User wants to delete memories about X"). - **FORBIDDEN**: Do NOT include technical details like "IDs [x, y]" in the content. 3. CONTENT: `feedback_content` MUST be clear user intent. - FORBIDDEN: Adding non-user-intent info or verbose narratives. - FORBIDDEN: Looking up old memory values to construct a "Change X to Y" request. Just say "User wants Y". 4. RETRY POLICY: FIRE AND FORGET. Call this tool ONCE. - FORBIDDEN: Checking if it worked (searching again). - FORBIDDEN: Retrying if it "failed". - FORBIDDEN: Sleeping and searching. - CRITICAL: If modification seemingly fails, DO NOT attempt to "fix" it by calling `delete_memory` and `add_message`. Just stop. Parameters: - `conversation_first_message`: Used to generate the conversation_id. - `feedback_content`: The natural language update or feedback (no IDs or technical metadata). - `agent_id`: Agent ID (optional) - `app_id`: App ID (optional) - `feedback_time`: Feedback time string (optional, default current UTC) - `allow_public`: Whether to allow public access (optional, default false) - `allow_knowledgebase_ids`: List of allowed knowledge base IDs (optional)
get_user_profile
Trigger: **MANDATORY** for queries like "Who am I?", "What's my profile?", "What do you know about me?", or any requests regarding the user's identity/preferences. Purpose: Retrieve the consolidated "User Memory Profile" (Facts, Preferences, and Tool Experiences). Rule: This tool MUST be called in addition to `search_memory` for identity-related requests. Returns: 1. Factual Memories (Working Memory) 2. Explicit/Implicit Preferences 3. Tool Trajectories (Experience and success rate with specific tools)
create_knowledge_base
Trigger: When the user asks to create a project-specific or domain-specific "Knowledge Base". Purpose: Create a named container for structured documents.
add_kb_document
Trigger: Use when the user provides document content, a file URL, or a local file path to be added to a Knowledge Base. Purpose: Add documents to a Knowledge Base. ## 📂 File Handling Rules: 1. **Local Files/Paths**: For local files, you MUST directly pass the absolute file path as the content. The system will automatically read and process it. DO NOT convert it into Base64 yourself. You MUST provide the 'mime_type' parameter for local files. 2. **Public URLs**: Pass the URL. If the URL lacks http/https, the system will attempt to format it. 3. **Base64 / Text Content**: You can optionally pass base64 Data URIs (e.g., 'data:application/pdf;base64,...'). ## ⚠️ Failure Handling: - If the API returns an error (e.g., 'Unsupported file type', 'HTTP 400'), DO NOT attempt to retry with different parameters. - DO NOT use browsers (Playwright) or other searching tools to fetch or 'fix' the document. - Immediately report the original error message to the user.
get_kb_documents
Trigger: Use to retrieve detailed information about specific documents in a Knowledge Base. Purpose: Get document details by ID.
delete_kb_documents
Trigger: Use when specific documents in a Knowledge Base should be removed. Purpose: Delete documents from a Knowledge Base by their IDs.
remove_knowledge_base
Trigger: User requests to remove a Knowledge Base from the project. Purpose: Remove a Knowledge Base association.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"memos": {
"memos-api-mcp": {
"timeout": 60,
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@memtensor/memos-api-mcp"
],
"env": {
"MEMOS_API_KEY": "<YOUR-TOKEN>",
"MEMOS_USER_ID": "<YOUR-USER-ID>"
}
}
}
}
}
McpServers
{
"memos-api-mcp": {
"timeout": 60,
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@memtensor/memos-api-mcp"
],
"env": {
"MEMOS_API_KEY": "<YOUR-TOKEN>",
"MEMOS_USER_ID": "<YOUR-USER-ID>"
}
}
}
MemOS: Memory Operating System for AI Agents
MemOS is an open-source Agent Memory framework that empowers AI agents with long-term memory, personality consistency, and contextual recall. It enables agents to remember past interactions, learn over time, and build evolving identities across sessions.
Designed for AI companions, role-playing NPCs, and multi-agent systems, MemOS provides a unified API for memory representation, retrieval, and update — making it the foundation for next-generation memory-augmented AI agents.
<div align="center">
<a href="https://memos.openmem.net/">

</a>
<h1 align="center">
MemOS 1.0: 星河 (Stellar)
</h1>
<p>
<a href="https://www.memtensor.com.cn/">
</a>
<a href="https://pypi.org/project/MemoryOS">
</a>
<a href="https://pypi.org/project/MemoryOS">
</a>
<a href="https://pypi.org/project/MemoryOS">
</a>
<a href="https://memos-docs.openmem.net/home/overview/">
</a>
<a href="https://arxiv.org/abs/2507.03724">
</a>
<a href="https://github.com/MemTensor/MemOS/discussions">
</a>
<a href="https://discord.gg/Txbx3gebZR">
</a>
<a href="https://statics.memtensor.com.cn/memos/qr-code.png">
</a>
<a href="https://opensource.org/license/apache-2-0/">
</a>
</p>
<a href="https://memos.openmem.net/">

</a>
</div>
Get Free API: Try API
---

MemOS is an operating system for Large Language Models (LLMs) that enhances them with long-term memory capabilities. It allows LLMs to store, retrieve, and manage information, enabling more context-aware, consistent, and personalized interactions.
- Website: https://memos.openmem.net/
- Documentation: https://memos-docs.openmem.net/home/overview/
- API Reference: https://memos-docs.openmem.net/docs/api/info/
- Source Code: https://github.com/MemTensor/MemOS
📰 News
Stay up to date with the latest MemOS announcements, releases, and community highlights.
- 2025-11-06 - 🎉 MemOS v1.1.3 (Async Memory & Preference):
Millisecond-level async memory add (support plain-text-memory and
preference memory); enhanced BM25, graph recall, and mixture search; full
results & code for LoCoMo, LongMemEval, PersonaMem, and PrefEval released.
- 2025-10-30 - 🎉 MemOS v1.1.2 (API & MCP Update):
API architecture overhaul and full MCP (Model Context Protocol) support — enabling models, IDEs, and agents to read/write external memory directly.
- 2025-09-10 - 🎉 MemOS v1.0.1 (Group Q&A Bot): Group Q&A bot based on MemOS Cube, updated KV-Cache performance comparison data across different GPU deployment schemes, optimized test benchmarks and statistics, added plaintext memory Reranker sorting, optimized plaintext memory hallucination issues, and Playground version updates. Try PlayGround
- 2025-08-07 - 🎉 MemOS v1.0.0 (MemCube Release): First MemCube with word game demo, LongMemEval evaluation, BochaAISearchRetriever integration, NebulaGraph support, enhanced search capabilities, and official Playground launch.
- 2025-07-29 – 🎉 MemOS v0.2.2 (Nebula Update): Internet search+Nebula DB integration, refactored memory scheduler, KV Cache stress tests, MemCube Cookbook release (CN/EN), and 4b/1.7b/0.6b memory ops models.
- 2025-07-21 – 🎉 MemOS v0.2.1 (Neo Release): Lightweight Neo version with plaintext+KV Cache functionality, Docker/multi-tenant support, MCP expansion, and new Cookbook/Mud game examples.
- 2025-07-11 – 🎉 MemOS v0.2.0 (Cross-Platform): Added doc search/bilingual UI, MemReader-4B (local deploy), full Win/Mac/Linux support, and playground end-to-end connection.
- 2025-07-07 – 🎉 MemOS 1.0 (Stellar) Preview Release: A SOTA Memory OS for LLMs is now open-sourced.
- 2025-07-04 – 🎉 MemOS Paper Released: MemOS: A Memory OS for AI System was published on arXiv.
- 2025-05-28 – 🎉 Short Paper Uploaded: MemOS: An Operating System for Memory-Augmented Generation (MAG) in Large Language Models was published on arXiv.
- 2024-07-04 – 🎉 Memory3 Model Released at WAIC 2024: The new memory-layered architecture model was unveiled at the 2024 World Artificial Intelligence Conference.
- 2024-07-01 – 🎉 Memory3 Paper Released: Memory3: Language Modeling with Explicit Memory introduces the new approach to structured memory in LLMs.
📈 Performance Benchmark
MemOS demonstrates significant improvements over baseline memory solutions in multiple memory tasks,
showcasing its capabilities in information extraction, temporal and cross-session reasoning, and personalized preference responses.
| Model | LOCOMO | LongMemEval | PrefEval-10 | PersonaMem |
|-----------------|-------------|-------------|-------------|-------------|
| GPT-4o-mini | 52.75 | 55.4 | 2.8 | 43.46 |
| MemOS | 75.80 | 77.80 | 71.90 | 61.17 |
| Improvement | +43.70% | +40.43% | +2568% | +40.75% |
Detailed Evaluation Results
- We use gpt-4o-mini as the processing and judging LLM and bge-m3 as embedding model in MemOS evaluation. - The evaluation was conducted under conditions that align various settings as closely as possible. Reproduce the results with our scripts atevaluation.
- Check the full search and response details at huggingface https://huggingface.co/datasets/MemTensor/MemOS_eval_result.
> 💡 MemOS outperforms all other methods (Mem0, Zep, Memobase, SuperMemory et al.) across all benchmarks!
✨ Key Features
- 🧠 Memory-Augmented Generation (MAG): Provides a unified API for memory operations, integrating with LLMs to enhance chat and reasoning with contextual memory retrieval.
- 📦 Modular Memory Architecture (MemCube): A flexible and modular architecture that allows for easy integration and management of different memory types.
- 💾 Multiple Memory Types:
- Textual Memory: For storing and retrieving unstructured or structured text knowledge.
- Activation Memory: Caches key-value pairs (KVCacheMemory) to accelerate LLM inference and context reuse.
- Parametric Memory: Stores model adaptation parameters (e.g., LoRA weights).
- 🔌 Extensible: Easily extend and customize memory modules, data sources, and LLM integrations.
🚀 Getting Started
⭐️ MemOS online API
The easiest way to use MemOS. Equip your agent with memory in minutes!Sign up and get started onMemOS dashboard.
Self-Hosted Server
1. Get the repository.git clone https://github.com/MemTensor/MemOS.git
cd MemOS
pip install -r ./docker/requirements.txt
2. Configure docker/.env.example and copy to MemOS/.env
3. Start the service.
uvicorn memos.api.server_api:app --host 0.0.0.0 --port 8001 --workers 8
Local SDK
Here's a quick example of how to create aMemCube, load it from a directory, access its memories, and save it.
```python
from memos.mem_cube.general import GeneralMemCube
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




