dsh-recall

DSH PLUGIN记忆与知识

仓库 sh-222/dsh-recall · npm dsh-recall

记忆与知识 L5 · 运行验证通过 安全审查:低风险 可信度:金 可安装插件
安装这个插件

dsh-recall 是 DeepSeek Harness 的上下文回收插件:把超长工具结果写入磁盘,只在对话中保留开头,模型可用 recall(id) 按需取回。

一句话选型结论

按资料字段整理

dsh-recall 是记忆与知识类的 DSH 可安装插件,验证等级 L5 · 运行验证通过,安全审查为低风险,列出 5 项功能,有可直接复制的安装命令。验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么;涉及密钥或系统权限的,建议先在隔离环境试装。

分类记忆与知识 收录类型可安装插件 验证等级L5 · 运行验证通过 安全审查低风险
验证等级 L5 L5 · 运行验证通过
GitHub 星标 1 复刻 1 · 未关闭 issue 0
最近更新 2026-11-11 创建于 2026-11-04
README 8.7 KB 正文体量,越大说明说明书写得越细

安装

可安装插件
在 DSH 里执行,装完用 dsh plugin list 确认已挂上;标了 L4 / L5 的命令已在沙盒里真实跑通
dsh plugin --profile web add github:sh-222/dsh-recall#v0.5.0
  1. 1
    确认版本与运行环境

    兼容的 DSH 版本为 0.2.2-rc.1,Node.js 要求 >=20;版本不匹配时安装会报错。

  2. 2
    执行安装命令

    在 DSH 里执行上面的命令;多包仓库要注意区分具体子包名,别装错包。

  3. 3
    确认已挂载

    用 dsh plugin list 查看列表里是否出现这个插件,出现即挂载成功。

  4. 4
    试跑并检查权限

    加载后跑一个最小用例,确认它能正常工作;同时看它申请了哪些文件、命令或网络权限。

兼容 DSH 版本0.2.2-rc.1版本不匹配时安装会报错
Node.js 要求>=20来自仓库 package.json 的 engines 字段
前置依赖无需要同时安装的同级依赖
npm 包名dsh-recall可用 npm view 查看包信息

能做什么

5 项功能
字段来自项目仓库与公开索引,中文说明由本站标注

dsh-recall:为 DeepSeek Harness 回收上下文的 DSH plugin

  • 超长工具结果写入磁盘
  • 对话内仅保留前 600 字符
  • recall 按需取回片段
  • 统计节省的 token 数
  • 幂等处理,重启不重复

适用场景

存储文件读写记忆

上游标签

contextcostdeepseekdeepseek-harnessdshdsh-plugintokens

验证等级与安全审查

L5 · 运行验证通过
自动化流程结论,不是人工审核
验证等级L5 · 运行验证通过在 dsh 沙盒中完成安装与运行冒烟——装得上、跑得起来
安全审查低风险静态分析结论,未标注不代表已通过审查
仓库健康度活跃按仓库活跃度与最近更新时间给出
可信度金综合仓库活跃度与验证结果

上面的结论来自上游最近一次自动化验证(2026-11-10): 同一套检查会在插件发新版后重跑,页面显示的是最新一次的逐项结果。

逐项检查结果

L1 · 已找到 ✓ 通过
  • L1.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L2 · 结构化 ✓ 通过
  • L2.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L3 · 安装规范 ✓ 通过
  • L3.1_INSTALL_COMMAND_PARSED 安装命令已解析 方式:安装规范解析
  • L3.2_DSH_VERSION_DECLARED DSH 版本已声明 方式:DSH 版本声明
L4 · 安装已测 ✓ 通过
  • L4.1_INSTALL_EXECUTED_CONFINED 受限沙盒内执行安装 方式:沙盒安装执行
  • L4.2_INSTALL_SUCCESS 沙盒安装成功 方式:沙盒安装执行
  • L4.3_ARTIFACT_CONFIRMED 安装产物已确认 方式:沙盒安装执行
L5 · 运行已测 ✓ 通过
  • L5.1_INSTALL_PASSED_SANDBOXED 沙盒安装通过 方式:沙盒安装执行
  • L5.2_WEB_BOOT_READY Web 启动就绪 方式:Web 启动
  • L5.3_HTTP_SERVED HTTP 服务响应 方式:HTTP 请求
  • L5.4_PLUGIN_INVENTORY_ACTIVE 插件清单中已激活 方式:插件清单查询

风险详情

  • 结论说明 静态扫描 低;动态审计无结论(以下以静态为准)→ 总评级 低。
  • 风险计数 严重 0 / 高 0

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 验证等级 L5:安装和运行都在沙盒里跑通过,装完能直接用的概率高。
  • 静态安全审查为低风险,没有发现明显可疑行为。
  • 有可直接复制的安装命令,不用自己翻文档找入口。
  • 标注了兼容的 DSH 版本(0.2.2-rc.1),按版本装不容易报错。
  • 列出了 5 项功能,能直接看出它解决什么问题。

先想清楚的地方

  • 验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么。

更适合

  • 需要在记忆与知识场景里给 DSH 补能力的人。
  • 想装完就能用、不想自己排依赖的人。
  • 能接受在本地装依赖、愿意自己确认权限的人。

不太适合

  • 只使用 DSH 官方内置能力、不接受第三方插件的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
插件验证等级安全审查星标兼容版本安装命令
dsh-recall当前 L5 · 运行验证通过 低风险 1 0.2.2-rc.1 有
ruflo L3 · 安装规范通过 低风险 7.4 万 未标注 无
OpenViking L3 · 安装规范通过 低风险 3.9 万 未标注 无
WeKnora L4 · 沙盒安装通过 低风险 3.3 万 未标注 有
distilly L4 · 沙盒安装通过 低风险 2.5 万 未标注 有
EverOS L4 · 沙盒安装通过 低风险 1.3 万 未标注 有

仓库档案

记忆与知识
字段来自项目仓库与公开索引,中文说明由本站标注
作者 / 维护方sh-222仓库 dsh-recall · 默认分支 main
分类记忆与知识knowledge
收录类型可安装插件声明了 dsh.bundle、可用 dsh plugin add 安装的条目
开发语言JavaScript仓库主语言
许可证MIT商用或二次分发前请确认条款原文
星标 / 复刻 / issue1 / 1 / 0收录时的数值,非实时
创建 / 更新2026-11-04 · 2026-11-11最后推送 2026-11-12
本站收录2026-11-05首次进入本站目录的时间

README 全文

8.7 KB
作者原文,中文版优先;只做安全转义,不改内容

dsh-recall

Русская версия · English

A context-reclaim plugin for the DeepSeek Harness (dsh). A big tool result keeps its first
600 characters in the conversation; the rest is written to disk under a short object id, and the
model can pull any slice of it back with recall(""). A strip under the composer reports the
three numbers that decide whether the trade is worth it: how much was moved out, how many tokens
that kept out of the context, and how often the model actually went back for more.

Why

Measured on 8 504 tool results from real sessions:

fact value
results larger than 6 KB 4.6% of results
…and their share of all tool-result characters 40.7%
…that are never opened again 76%

So the expensive part of a coding session is a handful of huge results that nobody reads twice.
Offloading them removes tokens that would otherwise be re-sent on every later step: the saving
is removed_tokens × remaining_steps × cache_price, not removed_tokens.

Ceiling, stated plainly: tool results are roughly 46% of the context, so offloading all of them
still caps at about 18% of the context. On a route that bills cache reads near input price that is
a real 20–25% of a long session; on a first-party route with a cheap cache it is single digits, and
there the lever is fresh input and step count instead.

What it does, exactly

  • Hooks tools/post-execute and looks at the session surface.
  • Touches only results older than the newest two (KEEP = 2) and longer than 2 500
    characters
    (THRESHOLD).
  • Replaces the result with head (600 chars) + a [recall] note using the same replay-safe pair the
    stock pruner uses — a compaction/prune event that prices and cites the shadowed node, then a
    tool/result event with surfaceOp: {op:'replace'}. The durable log keeps the original.
  • Writes the full text to ~/.local/share/dsh-recall/objects/.txt and appends one line to
    index.jsonl.
  • Registers the recall tool: recall(id), recall(id, start, count); default slice 8 000 chars,
    hard cap 24 000 so a recall cannot re-inflate the context it was built to shrink. Ids are
    validated (/^[0-9a-f]{6,32}$/i) before the filesystem is touched — the model will invent ids.
  • Is idempotent: a result that already contains the [recall] marker is skipped, so restarts and
    repeated passes do not stack pointers.

What this is not: the 15% compaction

dsh-recall never decides when the context gets compressed and never touches the context window.
The percentage-based compression is the stock @deepseek-ai/dsh-compaction-basic plugin, configured in
the profile's own patch layer (~/.dsh/profiles//cordis.patch.yml):

- id: compaction-basic
name: "@deepseek-ai/dsh-compaction-basic"
config:
thresholdRatio: 0.15
retainRatio: 0.05

thresholdRatio is the share of the model's window at which a compaction pass starts; retainRatio is
the share kept afterwards. The stock defaults are 0.8 / 0.16. On this machine the desktop profile
runs 0.15 / 0.05, so a 256k window compacts at ~38k tokens and keeps ~13k — a much smaller working
window than the model allows. That is the knob to raise if you need more room:

thresholdRatio: 0.6   # compact at 60% of the window instead of 15%
retainRatio: 0.15

The two mechanisms are independent and complementary: compaction rewrites the whole history into a
summary once the window fills up, while dsh-recall leaves the history intact and only shortens
individual large tool results — which is what delays the moment compaction has to run. Disabling recall
does not change the 15%, and raising the 15% does not change what recall does.

The pill

A compact pill in shell.overlay that stacks directly above the dsh-tidewatch badge when that
plugin is installed — it reads the tide chip's rect every 500 ms and aligns itself to it, so the two
look like one card, and falls back to the bottom-right corner when tidewatch is absent. Nothing is
shared with tidewatch beyond a CSS class name, so the two plugins stay independent packages with
their own releases. Copy follows the interface language (en/ru). Click to expand the last 12
offloads with tool name, size and age. Data comes from GET /recall/api/stats on the host's
loopback port, polled every 12 s:

{"offloaded":196,"charsSaved":1207034,"tokensSaved":301759,"recalls":0,"threshold":2500,"recent":[…]}

offloaded and charsSaved are recomputed from index.jsonl, so they survive restarts; recalls
is the only counter that lives in memory and is mirrored to counters.json.

Install

Web / TUI profile:

dsh plugin --profile web add github:sh-222/dsh-recall

The Electron desktop profile cannot be managed from the CLI by design. Add the dependency and
the bundle row to ~/.dsh/profiles/desktop/package.json, then install:

{
"dependencies": { "dsh-recall": "github:sh-222/dsh-recall" },
"dsh": { "profile": { "bundles": ["…", "dsh-recall"] } }
}
cd ~/.dsh/profiles/desktop && pnpm install --ignore-scripts

Restart the harness. A plugin only loads at boot.

Installing from a local checkout

dsh plugin --profile add ~/Projects/dsh-recall writes a link: dependency, and node
resolves @deepseek-ai/* from the real path
, not through the profile — so a link:ed checkout
dies with ERR_MODULE_NOT_FOUND unless you create the symlinks once:

cd ~/Projects/dsh-recall && mkdir -p node_modules/@deepseek-ai
ln -sfn /usr/lib/node_modules/@deepseek-ai/dsh/node_modules/@deepseek-ai/dsh-llm   node_modules/@deepseek-ai/
ln -sfn /usr/lib/node_modules/@deepseek-ai/dsh/node_modules/@deepseek-ai/dsh-tools node_modules/@deepseek-ai/

Tuning the knobs

THRESHOLD and HEAD are constants at the top of index.js. Chosen from the size distribution of
12 real sessions (1 150 results, 487 k tokens), not by feel:

threshold head results hit saved share of volume recall objects
6 000 1 200 40 114 k tok 23.5% 40
4 000 600 103 186 k tok 38.1% 103
2 500 600 218 258 k tok 53.0% 218
1 500 600 368 308 k tok 63.3% 368

2 500 / 600 is the knee: coverage doubles over 6 000 while the object count stays around 18 per
session. Going to 1 500 buys ten points of volume for three times the objects — more chances for the
model to chase a pointer where re-reading would have been cheaper. Never drop HEAD below a few
hundred characters: the model must still see the shape of the result.

How to read the strip: the ratio recalls / offloaded is the experiment. Near zero means the
content was never needed. Close to 1 means the head is too small — raise HEAD to ~2 000 before
touching anything else. Anything in between is the tool earning its keep.

Storage

~/.local/share/dsh-recall/objects/.txt   full text, one file per offloaded result
~/.local/share/dsh-recall/index.jsonl        {session, seq, tool, id, chars, ts} per offload
~/.local/share/dsh-recall/counters.json      {hits, charsSaved, recalls}

One flat pool per $HOME, shared by every project; the owning session is in the index. Ids are
md5(sessionId:seq:length), so identical-sized results from different sessions never collide.
Measured cost: ~8 KB per object, 1.3 MB for a 196-offload session.

There is no rotation. Objects are never deleted. At 8 KB each that is ~120 MB per 10 000
offloads — irrelevant next to the session logs themselves, but if you want a cap, delete
objects/* older than N days and rebuild index.jsonl from what is left.

Honest limits

  • A pointer is only useful while the head still tells the model what the result was. That is why
    the note carries the tool name and the total size.
  • Sessions resumed from a previous process start with an empty callId → tool name map, so an old
    result offloaded right after a restart may be labelled tool instead of read. Cosmetic.
  • Only results already in the surface are touched; the newest two are always intact.
  • counters.json is written by every runtime that mounts the plugin (host and web). Last writer
    wins, so recalls can be clobbered by a second instance; the strip's other numbers are rebuilt
    from the index and stay correct.

Test

npm run check
HOME=$(mktemp -d) node test/reaper.mjs   # HOME is overridden so the real state dir is untouched

The test drives the hook with a hand-rolled session: it asserts that only the old, oversized result
is replaced, that the pointer carries the real tool name from the matching tool/call, that a fresh
big result is left alone, and that recall returns the requested slice and bumps the counters.

License

MIT.

常见问题

9 问
答案由本站依据条目字段整理,不引用上游原文
dsh-recall 怎么安装?

在 DSH 里执行 `dsh plugin --profile web add github:sh-222/dsh-recall#v0.5.0` 即可。对应的 npm 包名是 `dsh-recall`。

dsh-recall 的验证等级是什么意思?

L5 · 运行验证通过。在 dsh 沙盒中完成安装与运行冒烟——装得上、跑得起来

dsh-recall 安全吗?

低风险。静态扫描 低;动态审计无结论(以下以静态为准)→ 总评级 低。

dsh-recall 装之前要先确认什么?

先看它会读写哪些文件、执行哪些命令、连接哪些网络地址;验证等级只说明装得上、跑得起来,不等于安全。涉及密钥或系统权限的,建议先在隔离环境试装。

dsh-recall 支持哪些 DSH 版本?

上游记录的兼容版本包括 0.2.2-rc.1。

dsh-recall 需要什么运行环境?

Node.js >=20。环境不满足时安装会失败,建议先确认本机版本。

dsh-recall 用的是什么许可证?

上游标注为 MIT。商用或二次分发前请到仓库确认许可证原文。

dsh-recall 有哪些功能?

超长工具结果写入磁盘、对话内仅保留前 600 字符、recall 按需取回片段、统计节省的 token 数、幂等处理,重启不重复。

这条记录的数据可靠吗?

本站按仓库名去重后合并整理,字段以作者仓库与 npm 元数据为准;安装命令、仓库地址与 README 保持原文,带 L4 / L5 标记的安装命令已在隔离沙盒里真实跑通。

同名或近似条目

6 条
不同作者的仓库分开列,请确认你要装的是哪一个
记忆与知识
按星标排序,可作替代方案

ruflo

ruflo

L3 · 安装规范通过 7.4 万 星

OpenViking

OpenViking

面向 DeepSeek Harness 的 OpenViking 记忆与上下文插件:pre-step 自动召回与画像注入、会话捕获、`vik

L3 · 安装规范通过 3.9 万 星

WeKnora

WeKnora

把 WeKnora 知识库接入 dsh 的四个只读工具:列出知识库、混合检索原文片段、按顺序还原单篇文档,以及直接取用 WeKnora 自己

L4 · 沙盒安装通过 3.3 万 星

distilly

distilly

Distilly — Distill how they think into reusable Skills for any Agent o

L4 · 沙盒安装通过 2.5 万 星

EverOS

EverOS

L4 · 沙盒安装通过 1.3 万 星

MemOS

MemOS

L4 · 沙盒安装通过 1.2 万 星

插件的元信息来自作者仓库;分类、验证等级与安全结论的中文说明为中文整理,最近核验 2026-11-10。