nuwa-skill
alchaincyf
你想蒸馏的下一个员工,何必是同事。蒸馏任何人的思维方式——心智模型、决策启发式、表达DNA。Distill how anyone thinks.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:yinguobing/dsh-memory-index
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Full-text memory index for DeepSeek Harness.
It indexes the Markdown memory tree you already have — a core MEMORY.md, daily notes, a wiki, and archived sessions — into one local SQLite FTS5 database. It adds memory_search, memory_read, and memory_write, plus optional startup recall. No embeddings, no API key, no sidecar process, and no file migration.
This is the lexical-first release. Semantic retrieval is planned as an additional layer, not a replacement for the file tree.
Most memory plugins ask you to adopt their storage format. This one assumes your memory is already a set of Markdown files and makes that tree searchable:
MEMORY.md, memory/YYYY-MM-DD.md, wiki/, and archive/sessions/ remain ordinary files you can read, edit, git diff, or delete.trigram when the SQLite build supports it, with a unicode61 fallback and CJK 3-gram expansion.It is not a replacement for an atomic-fact store, a vector memory service, or an approval-gated AGENTS.md editor. It solves a narrower problem: make the memory tree I already write to searchable from DSH.
This package is not published to npm yet. Install it from a local checkout or a packed tarball. The prebuilt v0.1.0 tarball is attached to the GitHub release.
From the local checkout:
dsh plugin --profile web add "link:/absolute/path/to/dsh-memory-index"
dsh --profile web
From the packed tarball:
dsh plugin --profile web add /absolute/path/to/dsh-memory-index-0.1.0.tgz
dsh --profile web
When it is published later, the command becomes:
dsh plugin --profile web add dsh-memory-index
Then set workspace in the profile's cordis.patch.yml to the directory that contains your memory tree. The bundle's default uses the Harness process directory so installation never guesses a personal path; override it:
- id: memory-index
config:
workspace: /home/you/notes
writeMode: readonly
autoRecall: off
buildOnStart: false
Run /memory-rebuild once in a new session, then /memory-status.
| Tool | Purpose |
|---|---|
memory_search |
Search the configured roots; returns path:line and a snippet. Optional scope limits to one source. |
memory_read |
Read a file inside a configured memory root. |
memory_write |
Append to today's note, append to the core file, or create/replace a file under a write root. |
Commands: /memory-status, /memory-rebuild (add fts to rebuild the full-text table from scratch).
- id: memory-index
name: dsh-memory-index
config:
workspace: /home/you/notes
indexDb: .memory/index.sqlite
roots:
- { path: MEMORY.md, source: core }
- { path: memory, source: daily }
- { path: wiki, source: wiki }
- { path: archive/sessions, source: session }
writeRoots:
- MEMORY.md
- memory
digest:
- { path: MEMORY.md, maxChars: 3500 }
- { path: 'memory/{today}.md', maxChars: 1500 }
- { path: 'memory/{yesterday}.md', maxChars: 1000 }
timeZone: Asia/Shanghai
sourcePriority:
core: 0
daily: 1
wiki: 2
session: 3
writeMode: readonly # readonly | readwrite
autoRecall: off # off | startup
buildOnStart: false
maxResults: 8
maxFileBytes: 20971520
maxWriteBytes: 204800
maxDigestChars: 8000
| Field | Default | Meaning |
|---|---|---|
workspace |
required | Directory containing the memory tree. Resolved once and used as the boundary for all reads/writes. |
indexDb |
.memory/index.sqlite |
SQLite file, relative to workspace, or :memory:. |
roots |
MEMORY.md, memory/, wiki/, archive/sessions/ |
Files or directories to index. A file root is indexed directly; a directory root is walked recursively. source labels the results. |
writeRoots |
MEMORY.md, memory/ |
Paths the agent may write. Entries ending in .md are files; others are directories. |
digest |
MEMORY.md, today, yesterday |
Optional startup excerpt. {today} and {yesterday} use timeZone. |
timeZone |
system zone | Used for daily-note filenames and digest placeholders. |
sourcePriority |
core, daily, wiki, session |
Lower ranks first in ties. Unknown sources sort last. |
writeMode |
readonly |
Set readwrite to enable memory_write. |
autoRecall |
off |
Set startup to add the digest as prompt context for workspace agents. |
buildOnStart |
false |
Build the index in the background after plugin load. |
maxResults |
8 |
Default and cap for memory_search (1–20). |
maxFileBytes |
20 MiB | Files larger than this are skipped. |
maxWriteBytes |
200 KiB | Maximum content accepted by one memory_write. |
maxDigestChars |
8000 | Character budget for the startup digest. |
roots and writeRoots are independent on purpose: you can index wiki/ and archive/sessions/ while allowing writes only to memory/.
workspace; .. and absolute escapes are rejected.memory/ cannot redirect a read or a write outside the workspace.O_NOFOLLOW; writes create a temporary file with mode 0600, fsync, and rename.MEMORY.md by default) is append-only..env* files and paths containing credentials are excluded from indexing.tokenize='trigram', FTS5 handles substring matching; otherwise the table falls back to unicode61.Intl.Segmenter when available, then widened with CJK 3-grams if the first pass is too narrow.bm25, then source priority; a lexical LIKE fallback covers short terms and tokenizer gaps./memory-rebuild or process start with buildOnStart. memory_write indexes its own write immediately.workspace/.memory/; choose a shared indexDb only if you understand the locking model.node:sqlite may print an ExperimentalWarning on Node 22/24. The package targets ^22.19.0 || >=24.0.0.line is its heading/start line; use memory_read when exact context matters.memory_search tool; lexical FTS5 remains the offline fallback.The memory model — a core MEMORY.md, daily notes, a dream journal, a wiki, and an archived session tree — comes from OpenClaw, which is MIT-licensed. This package is an independent DSH implementation of that model; it shares no code with OpenClaw. The goal is to preserve the useful shape of an existing memory tree, not to emulate OpenClaw's runtime.
npm install --ignore-scripts
npm test
npm run pack:check
Tests use node:test against temporary workspaces and cover Chinese/English search, scopes, write modes, path traversal, symlink escapes, digest rendering, and FTS rebuilds.
MIT. See LICENSE.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: memory。