Towzai/dsh-memory
DeepSeek Harness(dsh)的跨会话记忆插件:嵌入搜索 + 自动系统提示注入
Project Overview项目介绍
dsh-memory is a cross-session memory plugin for DeepSeek Harness, backed by YAML storage and exposing six tools: remember, recall, view, list, forget, and pin. It combines keyword and embedding hybrid search, prefers title-first injection, and injects fixed memories only on the first turn to keep prompts compact and preserve LLM prefix caching. Use it when an agent needs durable preferences, project facts, or pinned rules across sessions. It depends on a local Ollama instance for embeddings, falling back to keyword-only search otherwise, and switching embedding models invalidates stored vectors.
dsh-memory 是 DeepSeek Harness 的跨会话记忆插件,基于 YAML 存储提供 remember/recall/view/list/forget/pin 六种工具,支持 embedding 混合检索、标题优先注入与会话首轮一次性自动注入,能让智能体自然跨会话携带记忆而不破坏 LLM 前缀缓存。适合需要长期偏好、项目事实或行为铁则常驻上下文的场景。注意:依赖本地 ollama 生成 embedding,无 ollama 时降级为纯关键词检索;更换嵌入模型会使已有向量失效。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-memory(Towzai/dsh-memory)
仓库:https://github.com/Towzai/dsh-memory
本站详情页:https://www.yhbd.top/plugins/towzai-dsh-memory/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 2 · 最近提交 2026-09-08 · 主语言 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 更稳。
- 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 @towzai/dsh-memory
把 Towzai/dsh-memory 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-memory 🧠
为 DeepSeek Harness(dsh)开发的跨会话记忆插件。
基于 YAML 存储的 remember / recall / view / list / forget / pin 工具,支持 embedding 语义检索、标题优先注入与两级(session/auto)自动注入——智能体"天生带着"记忆,无需记得调用工具。
English | 中文
🎯 注入策略:精准、克制、缓存友好
| 设计原则 | 说明 |
|---|---|
| 首轮注入,后续复用 | 固定记忆只在会话第一步注入一次,之后随对话历史自然携带——不再每轮重复渲染 |
| 标题优先,按需展开 | 注入的是精简标题(带 id),全文细节通过 view 工具按需展开——prompt 紧凑 |
| 动态记忆独立于固定集 | auto 级别记忆按话题检索,不污染固定记忆的注入集,避免重复 |
| 不破坏前缀缓存 | 记忆注入后进入历史消息,后续轮次的 system prompt + 历史前缀不变——LLM 的 KV cache 命中率不受影响 |
| 来源隔离标注 | 注入记忆带前缀 Retrieved memories from the memory store (not conversation history),模型不会误认为对话历史 |
📊 与其他方案对比
| 方案 | 每轮注入 | 缓存影响 | Token 消耗 |
|---|---|---|---|
| 每轮全量注入 | ❌ 每轮重复 | ❌ 破坏缓存 | 高 |
| 本插件 | ✅ 首轮一次 | ✅ 零影响 | 低 |
✨ 特性
| 特性 | 说明 |
|---|---|
| 六个工具 | remember(写)/ recall(语义检索)/ view(按 id 展开全文)/ list(标题列表)/ forget(软删除)/ pin(强制注入) |
| 标题优先注入 | 记忆以总结标题(带 id)注入而非全文——prompt 精简;细节用 view 工具按需展开 |
| 两级注入 | injectLevel: session 的记忆会话级常驻(首轮注入一次);auto 记忆按话题动态检索 |
| 首轮一次注入 | 固定记忆只在会话第一步注入一次,之后随历史携带——不再每轮重复渲染(省 token、前缀缓存友好) |
| Embedding 检索 | HybridSearch(关键词 2-gram + 本地 ollama embedding,RRF 融合)——能命中关键词检索漏掉的口语化表达 |
| 匹配调优 | 泛词降权(文件/测试/文档…)、关键词至少 2 词命中、检索门控跳过测试性话语("别管/只是测试") |
| 来源标注 | 注入记忆带前缀 "Retrieved memories from the memory store (not conversation history)",模型不会误认为是对话历史 |
| 数据安全 | 串行写入队列(无丢失更新)、损坏文件隔离备份、原子写入、mtime 缓存失效 |
📦 安装
# 方式一:从 GitHub 安装(源码,需 prepare 构建)
dsh plugin --profile <name> add github:towzai/dsh-memory
# 方式二:本地路径安装
dsh plugin --profile <name> add ./dsh-memory
# 方式三:npm 包(如已发布)
dsh plugin --profile <name> add @towzai/dsh-memory
首次 git 安装若被 pnpm 拒绝运行 prepare,按提示把包键加入该 profile 的 pnpm-workspace.yaml:
allowBuilds:
'@towzai/dsh-memory': true
依赖:本地 ollama 实例 + embedding 模型(默认 qwen3-embedding:0.6b,可用环境变量 DSH_MEMORY_EMBED_MODEL 覆盖)。没有 ollama 时自动降级为纯关键词检索。
⚙️ 配置
- id: dsh-memory
config:
file: /path/to/memory.yaml # 记忆文件位置
injectLimit: 8 # 会话级注入条数上限
embedProvider: ollama # ollama(本地,默认)| nous(OpenAI 兼容云端)
embedApiKeyFile: '' # 从文件里读第一个 sk-… 当密钥(密钥不进配置/仓库)
embedApiKey: '' # 或直接给密钥(优先级最高)
embedBaseUrl: '' # 云端 base URL(默认 https://inference-api.nousresearch.com/v1)
embedModel: '' # 云端模型(默认 qwen/qwen3-embedding-8b,4096 维)
minSimilarity: 0.65 # 语义召回相似度门槛
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
Aik358/dsh-auto-memory
QIANLING-0831/dsh-memory-plus
knqiufan/powercontext-dsh
paulalesius/dsh-hindsight-advanced
Spirtxiaoqi7/mindspace-dsh-session-memory