highland0971/dsh-native-memory
Native, per-workspace long-term memory for DeepSeek Harness: approval-gated writes, cited provenance, FTS cross-session recall — no external server, no extra runtime dependency.
已收录
0
Memory
Bundle 已验证
预览
功能介绍
基于 DSH 原生接缝的按工作区记忆:事实与有界常驻档案落在 storage-domain 的 JSON 单元上,写入经人工审批并带 `(sessionId, seq)` 引证,确定性召回 + session-query 全文检索历史会话——无外部服务器、无自建 SQLite。
适合
- 需要按确切工作区隔离长期事实和有界常驻档案的 DSH 用户。
- 要求记忆写入经人工审批,并可通过 `(sessionId, seq)` 引证重建来源的工作流。
- 希望在不部署外部记忆服务器的情况下进行确定性事实召回和历史会话全文检索的用户。
不适合
- 要求静默或完全自动写入记忆的工作流;记住、编辑、遗忘和导入都需要审批。
- 希望在无关工作区之间共享一套全局记忆的用户;授权按精确工作目录隔离。
- 希望在默认策略下保存凭据或疑似密钥文本的场景;此类内容会被拒绝。
- 期望所有记忆事实始终注入上下文的工作流;常驻内容仅为有界档案,其余需按需召回。
README
dsh-native-memory
Native, per-workspace long-term memory for DeepSeek Harness (dsh): facts and profiles stored on the harness’s own storage-domain, cross-session recall through session-query FTS, approval-gated writes, and cited provenance — no external server, no extra runtime dependency.
⚠️ Installing a plugin runs third-party code on your machine with your own permissions. Review the source (
src/) and the security model before installing.
Why this one
| dsh-hermes-memory | dsh-native-memory | |
|---|---|---|
| Storage |
~/.dsh/settings.yaml namespace |
dedicated storage-domain unit (~/.dsh/storages/dsh_memory.json) |
| Scope | user-global, all projects | per workspace (exact-cwd authorization) |
| Write safety | silent, model-only | human approval gate + session-log audit |
| Recall | everything always injected (hard caps) | bounded always-on profile plus on-demand recall + FTS over past sessions |
| Dependencies | vendored imports into the harness checkout | none beyond zod + the harness itself |
See docs/design.md for the full architecture and the competitive landscape analysis.
Install
dsh plugin --profile web add dsh-native-memory # npm after release
dsh plugin --profile web add /path/to/this/repo # from a checkout
Restart dsh web. The bundle enables session-query full-text search and adds
the memory tools to every session. Details and configuration:
docs/install.md.
Tools
| Tool | Kind | Gate |
|---|---|---|
memory_remember |
add/update a fact in this workspace (secrets rejected by default) | approval |
memory_edit |
replace a fact | approval |
memory_forget |
archive a fact (soft delete) | approval |
memory_recall |
deterministic three-tier keyword scan (tags > text > fuzzy; freshness/access tie-breaks) | none |
memory_search |
FTS over this workspace’s past sessions (caller excluded) | none |
memory_expand |
expand a fact’s citation to the original log excerpt | none |
memory_consolidate |
near-duplicate merge suggestions + cap budget | none |
memory_import |
import candidate facts from a past session’s log | approval (per fact) |
memory_profile |
read the always-injected workspace profile | none |
memory_export |
write a git-friendly Markdown mirror (.dsh-memory/memory.md, masked, idempotent) |
none |
Every fact records its origin (sessionId, seq) — memory stays
reconstructable from the lossless session log.
Writes reject secret-shaped text (tokens / keys / passwords) by default;
secretPolicy: "mask" | "off" in the bundle patch relaxes that. The
credential-assignment detector can flag benign token: … values of ≥16
characters. Prompt injection and tool output always mask secrets.
A read-only browser page (settings → 记忆) lists every workspace’s facts with
secrets masked; deletions are copied as a memory_forget instruction and land
in the chat through the approval gate.
Opt-in session-end proposals (proposeOnSessionEnd: true): one cheap LLM call
distills a finished session into candidate facts shown in the next sessions;
they become facts only through the approval-gated memory_remember.
A compaction drift guard (compactionGuard: true, on by default) surfaces
literal anchors a compaction summary dropped, as data to verify in the next
sessions — deterministic, no LLM.
Development
pnpm install
pnpm build && pnpm typecheck && pnpm test
New contributors start at docs/handoff.md and docs/contributing.md. Chinese docs: README.zh.md.
License
常见问题常见问题
在启用了 DSH 的终端中执行已验证命令 dsh plugin --profile default add github:highland0971/dsh-native-memory。命令会解析公开 package 元数据,并保持插件与本页展示的目录身份一致。
兼容性以页面上展示的 bundle 与 profile 状态为准。如果某个 profile 尚未检测到,请先保持禁用,并在生产启用前阅读仓库文档。
GitHub 链接和 activity 元数据是 release 与维护状态的来源。新版本发布后重新查看本页,确认目录已经观察到最新版本。