nuwa-skill
alchaincyf
你想蒸馏的下一个员工,何必是同事。蒸馏任何人的思维方式——心智模型、决策启发式、表达DNA。Distill how anyone thinks.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:baixiaoyin666/dsh-long-memory
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
DeepSeek Harness 的自动长期记忆插件
每轮对话结束后自动提炼记忆,新会话自动带回;带详情面板、每日日记与可切换人格。
global 记用户身份、偏好、禁忌、语言与风格;workspace 记当前目录的技术栈、命令、约定、关键决定与踩过的坑,互不污染。tag:、scope:、archived:true、before: 搜索语法。{name} / {mood} 占位),配色跟随人格强调色。memory_search、memory_recall、memory_save、memory_forget。memory_recall 让模型按问题即时回忆(相关度排序、可含归档),不必每轮都把记忆塞进提示。backups/(保留 7 份),删除的记忆进回收站保留 30 天,可随时恢复。0.2.1-rc.3 的 desktop profile 上验证)。git clone 或下载 ZIP 解压)。plugin_manager 的 install_bundle,target 传该目录的绝对路径。application: applied 后,在插件列表里能看到「长期记忆 / Long-term Memory」条目。插件没有配置项,装上即用。安装后无需重启;status.json 等诊断文件从 0.1.1 起才有。
自动进行,你什么都不用做:正常对话,下一轮(或下一个会话)它就知道该记什么、该带回什么。
三个工具只在需要时调用:
| 工具 | 作用 | 参数 |
|---|---|---|
memory_search |
按关键词检索记忆,返回条目 id | query(必填)、scope = auto/global/workspace、limit |
memory_save |
手动存一条稳定事实,近似重复会合并 | text(必填)、scope = global/workspace、tags |
memory_forget |
按 id 删除一条记忆 | id(必填) |
详情面板:点左侧栏的长期记忆图标,打开整页面板(设置里也保留同一页)。面板读取实时记忆库并给出分析:总条数 / 全局 / 工作区 / 近 7 天新增,健康度评分(重复条目、超过 30 天未更新、上次提炼失败都会扣分并列出原因),Top 标签,上次提炼的结果与耗时,以及一份支持搜索、按范围过滤、逐条删除的完整列表。整体是高模糊毛玻璃质感:半透明卡片 + backdrop blur + 细描边,跟随主题明暗。
每条记忆都能展开 「查看对话」:显示产生它的那一轮完整用户消息与助手回复(含会话 id、轮次、时间),以及这条记忆的创建/更新时间、命中次数、来源与工作区完整路径。来源对话在提炼时随记忆一起保存,每条最多保留最近 5 个来源。
日常日记:面板顶部有「记忆 / 日记 / 人格」三个标签。日记每天一篇,按 300–420 字、2–3 段的第一人称写作生成,底部附一条当前人格的情绪留言,并记录当天观察到的用户日常习惯(习惯会作为 global 记忆、带 habit 标签继续参与后续提炼与检索)。每篇带情绪标签(happy/angry/sad/shy/confused/daily)和 2–3 个 emoji;装了 dsh-meme 时,还会按情绪从图库挑一张配图(图片经 data?meme=<date> 由插件自己提供,不依赖外部图床)。日记存在 diary.json;想看最新的点「重写今天」。
人格系统:默认人格是「🐟 大肥鱼」,另内置「傲娇猫娘」「温柔学姐」「毒舌管家」「赛博黑客」「佛系禅师」可直接选用。人格表格里可以一键启用、复制内置人格、编辑或删除自定义人格;点「新建/编辑」会进入独立的人格编辑页(列表暂时隐藏,左上角「返回人格列表」回到表格),页内填名称、emoji、强调色、风格摘要和角色设定(口吻、性格、口头禅),日记与留言会按当前人格的设定来写。表格还带「日记」篇数与「最近使用」两列,能看出哪个人格在活跃。人格存在 personas.json,内置人格随插件更新,自定义人格只存本地。
记忆范围怎么选:
global,所有项目通用。workspace。数据在哪:
%DSH_HOME%\plugin-data\dsh-long-memory\ # Windows 默认 C:\Users\<你>\.dsh\...
~/.dsh/plugin-data/dsh-long-memory/ # macOS / Linux
├── memories.json # 记忆库(可以直接用编辑器看,格式是普通 JSON)
├── diary.json # 每日日记:正文、心情、emoji、配图路径、习惯
├── personas.json # 自定义人格与当前启用的人格
├── settings.json # 暂停记录的工作区列表
├── last-run.json # 最近一次提炼的明细:新增/合并条数、耗时、错误
└── status.json # 本次启动以来的计数:看到的轮数、成功/失败次数、最近错误
DSH_HOME 环境变量可以覆盖根目录。删除 memories.json 等于清空全部记忆。
敏感信息:写入前会过滤 GitHub token、sk- 密钥、AWS/Slack 凭据、私钥块、身份证号、手机号和 密码: xxx,替换成 [已脱敏];来源对话同样处理。
导出:面板上「导出 MD / JSON」两个链接,分别下载分组好的 Markdown 手帐和完整 JSON 备份。
按工作区暂停:记忆页会列出所有工作区,可单独切到「已暂停」,之后该项目不再自动提炼(memory_save 等手动工具仍然可用)。
历史会话回填:插件只记安装之后发生的对话。想把安装前的旧对话也变成记忆,点记忆页的「开始回填」:它会扫描 ~/.dsh/sessions/ 下所有工作区的既有会话(每个会话取最近 10 轮,一次模型调用提炼 ≤6 条并入记忆库),进度与新增/合并/跳过计数实时显示,可随时取消;子代理会话与已暂停的工作区会跳过。
成本:每完成一轮会多一次小请求(输入约 2k tokens,输出上限 700);系统提示里多一段 ≤1400 字的摘要,且每个会话只计算一次,对缓存友好。回填按会话计费,默认最多 40 个会话,也就是最多 40 次小请求。
隐私:记忆是从对话中提炼的,提炼请求发给当前会话已经在用的模型路由;记忆文件只存在本地,插件本身不上传任何东西。
session/event:turn/start 开缓冲区,收集 user/message 与 assistant/message 的文本。turn/end 且 reason = completed 时,用 session.requestHeader() 拿到当前路由,请求模型输出 JSON:
[{"scope":"global|workspace","text":"…","tags":["…"]}]。
子代理会话(header.origin = subagent)和非正常结束的轮次直接跳过。
如果安装/重载发生在轮次进行中(错过了 turn/start),会从会话日志回放该轮内容。在插件管理里禁用或移除 dsh-long-memory 即可,记忆文件会保留;重新启用后继续使用。彻底清除请删除 %DSH_HOME%\plugin-data\dsh-long-memory\。
memories.json 里确实有内容;空库不会注入任何东西。last-run.json 没更新:该轮可能不是 completed(被中断、报错、超长),或来自子代理会话,这两类都会跳过。last-run.json 的 error 或 status.json 的 lastError;常见原因是当前路由不可用。memory_forget 删掉;或直接编辑 memories.json 后重启。自动提炼的提示词已经要求「不记临时进度和可从代码直接读到的内容」。node --check index.js
node tests/memory.test.mjs
目录:
index.js # 插件本体:事件、提炼、注入、三个工具
lib/memory.js # 纯函数:归一化、相似度、解析、合并、裁剪、摘要
locale/{en,zh}.json # 插件管理里显示的名称与说明
icon.svg # 插件图标
cordis.patch.yml # bundle 的 Loader 插入行
tests/ # 无框架的 node 断言测试
无构建步骤、无第三方依赖;改完直接重新安装目录即可。
Automatic long-term memory for DeepSeek Harness: after each finished turn it distills the few facts worth keeping across sessions, and feeds them back into later sessions.
global holds who the user is and how they want answers (identity, preferences, taboos, language, style); workspace holds this directory's stack, commands, conventions, key decisions and pitfalls. They never mix.memory_search, memory_save, memory_forget for the cases automatic distillation cannot cover.0.2.1-rc.3).git clone, or download the ZIP and extract).plugin_manager with install_bundle and pass the folder's absolute path as target.application: applied, the plugin list shows Long-term Memory / 长期记忆.There are no settings to configure. No restart is required; diagnostic files such as status.json exist from 0.1.1 on.
It is automatic. Just talk normally; the next turn or the next session knows what to remember and what to bring back.
Call the tools only when you want to be explicit:
| Tool | What it does | Parameters |
|---|---|---|
memory_search |
Keyword search over memories; returns row ids | query (required), scope = auto/global/workspace, limit |
memory_save |
Save one durable fact; near-duplicates merge | text (required), scope = global/workspace, tags |
memory_forget |
Delete one row by id | id (required) |
Detail panel — click the memory icon in the left sidebar to open a full page (the same page also sits in Settings). It reads the live store and analyses it: totals (all / global / workspace / new in 7 days), a health score (duplicate rows, rows untouched for 30 days and a failed last distillation each cost points and are listed as reasons), top tags, the last distillation's outcome and duration, and the full list with search, scope filtering and per-row delete. The panel is a high-blur glass surface — translucent cards, backdrop blur and hairline borders that follow the active theme.
Every row expands into "view conversation": the full user message and assistant reply of the turn it came from (with session id, turn number and time), plus the row's created/updated times, hit count, source and full workspace path. The source conversation is captured at distillation time; each row keeps its five most recent sources.
Daily diary — the panel has three tabs: Memory, Diary and Personas. The diary writes one entry per day from that day's memories in the persona's voice: 300–420 characters, two or three paragraphs, a closing line, plus the habits observed that day (stored as global memories tagged habit). Each entry carries a mood (happy/angry/sad/shy/confused/daily) and two or three emoji; when dsh-meme is installed, a matching image is picked from its library and served by this plugin at data?meme=<date>. Entries live in diary.json; "rewrite today" regenerates the current one.
Personas — the default is 「🐟 大肥鱼」, with 「傲娇猫娘」「温柔学姐」「毒舌管家」「赛博黑客」「佛系禅师」 built in. The table lets you activate one, copy a built-in into a custom one, or edit/delete your own. New and edit open a dedicated editor screen (the table hides, a back link returns to it) where a persona is a name, an emoji, an accent colour, a style summary and a role prompt that the diary and its comment are written in. Two extra columns show how many diary entries each persona has written and when it was last used. Built-in personas ship with the plugin, custom ones live in personas.json on your machine.
Choosing a scope:
global.workspace.Where the data lives:
%DSH_HOME%\plugin-data\dsh-long-memory\ # Windows, default C:\Users\<you>\.dsh\...
~/.dsh/plugin-data/dsh-long-memory/ # macOS / Linux
├── memories.json # the store (plain JSON, safe to inspect and edit)
├── last-run.json # the latest distillation: added/merged counts, duration, error
└── status.json # counters since boot: turns seen, successes, failures, last error
The DSH_HOME environment variable overrides the root. Deleting memories.json clears all memories.
Cost — one small extra request per completed turn (about 2k input tokens, up to 700 output), plus a ≤1400-character digest in the system prompt that is computed once per session, which keeps it cache-friendly.
Privacy — memories are distilled from the conversation and the request goes to the model route the session already uses; the store stays on your machine and the plugin uploads nothing.
session/event: turn/start opens a buffer, which collects the text of user/message and assistant/message events.turn/end with reason = completed, it reads the current route from session.requestHeader() and asks the model for JSON in the form
[{"scope":"global|workspace","text":"…","tags":["…"]}].
Subagent sessions (header.origin = subagent) and turns that did not complete are skipped. If the plugin was installed or reloaded mid-turn (missing the turn/start), it replays that turn from the session log instead.Disable or remove dsh-long-memory in the plugin manager; the memory files stay and are reused if you re-enable it. To wipe everything, delete %DSH_HOME%\plugin-data\dsh-long-memory\.
memories.json actually has rows. An empty store injects nothing.last-run.json did not update after a turn — that turn probably was not completed (interrupted, errored, max-tokens) or came from a subagent session; both are skipped by design.error in last-run.json or lastError in status.json; the usual cause is an unavailable model route.memory_forget, or edit memories.json and restart. The extraction prompt already asks the model to skip transient progress and anything obvious from the code.node --check index.js
node tests/memory.test.mjs
Layout:
index.js # the plugin: events, distillation, prompt digest, three tools
lib/memory.js # pure functions: normalisation, similarity, parsing, merge, prune, brief
locale/{en,zh}.json # display name and description in the plugin manager
icon.svg # plugin icon
cordis.patch.yml # the bundle's Loader insert row
tests/ # dependency-free node assertion tests
No build step, no third-party dependencies; reinstall the directory after editing.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: memory。