DSH Plugins Marketplace

DSH Plugins

Plugins

/

Memory & Context

/

dsh-inherit-compression

d

dsh-inherit-compression

Manifest valid

Anchors a message, compresses the conversation after it into one memory block when the context crosses a threshold, and withdraws the original span in place, so a long session can continue with its pe

UI (client)hasBundlePatch

dsh-inherit-compression

DeepSeek Harness 插件:给长会话做继承——到线自动压缩、就地撤回、把记忆交给下一轮。

出处与致谢

宿主与客户端骨架来自 dsh-retrace(v0.4.150,MIT); 「会话继承」这一整套——锚点、尾部压缩、就地撤回、记忆注入、设置面板——是本项目新增的。 上游版权与许可全文见 LICENSE,具体改动范围见 THIRD-PARTY.md。

它解决什么

上下文一长,模型就开始忘事;换会话重开又会丢人设。这个插件让你在任意一条助手消息上 立一个锚点,之后只把「锚点之后」新增的对话压成一块记忆,撤掉原文、把记忆留在会话里, 下一句话接着聊,语气和记忆都还在。

用法

  1. 在助手消息那一排按钮里点「继承」——那条消息成为锚点(浅橙色)。 锚点之后的消息变浅绿;最新一条回复是浅红,点它立刻把锚点之后整段收一次。
  2. 每轮结束自动量一次上下文,到设置里的上限就压;也可以在设置里手动触发。
  3. 压缩只取锚点之后那段,交给指定模型 + 你写的提示词,压成一块记忆,写进会话里的替换消息。
  4. 压完的下一条消息前面会贴一段「近期对话」(最近 N 轮原文,<对方>/<我> 排版), 用一次就清;末尾指令可以在设置里改。
  5. 再点一次锚点上的按钮冻结;锚点被别的操作遮蔽会自动关闭继承。

压缩没写完之前,同一会话的新请求会排队等待,不拒收、不丢字;压缩期间新发的消息一律不撤。

跳回锚点

压缩会把中间一大段从对话里撤走,可官方分页还是照旧按条数翻,一页里大半是空壳。输入框右上角 外面有一个圆形按钮,点一下直接跳回锚点那一轮:当前窗口里没有就自动往后翻历史,翻到了才滚过去 并闪一下。

自动瘦身(减小存储)

压缩只减上下文,会话日志文件本身该多长还是多长(原文只是不再参与上下文)。所以下次启动时、 会话还没被打开之前,插件会把已经撤回那一段的正文换成占位符,文件跟着瘦下来:只动正文,轮步 边界、序号、工具调用配对、表面节点一律不碰。会话活着的时候不动它的日志,这是硬边界。

新版本适配

DSH 0.2.3 起有两处变化会影响注入:agent/pre-step 的入参里不再带 agent;「运行环境上下文」 也写成 role: 'user'。因此挑注入目标改成看 source.kind(只认真正的用户输入),会话身份按 agent → session → header 依次认,再用最近活跃会话兜底。旧版本照旧可用。

设置(设置 → 继承)

  • 总结模型:留空则跟随会话当前模型
  • 上下文上限:到这个 token 数触发压缩(默认 600000)
  • 压缩提示词:压摘要用的系统提示词(留空用内置)
  • 注入提示词:贴在「近期对话」块末尾的指令(留空用内置)
  • 压缩上限字数(500–100000)/近期对话条数(0–300)
  • 运行日志:最近若干行,出问题先看这里

数据

~/.dsh/inherit-compression/

  • state.json:设置、每条会话的锚点与待注入快照(摘要正文不在这里,它就在会话那条记忆消息上)
  • log.txt:运行日志(超过 200K 自动截半)

最近更新

  • 适配 DSH 0.2.3:注入按 source.kind 认人,只在新消息那一拍贴前缀,就地改 content 保证落盘
  • 新增跳回锚点按钮(输入框右上角外面)
  • 新增启动前自动瘦身:把已撤回的正文换成占位,减小会话文件体积
  • 空壳收尾行(「已完成,用时 N 秒」「已重试模型请求」)在这一轮内容全被撤走时隐藏
  • 当前构建号 inherit-70,日志里 MOUNT build= 那一行可核对

开发

客户端 bundle 由脚本生成,别手改 lib/client.bundle.js:

node build-inherit-client.mjs   # build/client.retrace.bundle.js + build/inherit-client.part.js → lib/client.bundle.js
node smoke-inherit.mjs          # 冒烟:模块能注册、apply 被包住
node scrub-upstream-name.mjs    # 需要时:把残留的旧标识再扫一遍

宿主改动(lib/*.js 里跑在 Node 的那部分)需重启桌面端;只动客户端则刷新页面即可。

许可

MIT,见 LICENSE;基于 dsh-retrace 的修改说明见 THIRD-PARTY.md。

Comments

Loading…

From the same category

hindsight

Hindsight, agent memory that learns: long-term project memory with auto recall and retain, knowledge pages, deep reflection, and per-repo memory banks.

Memory & Context

★ 53.1k

MIT

Python

Index only — not installable

by volcengine

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

Memory & ContextManifest valid

★ 42.7k

↓ 10k/wk

AGPL-3.0

Python

Nov 24, 2026

dsh plugin --profile agent add @openviking/dsh-memory-plugin

by Tencent

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

Memory & ContextManifest valid

★ 38.1k

↓ 1.9k/wk

NOASSERTION

Go

Nov 23, 2026

dsh plugin --profile web add @wxg-prc-cpg/dsh-weknora

by EverMind-AI

One portable memory layer for every AI agent: local-first, Markdown-native, user-owned, and self-evolving across apps, tools, and workflows.

Memory & Context

★ 14k

Apache-2.0

Python

Nov 24, 2026

Index only — not installable

by MemTensor

Self-evolving memory OS for LLM & AI Agents: ultra-persistent memory, hybrid-retrieval, and cross-task skill reuse, with 35.24% token savings and DeepSeek Harness support.

Memory & ContextManifest valid

★ 12.5k

↓ 1.7k/wk

Apache-2.0

TypeScript

Nov 23, 2026

dsh plugin --profile web add @memtensor/memos-local-plugin

by plastic-labs

Memory library for building stateful agents

Memory & Context

★ 8.3k

AGPL-3.0

Python

Nov 23, 2026

Index only — not installable