JunNanLYS/dsh-layered-memory
DeepSeek Harness长期记忆:对话自动蒸馏为事实/场景/画像三层记忆,每步自动召回注入——让AI基于证据说话,零操作无感使用。
Project Overview项目介绍
This is a native memory plugin built exclusively for DeepSeek Harness (DSH) that implements layered distillation of conversational memory. It automatically runs a four-step pipeline in the background: capturing raw conversation events, distilling them into atomic memory, integrating scene context, and generating user profiles. Before every model inference step, it retrieves relevant memory and injects it into the context window to reduce information loss in long conversations. You can install it via the official DSH CLI using either npx for a no-install run or a pre-installed global dsh command, and it works with both DSH web profiles and terminal TUI profiles.
The plugin is designed for both developers and end users who use DSH to build custom AI agents. It solves common pain points like context window overflow and lost key information in long-running conversations that stretch over multiple sessions. After each conversation completes, it runs the full distillation pipeline automatically in the background, and injects only the most relevant memory for new conversations to avoid wasting valuable context tokens. Users can manually switch between different memory tiers to match the needs of different use cases, from casual daily chat to complex professional work projects.
The plugin is released under the permissive MIT open source license, and requires Node.js version 22.16 or higher to run correctly. It includes built-in workarounds for common issues like slow TTFT (time to first token) from free or low-tier inference providers, including custom route switching, automatic fallback chains, and per-layer routing configurations. It automatically tracks token costs for all distillation steps and provides built-in visualizations of cost trends over different time periods. After installation, users only need to restart DSH to activate the plugin, and all memory data is stored locally on your own machine for privacy.
这是一款专为 DeepSeek Harness 开发的原生分层蒸馏记忆插件,会在后台自动捕获对话,将对话蒸馏分级为L0捕获、L1原子记忆、L2场景整合、L3画像记忆四层,在模型每一步推理前自动将相关记忆注入上下文。可通过官方DSH CLI使用npx或已安装的dsh命令安装,同时支持web端配置文件和终端TUI两种部署形态。
面向使用DeepSeek Harness搭建AI代理的开发者和普通用户,可解决长对话上下文溢出、关键信息遗漏的痛点。对话完成后自动完成分层蒸馏,新对话发起时自动召回相关记忆注入上下文,还支持手动切换记忆档位,适配日常、工作、智能等不同场景的记忆管理需求,同时提供三个记忆工具方便检索历史内容。
本插件采用MIT开源许可,要求Node版本不低于22.16,兼容DSH 0.1.2-alpha.1到0.1.2-rc.1版本。针对部分推理供应商慢速首 token延迟问题,提供了换路由、自动回退链、按层路由三种解决方案,还会自动记录token使用成本,支持可视化查看开销,用户安装后只需重启DSH即可生效。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-layered-memory(JunNanLYS/dsh-layered-memory)
仓库:https://github.com/JunNanLYS/dsh-layered-memory
本站详情页:https://www.yhbd.top/plugins/junnanlys-dsh-layered-memory/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 18 · 最近提交 2026-09-07 · 主语言 TypeScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【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 更稳。
- 18 stars - an early-stage project星标 18,属于早期项目
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命令行安装
npx -y @deepseek-ai/dsh plugin --profile web add dsh-layered-memory
把 JunNanLYS/dsh-layered-memory 加入你的 DSH 配置(web profile)即可启用。
READMEREADME

dsh-layered-memory
DeepSeek Harness 的分层蒸馏记忆插件:对话在后台自动完成 L0 捕获 → L1 原子记忆 → L2 场景整合 → L3 画像蒸馏,模型每一步前自动把相关记忆注入上下文。
快速开始
需要 Node ≥ 22.16 与 DeepSeek Harness 0.1.2-alpha.1 ~ 0.1.2-rc.1(0.10.0 起
支持到 0.1.2-rc.1,npm latest 已指向该版本;旧版插件请看
历史版本)。
两种调用方式任选(npx 前缀可替换下面任何 dsh 命令):
# 方式一:npx 直接跑官方 CLI(无需预装 dsh)
npx -y @deepseek-ai/dsh plugin --profile web add dsh-layered-memory
# 方式二:已装 dsh CLI(升级:npm i -g @deepseek-ai/dsh 并重启;
# dsh 是 pnpm 转发器,未装 pnpm 时先 npm i -g pnpm)
dsh plugin --profile web add dsh-layered-memory
# 包源备选:GitHub 仓库 / 本地路径(开发调试,link: 指向仓库,pnpm run build + 重启 dsh 即生效)
dsh plugin --profile web add https://github.com/JunNanLYS/dsh-layered-memory
dsh plugin --profile web add /path/to/dsh-layered-memory
让 Agent 安装(推荐)
如果当前 Agent 可以执行终端命令,把下面这段话完整发送给它:
请为 DeepSeek Harness 的 web Profile 安装 dsh-layered-memory 插件。
只执行下面两条命令,不要修改其他 Profile:
dsh plugin --profile web add dsh-layered-memory
dsh --profile web --dump-config
确认输出中出现 dsh-layered-memory 后告诉我安装结果。
不要替我关闭或重启正在运行的 DSH;安装完成后提醒我手动重启 DSH Web Host。
Agent 应当返回安装结果,并明确告诉你配置中是否已经出现 dsh-layered-memory。
本包声明了 dsh.bundle 组合包层(cordis.patch.yml),安装后会自动挂载插件行——
不需要再手改 $DSH_HOME/profiles/web/cordis.patch.yml。然后重启 DeepSeek Harness,
验证:~/.dsh/memory/ 下出现 conversations/ records/ scenes/ 目录和 memory.db
即插件 apply 成功;设置页出现"记忆"页面(记忆工作台五区)、输入栏出现记忆芯片
(记忆 · 智能)即 client 半边就绪。
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
solknight48/dsh-memoryhub
EverMind-AI/EverOS
MemTensor/MemOS
plastic-labs/honcho
vshulcz/deja-vu
adoresever/graph-memory
mnemon-dev/mnemon