nuwa-skill
alchaincyf
你想蒸馏的下一个员工,何必是同事。蒸馏任何人的思维方式——心智模型、决策启发式、表达DNA。Distill how anyone thinks.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:HuaimaoCy/dsh-memory-vault
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English | 中文
A knowledge and memory vault for DSH: conversations settle into memory groups, every memory is assigned freely between conversation memory and the knowledge base, the conversation-creation screen offers a knowledge application choice that pulls memories in from elsewhere, and useless memories can be hidden at any time. The model gets six tools and a standing memory index; a person gets a tile board in the sidebar, built from the shell's own components and design tokens.
| Concept | Meaning |
|---|---|
| Memory group | The first-level container. A group can be a topic ("project conventions", "troubleshooting log") or one session's dedicated container. |
| Memory entry | One memory: title, body, kind, tags, visibility. |
| Assignment | Every entry and group is assigned to conversation (belongs to the session that produced it) or knowledge (reusable across sessions). |
| Knowledge application | Which memory groups one session has "plugged in". An applied group's memories enter that session's prompt directly — this is the channel for cross-conversation memory sync. |
| Hiding | Reversible retirement. The entry, its tags, and its group survive; it leaves search, the prompt, and the board by default. |
Assignment is always changeable: the model uses memory_assign, a person drags a tile onto a scope facet. An entry's assignment may differ from its group's — promoting a memory from the knowledge base to conversation memory leaves it filed in its original group and marks it manual, after which it no longer follows the group.
The package declares dsh.bundle, so both install paths work.
# Path one: CLI (run from the dsh source checkout root)
pnpm dsh plugin --profile web add "<absolute path to this plugin directory>"
# Path two: the Web sidebar's Plugins page -> install -> the same absolute directory
The install appends dsh-memory-vault to dsh.profile.bundles in ~/.dsh/profiles/web/package.json. Restart dsh web to take effect: Host code is an in-process module, and replacing an installed package does not hot-reload (the browser half is the exception — see Development).
Remove it with:
pnpm dsh plugin --profile web remove dsh-memory-vault
| Tool | Purpose |
|---|---|
memory_group |
List, create, update, or delete memory groups, switch a whole group's assignment, or bind / unbind where this conversation's summaries are filed. |
memory_write |
Write one or more memories, optionally assigning them in the same call. Bodies accept Markdown and LaTeX. |
memory_recall |
Keyword search, read one entry by id, or list by group, assignment, or tag; includeHidden reaches hidden memories too. |
memory_assign |
Reassign, move between groups, set a priority (0–100), mark a base prompt memory, or hide and restore memories. |
memory_apply |
Apply knowledge to the current conversation (cross-conversation sync): list / set / reset; groups applies whole groups, entries applies single memories. |
memory_curate |
AI curation: one model call decides whether each memory is reusable knowledge or a one-off note and suggests a group; review only reports, apply files. |
memory_summarize |
Settle this conversation into one memory. With content, your text is stored as written; without it, the plugin calls a model over the unsummarized increment. |
The plugin registers one system-prompt section naming the groups, their assignments, their entry counts, their priorities, their auto-summary switch, each group's highest-priority memory titles (see "Knowledge priority and the knowledge index"), the group this session is bound to, and the knowledge this session has applied. The index is priority-sorted and size-capped — priority is set deliberately, so the order only moves when somebody moves it and writing a memory does not reshuffle the prompt prefix.
turn/end. It trips when the message count reaches autoSummaryTurns (default 6) or the character count reaches autoSummaryChars (default 4000), and only for a bound group with auto-summary switched on.sessions.summarized_seq. A summary covers only what follows the watermark and then advances it.ctx.llm.stream() call, using the session's routed session.requestHeader().config provider/model (config can override). It does not enter a session log, does not wake an idle agent, and does not pass through the agent loop.max-tokens) counts as a failure and is never filed as memory.memory_summarize runs the same path on demand; full=true covers the whole visible session history.Automatic summarization spends real model quota. Set
autoSummarytofalseto keep only manual summarization, orsummarizertooff.
The memory choice appears in two places, covering the whole life of a conversation:
On the new-conversation screen, above the composer. The shell renders conversation.input.dock for a blank session too, while conversation views are not rendered at all until a session has content — so this case gets its own row: one pill per memory group, lit when applied, with Use defaults to clear the choice. It reads the session snapshot it receives and hides itself the moment the conversation starts, handing over to the tab below.
Once the conversation has started: the 知识 tab beside Chat and Trajectory, a conversation.view entry at order: 20 (after chat at 0 and the trajectory at 10):
Applied and Available. Memory groups appear as tiles, and dragging a tile across the two areas applies or removes it. Clicking a tile toggles it as well, so touch and keyboard readers are not locked out of the interaction.Applied to plug the whole group into this conversation.Use defaults, Apply nothing (an explicit empty set), and refresh.Both surfaces read and write the same per-session state, so a group chosen on the creation screen is exactly what the tab shows once the conversation begins.
Three outcomes stay distinct: apply a set, apply nothing on purpose, and fall back to the default. By default (applyByDefault: true) a new conversation applies applyDefaultGroups (default ["知识库"]); an empty knowledge base injects nothing, so the default costs nothing. Injection is capped (applyMaxEntries / applyMaxChars).
That is the cross-conversation sync: a conclusion settled into the knowledge base from conversation A is available in conversation B immediately. The model does the same thing through memory_apply.
The injection budget is finite (12 memories / 2400 characters by default), so which memory gets in has to be decided by importance rather than by when it happened to be written.
Priority is 0–100, one scale for groups and memories alike:
memory_assign priority= (one memory) or memory_group action=update priority= (a whole group); in the panel, pick a level on the priority row of a memory, or step a group by 10 with −/+ in Manage groups.The knowledge index is what that section of the prompt now lists:
知识库(2 组):
- DSH 插件开发 [DSH, 插件开发] · P40 · 组内 16 条 — 为 DSH 开发插件的可复用知识
· [P90] 界面必须用外壳自己的基元与设计令牌
· [P70] Host 半要重启、浏览器半会热更
· …
Beside each group's name and count, the index lists that group's highest-priority memory titles (indexEntryTitles, 5 by default, 0 to switch the catalogue off). That is what lets the model judge whether a group is worth reading — or worth applying to this conversation — without spending a search on it first: the index stops being a table of contents and becomes a menu, which is the point of having one.
The section ends by naming the step it can take next: memory_recall for the bodies, memory_apply groups=[...] to plug in a whole group, memory_apply entries=[...] to carry a single memory across, and memory_assign priority= to raise one.
On the panel side a tile shows a P90 badge when its priority is raised, and the 知识 tab marks every injected memory as picked here or via group, so why a memory is in the prompt is never a mystery.
Some memories are standing conventions — "every coding task leaves a git trail". They should not depend on which groups a conversation applied, and they should not eat the room it reserved for what it chose. Mark them as base prompt:
memory_write with base: true; in the panel, the Base prompt row on a memory's detail screen.memory_assign with base: true/false, in bulk if needed.baseMaxEntries, default 4, and baseMaxChars, default 1200).The quota decides how many applied memories a conversation injects (12 by default). It now lives in the vault rather than only in a profile file:
− / + in the panel's 知识 tab, effective immediately, no restart.applyMaxEntries / applyMaxChars in the config remain the deployment defaults; the panel writes an override, and setting it back to the default restores it.A vault collects two kinds of thing that look identical as text: conclusions worth keeping for months, and details that mattered once. The vault cannot tell them apart by itself, so one model call does:
memory_curate action=review # verdicts only, nothing written
memory_curate action=apply # file them
apply, reusable memories move to the knowledge base under that group (created if needed) and one-off memories go back to conversation memory; applyPriority: true also lifts the reusable ones to priority 60.It is a real model call and spends quota; 50 memories at most, 20 by default.
A Memory Vault entry appears in the sidebar. The knowledge base and conversation memory are one tile board; assignment survives only as a filter.
The panel renders with the shell's own primitives and design tokens (--dsw-*): buttons, pills, tags, switches, checkboxes, inputs, and icons come from @deepseek-ai/dsh-client-ui-primitives, so typography, spacing, corner radii, and light/dark theming follow the application automatically.
+ New memory, and refresh.All / Knowledge base / Conversation memory, every tag in use with its count, a Show hidden switch, and the grouping mode (by memory group, by tag, or none).Hidden tag, and offers Restore in place.Knowledge base / Conversation memory to reassign it, or on any tag facet to label it. A group card can be dragged onto a scope facet.Esc or Back leaves it)Preview / Source toggle: preview typesets the body with the shell's Markdown renderer (below), source shows the raw text.AI自动总结 / 人工输入 follow provenance and cannot be removed; other tags can be added (Enter adds one) and removed.Edit (title, kind, body), Save, move to the other assignment, move to another memory group, Hide / Restore, and Delete.+ New memory reuses the same detail screen: pick a group and assignment, write the body in Markdown, add tags, and saving files it as 人工输入.
The panel and the model call one Host-side operation table, so both surfaces always see one dataset.
A memory body is rendered by the shell's own MarkdownText (@deepseek-ai/dsh-client-ui-primitives): GFM parsing, tables, task lists, footnotes, reference links, code highlighting, and TeX math typeset by KaTeX. It is the same renderer and the same styles the assistant's own messages use, so typography, sizing, and light/dark behavior match exactly.
$...$; display math uses $$...$$.extractMarkdownPlainText (typesetting every formula on every tile would be slow); the full render belongs to the detail screen.AI自动总结 marks threshold-summarized and memory_summarize memories, and 人工输入 marks memories the model wrote through memory_write or that you created in the panel. They search and filter like any other tag.tag parameter of memory_recall does the same for the model.Hide button on the detail screen, or the hidden parameter of memory_assign.Show hidden in the facet row and press Restore on the dimmed tile, or press Restore on the detail screen.Override the shipped layer from ~/.dsh/profiles/web/cordis.patch.yml:
- id: memory-vault
name: 'dsh-memory-vault'
config:
databasePath: null # defaults to $DSH_HOME/memory-vault/vault.sqlite
conversationGroupName: '对话记忆'
knowledgeGroupName: '知识库'
autoSummary: true # threshold summarization on or off
autoSummaryTurns: 6 # unsummarized message threshold
autoSummaryChars: 4000 # unsummarized character threshold
summarizer: 'llm' # 'llm' calls a model; 'off' keeps manual only
summarizerProvider: null # provider override (defaults to the session route)
summarizerModel: null # model override
summarizerMaxTokens: 1600
summarizerTimeoutMs: 120000
injectIndex: true # inject the memory index section
injectMaxGroups: 24 # groups listed at most
indexEntryTitles: 5 # memory titles listed per group; 0 turns the catalogue off
baseMaxEntries: 4 # base-prompt memories injected (not part of the quota)
baseMaxChars: 1200 # character budget for the base layer
transcriptRetention: 400 # summarized transcript rows kept per session
searchLimit: 20 # default `memory_recall` result cap
maxEntryChars: 20000 # longest entry body
applyByDefault: true # whether a new session applies the default groups
applyDefaultGroups: ['知识库'] # which groups those are
applyMaxEntries: 12 # memories pushed into one session's prompt
applyMaxChars: 2400 # character budget for those memories
Configuration is validated when the plugin loads: a bad value fails that row and names the offending field instead of degrading silently.
node:sqlite — the same engine the harness's own SQLite storage backend uses, with no native build step and no third-party runtime dependency.groups, entries (with hidden), applications (session × group), sessions (binding, summarization watermark, whether the application set was chosen explicitly), summaries, meta. An older database gains the added columns and system tags on open.$DSH_HOME/memory-vault/).pnpm dsh plugin --profile web remove dsh-memory-vault
Remove-Item -Recurse "$env:USERPROFILE\.dsh\memory-vault" # the memories, optionally
dsh web restart: the plugin lives outside the profile directory, so HMR does not watch it. The browser file client.js is the exception. While only client.js has been hot-reloaded, the panel derives the system tags from source and builds its own tag inventory; persisted system tags, hiding, and server-side tag filtering wait for the restart.applyMaxEntries / applyMaxChars) and the model must search for the rest.transcript, and full=true still sees only the session's currently visible history.# Standalone smoke test: drives tools, priority, the knowledge index, the base-prompt layer, a tunable quota, AI curation, per-memory application, hiding, watermark summarization, the panel route and the request boundary on a mock ctx, then renders the knowledge view, the board and the new-conversation strip for real (151 checks)
cd <this plugin directory>
node tests/smoke.mjs
dsh-memory-vault/
├── index.js Host half: wires storage, tools, prompt section, panel routes, session observation
├── client.js Browser half: sidebar entry, tile board and detail screen, knowledge-application control
├── cordis.patch.yml Bundle layer: inserts the plugin row and its default configuration
├── src/
│ ├── config.js Config defaults and Standard Schema validation
│ ├── store.js SQLite schema, migrations, and every read/write operation
│ ├── tools.js The six model tools and their result rendering
│ ├── prompt.js The memory index and the applied-knowledge block
│ ├── summarize.js One-shot model call and summarization prompt
│ └── http.js Same-origin HTTP routes the panel and the control use
└── tests/smoke.mjs Smoke test
The plugin depends on nothing but ctx (the Cordis context) and imports no @deepseek-ai/* runtime module; the browser half takes only react and @deepseek-ai/dsh-client-ui-primitives from the module table's baseline.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: memory。