Provides local four-layer long-term memory for DeepSeek Harness (L1 trajectory / L2 strategy / L3 world model / skills), with automatic retrieval each user turn and support for registering six memory tools.
$ dsh plugin --profile web add github:MemTensor/MemOS/apps/memos-local-pluginRun the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial
MemOS 为 DeepSeek Harness 注入本地优先的长期记忆能力:通过 SQLite 把每轮对话、工具结果、用户反馈沉淀为可检索的四层记忆,并在每个用户轮次自动把相关历史回填到上下文,让 DSH 具备跨会话的连续性。
<memos_context> 形式注入到模型提示中memos_search / memos_get / memos_timeline / memos_environment / memos_skill_list / memos_skill_get),供模型主动查询或加载更详细的历史127.0.0.1:18801),可视化浏览和编辑记忆数据@deepseek-ai/cordis(Cordis 注入容器)、better-sqlite3(本地存储)、@huggingface/transformers(本地向量嵌入)、@preact/signals + Vite Viewer(面板 UI)agent/pre-step / session/event / session/disposed 等宿主事件钩子串联自动检索与后台捕获,并通过 DSH 的 tools 服务注册记忆工具apps/memos-local-plugin/adapters/deepseek-harness/index.ts(apply 钩子),由 cordis.patch.yml 注入到 Cordis bundle 栈当用户希望 DeepSeek Harness 的对话能够在多次会话之间保持上下文连续性,或者希望把项目知识、工具调用结果沉淀为可复用的私有记忆时使用。它特别适合长周期项目协作、个人知识库累积、以及需要让模型记住用户偏好与历史决策的工作流。
| 依赖 | 最低版本 | 说明 |
|---|---|---|
| DeepSeek Harness | >=0.1.0-rc.5 <0.2.0 | 宿主平台,DSH 仍在开发者预览,跨预览版可能需调整适配器 |
| Node.js | ^22.19.0 || >=24.0.0 | DSH 0.1.0-rc.5 的硬性要求,覆盖包自身声明的 >=20.0.0 |
| pnpm | 11.7.0 | 用于原生依赖构建脚本审批;一键安装器在缺失时会临时下载,结束后清理 |
| 平台 | macOS / Linux | 一键安装脚本仅支持 macOS+Linux;Windows 用户可走 DSH 原生 dsh plugin 流 |
| 原生模块 | better-sqlite3、onnxruntime-node、esbuild、sharp | 均为 pnpm 11 需要在 pnpm-workspace.yaml 中显式 allowBuilds 的构建脚本包 |
dsh plugin --profile web add github:MemTensor/MemOS/apps/memos-local-plugin
安装完成后需重启当前 DSH profile(Ctrl+C/SIGINT 或 SIGTERM 后再次启动)才能使新 bundle 生效。
插件通过 Cordis 的 memos-local-memory 行接收配置,可直接修改 $DSH_HOME/profiles/<profile>/cordis.patch.yml 覆盖默认值。注意:DSH 的 patch 层是整体替换 config,覆盖时需要保留全部字段。
| 配置 | 类型 | 说明 | 默认值 |
|---|---|---|---|
enabled | boolean | 是否挂载该适配器;关闭后插件完全不生效 | true |
profileId | string | 命名空间回退标识;带 agentPreset 的会话会以会话值为准 | default |
home | string | 运行时根目录;留空时为 $DSH_HOME/memos-plugin/(默认 ~/.dsh/memos-plugin/) | "" |
recallEnabled | boolean | 是否对每个被接受的非空用户轮次执行自动检索;同轮重复进入会去重 | true |
captureEnabled | boolean | 是否在轮次与工具完成后异步写入数据库 | true |
toolsEnabled | boolean | 是否注册六个 memos_* 工具供模型调用;关闭后只能靠自动检索 | true |
hostLlmEnabled | boolean | 是否在 MemOS 未显式配置 LLM 时复用 DSH 已配置的模型与凭据 | true |
viewerEnabled | boolean | 是否启用本地 HTTP/SSE Viewer;关闭后只有无头记忆运行时 | true |
viewerPort | number | Viewer 监听端口(1–65535),多 profile 共存需分配不同端口 | 18801 |
recallTimeoutMs | number | 自动检索与 memos_search 共享的请求超时(毫秒,最小 100);实际生效上限 3000ms | 3000 |
contextMaxChars | number | 注入到模型的 <memos_context> 内容上限(最小 256) | 6000 |
toolResultMaxChars | number | 记忆工具返回给模型的结果体上限(最小 128) | 1200 |
failOnStartupError | boolean | 启动失败时是否中断 DSH profile 启动;默认只记警告继续运行 | false |
Q: 卸载插件会一并删除记忆数据吗?
A: 不会。dsh plugin remove 只移除依赖与 bundle 层,运行时目录($DSH_HOME/memos-plugin/)下的 data/、skills/、config.yaml 会保留下来供重新安装时复用;只有手动删除目录才会清空记忆。
Q: 安装后是否需要单独配置 API Key?
A: 默认情况下 MemOS 会复用宿主 DSH 已配置的模型凭据,无需在 MemOS 中重复填写;只有在 config.yaml 显式设置了非空的 llm.provider 时,才会使用该 provider 自身的凭据。
Q: 升级插件版本或调整 config.yaml 后需要做什么?
A: 需要重启当前 DSH profile 才能生效;DSH 不会在运行中自动发现新安装的包,导入的模块也会在进程生命周期内被缓存。Viewer 内的 Settings 保存 config.yaml 也会提示需要手动重启宿主。
Q: 自动检索每次都会触发吗?问候语会被跳过吗?
A: 不会跳过。所有被接受的非空用户轮次(含 hello 等问候语,以及恢复的会话与 fork)都会触发一次自动检索;同轮重复进入会做去重,插件与工具生成的消息不会触发。
Q: Viewer 面板能远程访问吗?
A: 不能。Viewer 仅绑定 127.0.0.1 或 localhost 的回环地址,配置文件中 viewer.bindHost 设置为非回环地址会被拒绝;不要把回环端口放到反向代理或隧道后。Viewer 没有内置身份认证,开启密码保护需要写入 .auth.json。
Q: 多 DSH profile 同时启用 Viewer 会有冲突吗?
A: 会。多 profile 不能共用同一个 Viewer 端口,需要分配不同的 viewerPort 或仅在一个 profile 中启用 Viewer;不同 profile 共享同一运行时目录时会共用底层记忆,浏览器 cookie 在同主机不同端口间共享,注意登录态互相覆盖。
入门 — 仅需一条 dsh plugin 安装命令即可获得自动检索能力,无需手工配置 API Key 或数据库;进阶用户可按需调整 Cordis 配置项或 config.yaml 中的 LLM、embedder、viewer 等设置。
127.0.0.1:18801,不支持远程访问;多 profile 不能共享同一端口,浏览器 cookie 跨端口共享会互相覆盖登录态agent/request 之前,因此只能读到上一次持久化的请求路由;如果不存在则使用 agent 公开默认host 时这两个后台任务会被禁用2.0.16-beta.1 等版本时 pnpm 11 会拦截原生模块构建脚本,需要在 pnpm-workspace.yaml 中明确允许 better-sqlite3、esbuild、onnxruntime-node、sharp;protobufjs 与 MemOS 自带的 postinstall 提示脚本不应允许process.exit() 时存在析构崩溃,使用本地嵌入的 profile 不能降级该组合
[!TIP] New: Connect MemOS to DeepSeek Harness (
dsh)Add automatic recall, background capture, hybrid retrieval, and a local Memory Viewer to DeepSeek Harness—powered by the same MemOS core used across agent ecosystems.
MemOS is a Memory Operating System for LLMs and AI agents that unifies store / retrieve / manage for long-term memory, enabling context-aware and personalized interactions with KB, multi-modal, tool memory, and enterprise-grade optimizations built in.
2026-08-17 · 🐋 MemOS Connects with DeepSeek Harness MemOS now brings persistent memory to DeepSeek Harness through both local and cloud plugins. DSH can automatically recall relevant context before a task and retain new experience after a successful turn, without modifying its core.
2026-07-02 · 🏆 MemOS Advances Agent and User Memory Benchmarks With MemOS, OpenClaw improves average task completion from 36.63% to 50.87% across five agent tasks. MemOS also achieves 88.83 on LoCoMo and 89.20 on LongMemEval, and leads in OmniMemEval, a unified evaluation of 14 commercial memory products across ten datasets.
2026-05-09 · 🧠 memos-local-plugin 2.0 Official local memory plugin for Hermes Agent and OpenClaw. One core powers self-evolving memory across L1 traces, L2 policies, L3 world models, and crystallized Skills, with local-first storage and feedback-driven retrieval.
2026-04-10 · 👧🏻 MemOS Hermes Agent Local Plugin Official Hermes Agent memory plugins launched: Hybrid retrieval (FTS5 + vector), smart dedup, tiered skill evolution, multi-agent collaboration. 100% local, zero cloud dependency.
2026-03-08 · 🦞 MemOS OpenClaw Plugin — Cloud & Local
Official OpenClaw memory plugins launched. Cloud Plugin: hosted memory service with 72% lower token usage and multi-agent memory sharing (MemOS-Cloud-OpenClaw-Plugin). Local Plugin (v1.0.0): 100% on-device memory with persistent SQLite, hybrid search (FTS5 + vector), task summarization & skill evolution, multi-agent collaboration, and a full Memory Viewer dashboard.
MemOS leads across multiple benchmarks — evaluated against mainstream commercial memory products across 5 user memory and 5 agent memory tasks.
| Benchmark | Score |
|---|---|
| LoCoMo | 88.83 |
| LongMemEval | 89.20 |
| PersonaMem v2 | 40.58 |
| HaluMem | 80.91 |
| BEAM-10M | 56.75 |
| GDPVal | 62.07 |
| LiveCodeBench | 64.96 |
| OmniMath | 61.00 |
| SWE-Bench | 38.46 |
| BrowseComp-Plus | 23.85 |
Evaluated via OmniMemEval — https://github.com/MemTensor/OmniMemEval.
MemOS gives AI agents long-term memory. Common uses:
MemOS is built around four entry points. Pick the one that matches your scenario.
| Cloud API | Self-Host | MemOS Cloud Plugin | Local Plugin | |
|---|---|---|---|---|
| Best for | Your app, fully managed | Teams on own infra | OpenClaw users, zero ops | DeepSeek Harness, Hermes, or OpenClaw; on-device |
| Setup | Get an API key | docker compose up | openclaw plugins install | npm install + agent-specific setup |
| Infra needed | None (hosted) | Neo4j + Qdrant | None (uses MemOS Cloud) | None (local SQLite) |
| Data lives | MemOS Cloud | Your servers | MemOS Cloud | Your machine |
You want to add memory to your app through a fully managed service — no infrastructure to run.
1. Get an API key:
mpg-). Keep it server-side.2. Add and search memories:
import requests
API_KEY = "mpg-..." # keep this server-side
base = "https://memos.memtensor.cn/api/openmem/v1"
headers = {"Authorization": f"Token {API_KEY}", "Content-Type": "application/json"}
# 1. Add a memory
requests.post(f"{base}/add/message", headers=headers, json={
"user_id": "alice",
"conversation_id": "conv_001",
"messages": [{"role": "user", "content": "I like strawberry"}],
})
# 2. Search memories
res = requests.post(f"{base}/search/memory", headers=headers, json={
"query": "What do I like?",
"user_id": "alice",
})
print(res.json())
Next steps:
You want to run MemOS as a REST service on your own machine or cluster.
Option A — Docker (recommended):
git clone https://github.com/MemTensor/MemOS.git
cd MemOS
cp docker/.env.example .env # fill in your API keys in .env
cd docker
docker compose up # starts MemOS API + Neo4j + Qdrant
The API is served at http://localhost:8000.
Option B — Run with uvicorn (without Docker):
git clone https://github.com/MemTensor/MemOS.git
cd MemOS
cp docker/.env.example .env # fill in your API keys in .env
# Ensure Neo4j and Qdrant are running, then:
cd src
uvicorn memos.api.server_api:app --host 0.0.0.0 --port 8000 --workers 1
See [docker/.env.example](./docker/.env.example) for all configuration options (LLM provider, embedder, vector DB, graph DB, scheduler). The full deployment guide is at https://memos-docs.openmem.net/open_source/getting_started/rest_api_server/.
Try the API:
import requests, json
headers = {"Content-Type": "application/json"}
base = "http://localhost:8000/product"
# 1. Create a memory cube
requests.post(f"{base}/create_cube", headers=headers, data=json.dumps({
"cube_name": "Alice's memory",
"owner_id": "alice",
"cube_id": "alice_cube",
}))
# 2. Add a memory
requests.post(f"{base}/add", headers=headers, data=json.dumps({
"user_id": "alice",
"writable_cube_ids": ["alice_cube"],
"messages": [{"role": "user", "content": "I like strawberry"}],
"async_mode": "sync",
}))
# 3. Search memories
res = requests.post(f"{base}/search", headers=headers, data=json.dumps({
"query": "What do I like?",
"user_id": "alice",
"readable_cube_ids": ["alice_cube"],
}))
print(res.json())
MemOS gives OpenClaw, Hermes, and DeepSeek Harness a shared local memory core; the managed MemOS Cloud Plugin is available for OpenClaw and DeepSeek Harness 🏃🏻
| 🔌 Plugin | 💡 Core Features | 🧩 Resources |
|---|---|---|
| 🧠 memos-local-plugin 2.0 | 🌐 Website · 📖 Docs · 🐙 GitHub · 📦 NPM | |
| ☁️ MemOS Cloud Plugin | 🖥️ MemOS Dashboard · 📖 Full Tutorial |
Use MemOS Cloud for persistent memory in OpenClaw or DeepSeek Harness — no infrastructure to run.
apps/MemOS-Cloud-OpenClaw-Plugin[@memtensor/memos-cloud-openclaw-plugin](https://www.npmjs.com/package/@memtensor/memos-cloud-openclaw-plugin)Install:
openclaw plugins install @memtensor/memos-cloud-openclaw-plugin@latest
openclaw gateway restart
The plugin recalls memories from MemOS Cloud before each agent run and saves new messages back after the run ends.
Connect DeepSeek Harness to MemOS Cloud through its native plugin mechanism. Before the first model step of each user request, the plugin recalls relevant cloud memories; after a successful turn, it saves the new user and assistant messages back to MemOS Cloud.
Install the cloud plugin into the default DSH web profile:
npx @deepseek-ai/dsh plugin --profile web add @memtensor/memos-cloud-dsh-plugin@latest
Add the API Key to ~/.dsh/.credentials.yaml:
MEMOS_API_KEY: mpg-your-key
Add the minimal plugin configuration to ~/.dsh/settings.yaml:
memos-cloud:
apiKeyEnv: MEMOS_API_KEY
Restart the DSH Web profile:
npx @deepseek-ai/dsh web
The cloud plugin is fail-open: a temporary MemOS Cloud outage does not interrupt the current DSH task.
You use DeepSeek Harness, Hermes Agent, or OpenClaw and want 100% on-device memory — nothing leaves your machine.
apps/memos-local-plugin[@memtensor/memos-local-plugin](https://www.npmjs.com/package/@memtensor/memos-local-plugin)apps/memos-local-plugin/viewer/Install for DeepSeek Harness (macOS / Linux):
curl -fsSL https://raw.githubusercontent.com/MemTensor/MemOS/main/apps/memos-local-plugin/install.sh | bash -s -- --agent dsh --profile web
Install for OpenClaw or Hermes (macOS / Linux):
curl -fsSL https://raw.githubusercontent.com/MemTensor/MemOS/main/apps/memos-local-plugin/install.sh | bash
Install (Windows PowerShell):
irm https://raw.githubusercontent.com/MemTensor/MemOS/main/apps/memos-local-plugin/install.ps1 -OutFile "$env:TEMP\memos-install.ps1"; powershell -ExecutionPolicy Bypass -File "$env:TEMP\memos-install.ps1"
Requires Node.js and an already-installed DeepSeek Harness, OpenClaw, or Hermes. The installer deploys MemOS to the selected agent runtime; the DeepSeek Harness target installs it as an out-of-tree DSH bundle, while the OpenClaw and Hermes targets write the initial config.yaml in their respective agent homes.
Features: hybrid retrieval (FTS5 + vector), smart dedup, tiered skill evolution (L1 traces / L2 policies / L3 world model), multi-agent collaboration, local-first SQLite storage.
If you use MemOS in your research, please cite:
@article{li2025memos_long,
title={MemOS: A Memory OS for AI System},
author={Li, Zhiyu and Song, Shichao and Xi, Chenyang and Wang, Hanyu and Tang, Chen and Niu, Simin and Chen, Ding and Yang, Jiawei and Li, Chunyu and Yu, Qingchen and Zhao, Jihao and Wang, Yezhaohui and Liu, Peng and Lin, Zehao and Wang, Pengyuan and Huo, Jiahao and Chen, Tianyi and Chen, Kai and Li, Kehang and Tao, Zhen and Ren, Junpeng and Lai, Huayi and Wu, Hao and Tang, Bo and Wang, Zhenren and Fan, Zhaoxin and Zhang, Ningyu and Zhang, Linfeng and Yan, Junchi and Yang, Mingchuan and Xu, Tong and Xu, Wei and Chen, Huajun and Wang, Haofeng and Yang, Hongkang and Zhang, Wentao and Xu, Zhi-Qin John and Chen, Siheng and Xiong, Feiyu},
journal={arXiv preprint arXiv:2507.03724},
year={2025},
url={https://arxiv.org/abs/2507.03724}
}
@article{li2025memos_short,
title={MemOS: An Operating System for Memory-Augmented Generation (MAG) in Large Language Models},
author={Li, Zhiyu and Song, Shichao and Wang, Hanyu and Niu, Simin and Chen, Ding and Yang, Jiawei and Xi, Chenyang and Lai, Huayi and Zhao, Jihao and Wang, Yezhaohui and others},
journal={arXiv preprint arXiv:2505.22101},
year={2025},
url={https://arxiv.org/abs/2505.22101}
}
MemOS is licensed under the Apache 2.0 License.