@dsh-memory/bundle
dsh-memory — cited memory over DSH's lossless session log: post-session distillation into human-auditable markdown files, a compact recall index, memory_read/memory_expand tools, and a dsh-memory CLI
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Jesse-njx/dsh-memory说明文档
阅读完整 README ↗dsh-memory
Cited memory over DSH's lossless session log. Distilled facts that can always escalate back to the exact original context.
dsh-memory is a DeepSeek Harness bundle. When a session ends, a background distillation pass extracts durable facts — user preferences, project decisions, environment quirks, corrections — into small markdown files under ~/.dsh/memory/. Every memory carries a citation (sessionId, [start..end]) pointing at the exact log events it came from. The next session gets a compact index of those memories, plus two tools: memory_read (the full memory) and memory_expand (the cited original log excerpt).
The key idea: summaries are an index into ground truth, never the truth. Retrieval surfaces the one-line distilled fact (cheap); when the agent needs more, memory_expand returns the exact original log events (exact, not reconstructed). DSH can do this cheaply because it already sits on a complete, append-only transcript store — no memory store is built, only a memory index.
Why this shape
Mainstream memory systems (Mem0, Letta/MemGPT, Zep) share one weakness: extraction is lossy and unaccountable. Once a summarizer mangles a fact, the original is gone or unfindable, and the agent confidently recalls the mangled version. DSH's differentiator is the append-only session log: everything the model ever saw is already durably stored. So dsh-memory distills into files (human-auditable, git-diffable, deletable with rm) and keeps a citation back to the log on every fact.
How it works
- Distill (post-session, async via
ctx.jobs) — when a session leaves the store, a background job feeds the session's live events (bounded transcript, token-capped) to one cheap-model pass and asks for durable facts as JSON. Facts become memory files; existing memories are updated in place (citation appended,revbumped) or contradicted (the named memory is rewritten, keeping its name). Every pass is recorded in/_distill.log(JSONL). - Recall (every prompt assembly) — a system-prompt section renders a compact, token-capped index of
name — descriptionlines for the current project (plus shared user memories). Bodies stay one call away; the cited source one call away.