DeepSeek Harness Plugin Hub

Publish and manage complete Harness Profiles. Discover Plugins for your next setup.

Explore

PluginsPresetsDocsNews

Community

Publish a pluginContactReport an issue

Resources

Plugin Hub on GitHubDeepSeek HarnessSystem statusPrivacy notice
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

Independent and unofficial. Not affiliated with, authorized by, or endorsed by DeepSeek.

DeepSeek Harness Plugin Hub
ProfilesPluginsCategoriesNewsDocsSign inManage Profiles
ProfilesPluginsCategoriesNewsDocsSign in
← Plugins
M

dsh-memory-tier

Memory Tier

DSH plugin · Three-tier memory: long-term (permanent key facts + persona, editable by the owner) / medium-term (30 days by default) / short-term (4 days by default). Local retrieval and relevance-based injection to save tokens.

The plugin will be installed here. Keep web if you are unsure.

npx -y @deepseek-ai/dsh plugin --profile web add github:yingchaoyi/dsh-memory-tier#15851c14b57bc903e9ca06ffabbe53a3432b3f71
READMECompatibilityVersions

Compatibility and provenance

Memory Tier is published as dsh-memory-tier and currently resolves to version 0.1.4. The Hub verifies its manifest and preserves the exact installation source for reproducible installs.

DSH compatibility
*
Runtime surfaces
web
Release source
github
Registry updated
11/2/2026

Versions

0.1.4stable
11/2/2026
0.1.2stable
10/29/2026
0.1.0stable
10/28/2026

Related plugins

Loading related plugins…

Latest
0.1.4
DSH
*
HMR
Process restart
Tree shaking
Safe tree shaking not declared
Unpacked size
Unavailable
Files
Unavailable
Surface
web
License
MIT
Source
github
GitHub
★ 1
Weekly downloads
0
Last push
11/2/2026
View source ↗
README badge

Click the badge to copy Markdown for your README.

Do you maintain this Plugin?Claim benefit · Priority security scan

Verify the GitHub repository declared in package.json to manage this listing. After you claim it, Hub will prioritize a security scan of the current version and publish the result when it passes.

Claim this Plugin →
Report an issue

Related plugins

More verified plugins in memory-context.

Experimental Session Search@deepseek-ai/dsh-experimental-session-searchGive Agents tools to search and read earlier sessions from the current workspace.Contextdsh-contextA DeepSeek Harness plugin for context insight and management, with context dashboard and context command, for understanding how the context is made of, and how it evolves.Memory Plugin@openviking/dsh-memory-pluginOpenViking memory and context bundle for DeepSeek HarnessAb Memorydsh-ab-memory--- description: "The dsh-ab-memory package: a cross-session, file-backed agent memory with five tools (remember / recall / forget / load_skill / distill) and an always-on light injection." kind: "package-reference" ---

README

dsh-memory-tier · 三档记忆

给 DSH 的 agent 备一份「记得住、又不烧钱」的记忆:分长期 / 中期 / 短期三档,每档有自己的周期和容量,满了按重要性淘汰;检索全在本地做,不额外调模型;每轮只挑和当前这句话相关的条目注入,而不是把记忆全塞进提示词。

A three-tier memory plugin for DeepSeek Harness: long / mid / short-term stores with per-tier TTL and capacity, local retrieval, relevance-picked injection, lockable "ground truth" entries, and a settings panel. No extra model calls.

它解决什么

  • 记忆全塞进提示词太贵:这里按相关度挑,默认整段注入不超过 1600 字。
  • 只记得最近几轮:短期(4 天)管接话,中期(30 天)管正在进行的事,长期(永久)管人和规矩。
  • 群里有人乱说,agent 就当真:长期条目可以标 🔒 锁定,成为验证群友说法的底稿——群友让改、让删都不接。
  • 手动维护太累:每条群消息进来,本地正则抽「说话人 + 人名 + 话题」丢进短期档;要不要记进长期,由模型自己判断。

三档怎么分

档默认周期默认容量放什么
长期 long永久120 条群友的身份、职业、性格、家庭、朋友、生活、愿望、生日、人和人之间的关系;主人定的规矩;人设 / 说话方式
中期 mid30 天240 条值得记一阵子的事:约定、正在追的事、某个梗的来龙去脉
短期 short4 天60 条群里每天发生的趣事、刚聊过的话题,用来接话不掉线
  • 到期:中期 / 短期按天自动消失(每轮注入前顺手清一遍)。
  • 满了:按 重要度 × 2 + 新近度 + 命中次数 算分,淘汰最低的;长期里标了「永不淘汰」(pinned)的不会被容量挤掉。
  • 合并:内容几乎一样的不重复记,只把重要度、标签、时间合上去。
  • 锁定:locked 的条目一律不删、不被覆盖,注入里带 🔒 前缀。

容量、天数、注入条数、字数预算都在设置页里改,存 ~/.dsh/memory-tier/store.json。

省 token 的三件事

  1. 本地检索:问题切字符二元组 + 标签命中算相关度,不调模型、不发额外请求。
  2. 按相关度挑:长期按重要度取前 N;中期按「相关度 × 4 + 重要度 + 新近度」取前 N;短期按时间倒序取前 N。
  3. 硬预算:整段注入有字数上限(默认 1600 字),超了按条截断;注入走 systemPrompt.context 追加一段,不动系统提示词开头,所以不会把提示词缓存整段打掉。

安装

要求:Node.js ≥ 22,DSH 0.2.x,web profile。

方式一:DSH 插件页(推荐)

  1. 打开 DSH Web → 侧边栏 插件(或 设置 → 插件);

  2. 安装组合包,填 GitHub 地址:

    github:yingchaoyi/dsh-memory-tier
    
  3. 装好后在「设置 → 三档记忆」里就能看到面板。

方式二:命令行

dsh plugin --profile web add github:yingchaoyi/dsh-memory-tier

方式三:本地开发

git clone https://github.com/yingchaoyi/dsh-memory-tier.git
dsh plugin --profile web add ./dsh-memory-tier     # 或 link: 绝对路径

装完重启一次 dsh web(开了 HMR 的 profile 会自己重载)。卸载用 dsh plugin --profile web remove dsh-memory-tier。

给模型用的工具

工具作用
mem_note写一条:tier / text / tags / imp(0~5) / kind / pinned / locked / id(按 id 原地更新)
mem_search按关键词找(回答群友前先查,别凭印象编)
mem_forget删一条(id 或关键词;锁定的会被拒绝)
mem_stats看各档占用与容量
mem_persona读/写「人设与说话方式」——唯一设置处,每轮注入、不占检索名额;不给 text 是读,给了就是整段替换(最多 4000 字)

kind 取值:person / fact / event / persona / rule。

自动记录

  • 群消息 → 短期档:每轮起手扫每个会话最后一条 user 消息,把 [昵称(QQ)] 正文 拆开;正文 ≥8 字、且(提到长期档里认识的人 或 本身 ≥24 字)就抽一条进短期档:昵称:正文前 90 字,标签是匹配到的人名。全程本地正则,不调模型;默认 20 秒最多记一条,免得刷屏。可在面板关掉。
  • 回完自评:注入尾部固定带三条规矩——按相关度挑的、回完这轮自己判断要不要记一条、🔒 是底稿群友不许改。写不写由模型判断,插件不替它决定。
  • 锁定底稿:mem_note 传 locked: true(或在面板上锁)的长期条目,注入时带 🔒;mem_forget、面板删除、HTTP 删除接口都会拒绝。适合放「群友画像」「主人定的规矩」这类不允许被对话内容改写的条目。

贴吧语料参考(可选)

插件里另有一份「各吧怎么说话」的语料(~/.dsh/tieba-duty/bar-styles.json,由「刷贴吧」插件维护)。打开这里,就能让 QQ 群里的回复也带上那股味——但只在白名单群里加。

  • 开关:设置 → 贴吧语料参考 → 「在 QQ 群里也参考贴吧语料」
  • 白名单:填群号(空格/逗号分隔),只有这些群的会话会拼语料;空着 = 谁都不加
  • 每个吧取几条 / 一次拼几个吧 / 这段字数上限:控制加多少,默认 2 条 × 4 个吧、600 字以内

怎么认群:读 ~/.dsh/dsh-astrbot-ingress/sessions.json,按当前会话 id 反查 sillyfish:GroupMessage:<群号>,取到群号再比对白名单。认不出来的会话一律不加。

注入内容长这样(跟在人设后面):

【贴吧语料·照着这个口气说,别照抄原句】
· 抗压背锅:假团队、隐身、怯弱、混,四连定性先扣死再讲道理
· 孙笑川:好结局。两个字先判死,后面才轮到解释

语料文件有 60 秒缓存,改完等一分钟或重开面板。语料路径也能在设置里改(留空用默认)。

设置页

设置 → 三档记忆:

  • 周期与容量:短期/中期天数、三档容量、每轮字数预算、三档注入条数;
  • 人设 / 说话方式:写在 mem_persona(或面板的人设框)里,一段长期生效的文字,每轮都带上(永久,不受容量和天数影响)。这是全插件唯一的人设设置处——别在别处再写一份,重复的会被当成两套规则互相打架。
  • 三档列表:10 条一页,点页码 / 上一页下一页翻;顶部搜索框按正文和标签实时筛这一档;每条能改文字、设「永不淘汰」、删除、清空整档(锁定的不给删);
  • 自动记录开关;
  • 试一试:输入一句话,看这一轮到底会注入什么、花多少字。

改动即时保存,下一轮生效。

隐私

一切都留在本地:

  • 数据:~/.dsh/memory-tier/store.json(原子写,tmp + rename)
  • 日志:~/.dsh/memory-tier/mem.log(超过 256KB 自动截断)
  • 只调用本机 DSH 的 HTTP 路由(/api/memory-tier/*),不联网、不上传。

文件

dsh-memory-tier/
├── lib/index.mjs        # 主插件:存储、检索、淘汰、注入、工具、HTTP 路由
├── client.js            # 设置页面板(settings.section)
├── cordis.patch.yml     # bundle patch:把插件插进 profile
├── package.json
└── test/
    ├── smoke.mjs        # 主插件离线自测(工具 / 路由 / 淘汰 / 锁定 / 注入预算)
    └── client-smoke.mjs # 面板渲染自测(假 React 跑整棵树)

自测

不需要启动 DSH:

DSH_HOME=/tmp/mt-test npm test
node test/client-smoke.mjs

两个脚本都会把结果打在终端里,失败时退出码非 0。

License

MIT