pk14742952-AD/dsh-host-rsi
给 DSH 做的通用宿主插件,默认面向本地大模型调参;当前重点覆盖 Qwen3.8-27B 与 Qwen3.8 Flash 等本地 27B/轻量模型,也兼容 API 模型。 插件不做模型权重修改,只做每次使用持续自进化的宿主侧记忆层,以 DSH 宿主插件形式实现。 每次使用:模型先"反问式"自检(counter-reason)自己的答案;可信教训被保存并在下次注入; 便宜方法没解决时,深度批评轮自动升级。通用模式:无需针对特定任务的评分器。
catalog descriptioncatalog 简介 / catalog description:DSH host RSI for local LLMs (currently Qwen3.8 27B): per-use continual self-improvement, counter-reason self-check, critic escalation, and memory retrieval.
Project Overview项目介绍
dsh-host-rsi is a native DSH (DeepSeek Harness) host plugin that delivers a per-turn, self-evolving memory layer for local large models, tuned by default for Qwen3.8-27B but compatible with lighter local models such as Qwen3.8 Flash. It runs inside DSH via the host APIs (ctx.on, ctx.inject, webServer.register, and page injection) and is delivered as a cordis bundle patch; installation uses dsh plugin --profile web add github:pk14742952-AD/dsh-host-rsi, with an equivalent npm package and a local plugin_manager install_bundle path. Its core mechanism pairs an inline counter-reasoning self-check producing a [VERIFY] tag with a reliability-weighted signal ladder (L1 verifiable checks → L2 self-confirmed → automatic critique rounds → quarantining) so that trustworthy lessons are saved and reinjected next turn, while cheaper checks suppress expensive critique.
The runtime flow starts with task + answer, then attempts cheap L1 checks (code tests, math equality, SQL matches, schema validation); success stops the path, while failure surfaces high-value corrective lessons. If no L1 applies, the model emits an inline self-interrogation tag (CONFIRMED / REFUTED / UNCERTAIN with confidence, lesson, fix, reason); CONFIRMED with confidence ≥ threshold ends the turn and archives a trusted L2 lesson, REFUTED or low confidence triggers an automatic critique round that re-issues a fix, and persistent uncertainty moves the item into a quarantined store until stronger evidence promotes it. Capture, escalation, and per-session budgets are governed by policy.js with debounced disk flushes; trajectories/*.jsonl accumulate raw traces suitable for later LoRA distillation into Qwen3.8-27B weights.
Dependencies are deliberately minimal: the lib/ directory is pure logic with zero host coupling and runs under node --test in isolation, while the host-side integration defensively wraps every DSH call with optional chaining and try/catch so a missing or malformed payload becomes a no-op rather than a thrown error. Disk I/O is batched and debounced (flushMs) with unref'd timers that never block the event loop or delay process exit; a read-only data directory cleanly degrades to store.disabled instead of crashing. All artifacts are plain JSON plus Markdown under E:\DSH\.rsi-memory\ (index.json, termindex.json, lessons/, quarantined/, trajectories/), so no database is required. First-run caveats include verifying via cordis_inspect_query that DSH exposes turn/end along with agent.followup / agent.inject events on the chosen profile, after which node --test exercises the pure-logic suite; the project is MIT-licensed and credits both DSH and the billion-context plugin (whose settings-page tab idea inspired the independently rewritten dashboard).
dsh-host-rsi 是一款面向 DSH(DeepSeek Harness)宿主环境的原生记忆插件,专为本地大模型(默认按 Qwen3.8-27B 调校,也兼容 Qwen3.8 Flash 等轻量本地模型)实现"每次使用持续自进化"机制。核心做法是在每轮使用中先让模型做"反问式"自检并产出 [VERIFY] 标签,把可验证检查(L1)、自我确认或反驳(CONFIRMED/REFUTED/UNCERTAIN)作为信号阶梯,按可靠性加权沉淀为可检索、可反驳、可自动升级的经验条目,下次注入上下文完成闭环。它通过 DSH 宿主 API(ctx.on / ctx.inject / webServer.register / 页面注入)协作,并以 cordis bundle 补丁形式注入 DSH,安装命令为 dsh plugin --profile web add github:pk14742952-AD/dsh-host-rsi,也可走 npm 同名包或本地 plugin_manager install_bundle。
典型工作流:任务+答案进入后,先尝试 L1 廉价校验(代码测试/数学等式/SQL/schema 探测),命中即停;未命中则触发内联自反问与 [VERIFY] 标签解析,得到 CONFIRMED 且置信度达标则结束并归档可信 L2;得到 REFUTED 或低置信则自动开启批评轮重推 fix,仍不确定的进入隔离区等待更强信号。捕获与升级策略由 policy.js 统一门控(每会话预算封顶、按任务变化门控),教训立即写内存缓存、后防抖批写入 lessons/,并自动写入 trajectories/*.jsonl 供日后 LoRA 蒸馏。适合本地自托管 27B 量级模型的个人开发者、研究者与希望把"经验沉淀+检索+可反驳升级"完整内化为记忆层的 DSH 用户。
依赖方面,纯逻辑层(lib/)零宿主依赖、可 node --test 单测;宿主侧每次 DSH 调用都带 ?. 防御与 try/catch,形状错误即空操作、永不向宿主抛错。磁盘 I/O 仅在后台防抖写入时发生,热路径永不阻塞;写入计时器 unref、不拖住进程退出;目录不可写时优雅降级为 store.disabled,插件照常工作。所有经验以 JSON+Markdown 人可读形式存于数据目录(默认 E:\DSH\.rsi-memory\,含 index.json、termindex.json、lessons/、quarantined/、trajectories/),无需数据库。首启先用 cordis_inspect_query 确认 DSH 暴露 turn/end、agent.followup 等事件再 node --test;许可证为 MIT,仪表板展示思路参考了同 MIT 的 billion-context 但代码独立重写。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-host-rsi(pk14742952-AD/dsh-host-rsi)
仓库:https://github.com/pk14742952-AD/dsh-host-rsi
本站详情页:https://www.yhbd.top/plugins/pk14742952-ad-dsh-host-rsi/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 10 · 最近提交 2026-10-03 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【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 更稳。
- 10 stars - an early-stage project星标 10,属于早期项目
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 dsh-host-rsi
把 pk14742952-AD/dsh-host-rsi 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
中文(默认) · English
DSH HOST RSI记忆
给 DSH 做的通用宿主插件,默认面向本地大模型调参;当前重点覆盖 Qwen3.8-27B 与 Qwen3.8 Flash 等本地 27B/轻量模型,也兼容 API 模型。 插件不做模型权重修改,只做每次使用持续自进化的宿主侧记忆层,以 DSH 宿主插件形式实现。 每次使用:模型先"反问式"自检(counter-reason)自己的答案;可信教训被保存并在下次注入; 便宜方法没解决时,深度批评轮自动升级。通用模式:无需针对特定任务的评分器。
仓库地址:https://github.com/pk14742952-AD/dsh-host-rsi
插件简介:这是一个给 DSH 用的通用记忆 / 自进化插件。它在后台采集每次使用的 成功、失败、用户纠正与长期偏好,把高价值经验沉淀为可信教训,并在下次遇到相似任务时自动注入。 更新日志见 CHANGELOG.md。
想理解技术原理、或在自己环境复刻? 读 PRINCIPLES.md (专用文档:信号阶梯 / 反思循环 / 触发与效率 / 索引机制 / 与 AREX-2 的对应 / 复刻清单,逐点标注源码行号)。
原理来源(致谢 / Principle Source)
本项目的核心原理源自并致敬以下公开研究成果:
- AREX-2(arXiv:2609.38288,BAAI 2026)——自我进化智能体框架。本项目把它落地为「本地、增量、可用即学」的 DSH 宿主插件;逐点技术对应见 PRINCIPLES.md。
- 递归自我改进(Recursive Self-Improvement, RSI)与持续学习(Continual Learning)——每次运行把成功/失败经验沉淀为可检索、可反驳、可自动升级的经验条目;可信经验下轮注入上下文,实现「越用越强」。这是本项目记忆层信号阶梯与升级策略的原理基础。
GUI 说明:本项目此前缺少 GUI,本次补齐。仪表板「设置页里点一下即开网页」的显示方式参考了 DSH 插件
billion-context(MIT)——仅参考其展示思路,代码为独立重写,并非复制其代码(详见 client.js 与 lib/dashboard.js)。
仪表板 / GUI
DSH 重启后:「设置」→「插件」→ 「DSH HOST RSI记忆」 →「打开仪表板」,即可在浏览器查看插件运行状态(启用中/降级、可信/隔离/轨迹、最近记录)。页面每 3 秒轮询 status.json,并显示触发诊断:已处理事件、注入、捕获、失败信号、最近触发事件与原因。
也可在本机直接跑独立 demo(不依赖 DSH):
node demo-serve.mjs # 本机回环 + 示例记录(默认端口 8788)
RSI_DEMO_PORT=9000 node demo-serve.mjs
设计目标(本次优化重点)
- 不影响大模型 / DSH 正常工作:所有读走内存缓存;磁盘 I/O 只在后台防抖写入时发生, 热路径(pre-step / turn-end)永不阻塞。
- 更强的自动触发:宿主侧同时监听
pre-step / turn-end / message的多个常见事件名(agent/pre-step、message、chat/message等),谁存在就用谁,并用事件对象/内容去重,避免一轮触发两次。 - 立刻能看到的反馈:设置页和仪表板显示实时触发计数(事件/注入/捕获/失败);即使尚未产生可信教训,普通工具失败也会留下隔离记录,让用户确认插件确实在工作。
- 诊断与体验工具:模型或用户可调用
rsi_events查看触发诊断;rsi_demo_capture可写一条示例教训,用于快速验证仪表板/设置页。 - 用户纠正与长期指令会被记住:当用户在一轮回复后给出明确纠正或新指令(例如“不要用 requests,改用 httpx”),
插件会把它记为 L3 可信教训。明确的长期偏好 / 规则(“以后都用 httpx”“请记住输出用简洁列表”)
也会在用户提出时记录为
user-instruction可信教训;普通一次性任务请求不会写入记忆。 - 指令按项目去重,防止记忆库膨胀:用户指令会尽量按项目/工作区分组(从指令里的路径或会话上下文提取,
取不到则归到全局),同项目内近义/重复指令会被
hasDuplicate门槛拦截;不同项目出现相似指令不会被误合并。 - 教训后台自动搜集到本地插件目录:
addLesson/addTrajectory立即写内存、批量后台落盘 (flushMs防抖);目录不可写时降级为纯内存(store.disabled),插件不崩、照常工作。 - 最小资源占用:
index.json+termindex.json仅在打开时读一次,之后全内存;写入合并批处理; 防抖计时器unref,不占用事件循环 / 不拖住进程退出。 - 最大兼容性:纯逻辑层零宿主依赖(可
node --test);宿主侧每个 DSH 调用都带?.防御 + try/catch,形状错了就空操作,绝不向宿主抛错。
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
ruvnet/ruflo
Tencent/WeKnora
EverMind-AI/EverOS
MemTensor/MemOS
plastic-labs/honcho
agentscope-ai/ReMe
zilliztech/memsearch
vshulcz/deja-vu