baaai123/dsh-memory-protocol
DeepSeek Harness 的内存强制插件——将 opencode-memory MCP 服务器与硬协议门桥接
Project Overview项目介绍
dsh-memory-protocol is a native long-term memory plugin built exclusively for DeepSeek Harness. It ships with two core components: the memory-mcp bridge that connects the opencode-memory Python MCP server via DeepSeek Harness’s official MCP client, and the memory-protocol plugin that enforces a structured memory workflow. The memory-mcp component exposes 15 memory-related tools, including weave, search, ingest, classify, and teach_skill, directly to the DSH agent. It is pre-packaged with a DSH bundle manifest, so installation works out of the box via the DSH CLI.
This plugin is designed to fix the common problem of AI agents forgetting past context and starting problem-solving from scratch every new conversation. It follows a strict three-step workflow to maintain persistent memory: it blocks any tool calls that happen before weaving existing memory into the context, automatically weaves and injects memory at the start of each agent step, and automatically ingests new conversation content into the memory bank after each turn. It is intended for any DeepSeek Harness user that wants persistent long-term memory for their agent workflows, to avoid repeating the same learning steps across conversations.
The plugin requires a Python environment, the opencode-memory MCP server, and the BAAI/bge-large-en-v1.5 embedding model (around 1.3GB) to function fully. On first launch, it will automatically bootstrap all dependencies and download the model, but users can set environment variables like MEMORY_SKIP_BOOTSTRAP=1 to disable automatic setup, or customize paths for the Python interpreter, memory database, and embedding model. The project is released under the open-source MIT license, so it is free to use and modify. If Python is not detected on first run, it runs in fail-open mode and shows a one-time setup prompt instead of blocking the agent.
dsh-memory-protocol 是专为 DeepSeek Harness 打造的原生长期记忆插件,包含两个核心组件:一是通过 DSH 官方 MCP 客户端桥接 opencode-memory Python MCP 服务器的 memory-mcp 模块,提供 weave、搜索、导入、分类等 15 个记忆相关工具;二是强制执行记忆流程的 memory-protocol 协议插件。该插件自带 DSH bundle 清单,可直接通过 DSH 官方插件命令安装。
该插件的核心作用是解决大语言模型对话中反复遗忘、从零开始重复学习的问题,标准工作流程分为三步:工具调用前先检查是否已经 weave 整合记忆,未完成则直接拒绝调用;每轮对话开始前自动 weave 并注入历史记忆上下文;每轮对话结束后自动将新对话内容导入持久化记忆库。主要面向需要长期记忆能力的 DeepSeek Harness 用户。
该插件依赖 Python 环境、opencode-memory 的 MCP 服务端以及 BAAI/bge-large-en-v1.5 嵌入模型,首次启动会自动引导完成依赖安装和模型下载,也支持手动配置环境变量跳过自动引导步骤、自定义Python路径、记忆库路径等。项目采用 MIT 许可证开源,完全免费使用。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-memory-protocol(baaai123/dsh-memory-protocol)
仓库:https://github.com/baaai123/dsh-memory-protocol
本站详情页:https://www.yhbd.top/plugins/baaai123-dsh-memory-protocol/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证未声明 · ⭐ 2 · 最近提交 2026-09-05 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
- Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add dsh-memory-protocol
把 baaai123/dsh-memory-protocol 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-memory-protocol
为 DeepSeek Harness 打造的长期记忆插件 — 桥接 opencode-memory MCP 服务器,并附加强制记忆协议。
哼,杂鱼又忘事了吧? 工具调用前先给我 weave 记忆、每轮对话自动存档——省得你三秒重置、重复学习。才、才不是特地为你准备的,只是看不得你每次从零开始犯蠢。
作用
这个 bundle 装两样东西:
- memory-mcp — 通过官方
@deepseek-ai/dsh-mcp-client桥接 opencode-memory 的 Python MCP 服务器(15 个memory_*工具:weave/search/ingest/classify/teach_skill 等) - memory-protocol — 强制协议插件,三个 hook:
tools/pre-execute— 未 weave 就调其他工具 → 硬拒绝agent/pre-step— 每轮自动 weave 并注入记忆上下文agent/turn-stopping— 每轮自动 ingest 对话
安装
前置依赖:Python MCP server(memory-skill)+ 嵌入模型(bge-large-en-v1.5)。插件启动时会自动引导安装(npm run bootstrap 或插件 autoBootstrap);也可手动安装(下面的命令)。可用 MEMORY_SKIP_BOOTSTRAP=1 关闭自动引导。
# 1. 先装 opencode-memory 的 Python server(提供 memory_skill.mcp_server)
pip install "memory-skill[onnx]" optimum[onnxruntime] huggingface_hub
# 2. 下载嵌入模型(约 1.3GB,自动转 ONNX;国内网络可加 HF_ENDPOINT=https://hf-mirror.com)
# 3. 安装本插件
dsh plugin --profile web add dsh-memory-protocol
默认用 python3 -m memory_skill.mcp_server 启动 MCP server。路径可通过环境变量覆盖:
| 环境变量 | 默认 | 说明 |
|---|---|---|
MEMORY_SKILL_PYTHON |
python3 |
解释器路径 |
MEMORY_SKILL_DIR |
process.cwd() |
memory-skill 项目目录 |
MEMORY_SKILL_DB_PATH |
~/.memory-skill/memory.db |
记忆库路径(server 已内置此绝对默认值;如需共享 opencode 的库,显式指向该库文件) |
IMPORTANCE_API_KEY |
(未设) | LLM 重要性评分 key(可选) |
自动引导
插件检测到 memory MCP 工具未注册时,会自动触发 scripts/bootstrap-memory.mjs(也可手动 npm run bootstrap):
pip install --user "memory-skill[onnx]" optimum[onnxruntime] huggingface_hub(已安装则跳过)- 下载
BAAI/bge-large-en-v1.5并转 ONNX(默认models/bge-large-en-v1.5/;直连失败自动重试HF_ENDPOINT=https://hf-mirror.com)
| 环境变量 | 默认 | 说明 |
|---|---|---|
MEMORY_SKIP_BOOTSTRAP |
(未设) | =1 关闭自动引导 |
MEMORY_SKIP_INSTALL |
(未设) | =1 跳过 pip install |
MEMORY_SKIP_MODEL |
(未设) | =1 跳过模型下载 |
MEMORY_MODEL_PATH |
$MEMORY_SKILL_DIR/models/bge-large-en-v1.5 |
指定模型目录(已有 model.onnx 则跳过下载) |
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
sandbaseai/sandbase-harness
1692775560/dsh-Mimir-Academic-research
1na-ko/dsh-hdc-bridge
YYTbit/dsh-plugin-claude-bridge
Edge-Echo/dsh-mcp-bridge
zzhang82/Agent-Memory-Bridge