Memory triage for DeepSeek Harness: at the end of each turn it decides which entries to keep and which to archive, routes project-specific ones into a project bucket while global ones stay in the main store, merges near-duplicate entries, and falls back to an LLM when the rules are unsure — automatic actions are recoverable archives only, never deletions.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-memory-triage
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:AtinyFurina/dsh-memory-triage
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.

DeepSeek Harness 记忆分诊插件:自动判断记忆保留 / 归档,并自动路由到项目桶或总体桶。
规则优先 + LLM 兜底。自动动作只做可恢复的归档,永不直接删除。
功能
- 每轮对话结束自动分诊(防抖 5s + 阈值触发:新增 3 条或 3000 字符)
- 全局条目(用户画像、沟通偏好、纪律等)留在总体记忆
- 项目条目(具体项目的状态与决策)自动迁入 project 桶
- 低价值条目(importance ≤ 2 且非全局豁免的 preference)归档
- 近义重复条目自动合并(标题 dice 相似度 ≥ 0.62 或内容包含),其余归档
- 规则拿不准的条目用 LLM 兜底判定(每批 ≤ 8 条,失败静默跳过)
- 镜像 Markdown 与 dsh-mneme 格式字节级兼容,人工编辑仍可合并回库
安装
插件文件放到 ~/.dsh/profiles/web/plugins/dsh-memory-triage,在
~/.dsh/profiles/web/cordis.patch.yml 挂载:
- insert:
- id: dsh-memory-triage
name: ./plugins/dsh-memory-triage/lib/index.js
config:
memoryDir: ~/.dsh/memory
enabled: true
debounceMs: 5000
triggerThresholdCount: 3
triggerThresholdChars: 3000
archiveLowImportance: true
llmFallback: true
llmBatchSize: 8
purgeDays: 30
purgeOnSchedule: false
重启宿主后生效。
命令
/triage-run—— 立即全库分诊/triage-purge—— 彻底删除归档超过purgeDays天(默认 30)的条目(仅限已归档)/triage-persona <人格名>—— 切换当前人格:带旧人格标签的记忆自动隐去、通用记忆保持可见;/triage-persona none清除标记恢复全部可见/triage-repersona <新人格名> [新人设描述]—— 继承重写:把当前人格的带标签记忆按新人设改写一份副本(原文保留)并切换
人格标签(persona tagging)
- 记忆条目可通过标签
persona:<名字>归属某个人格;无该标签的条目为通用记忆,所有人格可见 - 库中存有"当前人格"标记;注入、搜索、列表只显示"当前人格 + 通用"条目,其他人格的条目自动隐去
- 切换人格零 LLM 消耗、零删除;切换时插件会用 LLM 扫描未打标的偏好/决策条目,把人格专属的条目补上旧人格标签(失败静默跳过,不阻塞切换)
- 此过滤由 dsh-mneme 的本地补丁实现(inject/search/list 统一按当前人格过滤,实时生效无需重启)
配置
| 键 | 默认 | 说明 |
|---|---|---|
memoryDir |
~/.dsh/memory |
dsh-mneme 记忆目录(共用同一 SQLite) |
enabled |
true |
总开关 |
debounceMs |
5000 |
回合结束防抖 |
triggerThresholdCount |
3 |
触发阈值(新增条数) |
triggerThresholdChars |
3000 |
触发阈值(新增字符) |
archiveLowImportance |
true |
低价值偏好自动归档 |
minDice |
0.62 |
合并相似度阈值 |
exemptKeywords |
内置清单 | 全局豁免词(命中保留总体记忆) |
projectKeywords |
内置清单 | 项目词(命中迁入 project 桶) |
llmFallback |
true |
LLM 兜底开关 |
llmBatchSize |
8 |
兜底每批条数 |
purgeDays |
30 |
归档超期天数 |
purgeOnSchedule |
false |
分诊时自动清理超期归档(默认关) |
安全设计
- 自动分诊只做三类软操作:保留、迁移类型、归档(archived=1,可恢复)
- 真删仅发生在
/triage-purge或purgeOnSchedule: true,且只作用于已归档条目 - LLM 兜底失败 / 余额不足时静默跳过,绝不影响记忆写入
- 与 dsh-mneme 多连接共用 WAL,busy_timeout 8000ms 串行化写入
测试
node --test test/triage.test.mjs
14 个单元测试覆盖分类规则、去重合并、LLM 决策解析。
License
GPL-3.0
Links
More in this category
vectorize-io/hindsight#coding-agents★ 56238
Hindsight, agent memory that learns: long-term project memory with auto recall and retain, knowledge pages, deep reflection, and per-repo memory banks.
volcengine/OpenViking#examples/dsh-memory-plugin★ 41160
OpenViking memory and context bundle for DeepSeek Harness: pre-step auto-recall and profile injection, session capture, `viking://` URI guarding, and recall/write memory tools backed by an OpenViking server.
MemTensor/MemOS#memos-local-plugin★ 12187
Local-first memory plugin for DeepSeek Harness: layered L1/L2/L3 memory with automatic capture, manual memos_* retrieval tools, and a built-in memory viewer.
agentscope-ai/ReMe#dsh★ 3720
Connects DeepSeek Harness to ReMe's local-first, self-evolving personal knowledge base: automatically captures completed main-agent conversations as user-owned Markdown memory, searches conversations and source material through reme_search with BM25, optional embeddings, and wikilink expansion, and schedules daily memory consolidation.
zilliztech/memsearch#MemSearch★ 2807
Shared Markdown memory for DSH and other coding agents, with automatic capture, pre-step context injection, searchable recall, and memory-to-skill self-evolution through a review panel.
vshulcz/deja-vu#extensions/dsh★ 1336
Reads the session files forty-two other coding agents on this machine already wrote (Claude Code, Codex, Cursor, VS Code Copilot Chat, opencode, OpenClaw, Hermes, Kimi, Cline, Zed and more), including sessions from before it was installed: six tools (deja_recall, deja_session, deja_blame, deja_fix, deja_how, deja_remember), a /deja command, and optional automatic recall added to the runtime context. Local BM25 index, no LLM, no embeddings, no network (dsh plugin --profile web add dsh-deja).
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.