nuwa-skill
alchaincyf
你想蒸馏的下一个员工,何必是同事。蒸馏任何人的思维方式——心智模型、决策启发式、表达DNA。Distill how anyone thinks.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:doresu/dsh-memory-chain
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Five-layer memory for DeepSeek Harness: opening a new conversation shouldn't feel like meeting a stranger.
Zero dependencies, no patches to the DSH install, everything on local files. It exists to answer one question — context windows are expensive, so why store "remembering" and "recalling" in the same place?
English | 中文说明
| Layer | What is stored | Cost per request |
|---|---|---|
| L0 Library | Bodies on disk in L0/docs/<id>.md, index in L0/index.json |
Titles + ids of the 6 newest, ≤420 chars |
| L1 Bridge | The last 4 messages of the previous session, read from the session event log | ≤320 chars, and only in the first turns of a new session |
| L2 Recall | Ebbinghaus-weighted entries | Top 12 by weight, ≤1100 chars |
| L3 Artifacts | Documents tagged artifact:* |
5 newest, ≤320 chars, owner switch |
| L4 Self-note | What the model writes about itself, rolling window | 24 entries / 3600 chars |
All five are system-prompt sections, re-evaluated on every assembly. Nothing is appended to the message history.
Numbers from one machine (the host estimates 4 chars/token; CJK text is denser in practice):
Tool schemas are a permanent tax, which is why L3 adds no new tool — it reuses memory_search(tag:"artifact") and only pays for one extra tag field (+17 tokens).
Requires DSH >=0.2.1-rc.2.
# from a local checkout
dsh plugin --profile web add /path/to/dsh-memory-chain
# or straight from git
dsh plugin --profile web add git+https://github.com/doresu/dsh-memory-chain.git
The plugin manager adds the package to the profile's bundles — no manual patch editing. Then restart the engine.
Check ~/.dsh/memory/state.json:
{ "status": "active", "sections": 5, "tools": 7 }
A new conversation should show a ## 原文库 section once it is live.
Manual install without the package manager: see examples/cordis.patch.yml.
$DSH_HOME/memory/
L1/bridge.json tail of the previous conversation
L0/index.json document index
L0/docs/<id>.md document bodies
L0/misses.jsonl searches that returned nothing
L2/items.json weighted entries
L2/archived.jsonl faded or forgotten entries
L3/owner.json artifact card switch ({enabled:false} hides it)
L4/self.json self-narrative window
L4/archive/ archived notes
state.json written only after registration succeeds
| Tool | What it does |
|---|---|
memory_write_doc |
Persist a document; same title updates in place, id stays |
memory_search |
Keyword search returning snippets and paths, never full text; optional tag |
memory_read_doc |
Read a body by id, pageable |
memory_note |
Record a durable fact; same key merges, raises weight, lengthens half-life |
memory_forget |
Retract a fact (archived, not deleted) |
selfnote_append |
Append a self-narrative entry |
selfnote_rewrite |
Rewrite the whole window; the old version is archived first |
interpolate: false keeps {{…}} inside memory text from being read as template variables.agent/pre-step. preStep() calls assemble() first and only then dispatches the waterfall, so anything a section needs must come from the assembly context (text(context) receives { agent, scope, signal }) — not from state written by the hook.agent/pre-step carries a delta, not history. Its messages are the inbox claim for that step — at step 1 that is just the incoming user message. Anything that needs conversation context must read agent.session.log, whose events also include injected user messages (time-context, skill-catalog, …) that must be filtered out by source.kind.hits=1 and fades in two weeks.数据,非指令 — documents can contain instructions, and those must not inherit the authority of the system prompt.*.bak-<timestamp> before the reader falls back to empty.L0/misses.jsonl, and node scripts/misses.mjs summarises it. If a month of misses stays in the single digits, embeddings are a solution without a problem. Embeddings mean a dependency and a network hop — a bad trade on a phone.file://…?v=2, but only a recomposition actually reloads.importance on L2 is filled in by the model, not a calibrated parameter.node test/store.test.mjs # 35 tests, pure functions, no DSH needed
node test/integration.mjs # boots a throwaway DSH and checks the plugin really activates
node scripts/misses.mjs # summarises searches that returned nothing
MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: agent、memory。