How to use dsh-memory-system
Provides local-first persistent memory across sessions for DSH, zero external dependencies, Markdown data storage, writes require confirmation.
This article is auto-derived from indexed fields (wiki / faq / compatibility_json), not freshly AI-generated.
This article is derived from the plugin's already-indexed fields (wiki / faq / compatibility_json / readme), not freshly generated by AI. Source field is noted at the end of each section.
Quick start
dsh-memory-system
— source: plugin_wiki.wiki_content
Install & verify
dsh plugin --profile web add @zhujunpeng12/dsh-memory-system
Run the command above in your DSH Web Profile. Then enable the plugin in the plugin list.
— source: plugins.install
Key points
- 在默认位置
~/.dsh-memory/创建记忆库骨架(memory/{events,index}+projects/+ 空user_profile.md/rules.md),控制台打印已初始化记忆库于 ...; - 该会话首轮自动注入热记忆包(画像/规则/项目摘要/近期事件),开箱即有记忆。
memory_write默认是 dry-run(预览):不显式apply=true且经用户确认,不落盘。「Agent 说记下了」≠ 真写入了——需要时用memory_gate/查看 events 文件确认。- 冷召回是 BM25 关键词检索,不是语义向量:适合精确/近精确匹配(专有名词、代码、日期、明确主题),对同义改写、长尾表达、跨语言召回有限;向量检索默认关闭(零依赖代价)。
- 单写者租约锁:同一记忆库同一时刻只有一个写者,多 Agent 并发写会串行化(等锁)。不适合多 Agent 高频同时写同一个记忆库——多写者场景请拆分记忆库或错峰。
— source: plugin_wiki.readme_en (fallback readme_raw)
FAQ
What's the difference between this plugin and DSH's built-in session memory?
DSH default sessions are amnesiac between sessions; this plugin precipitates the "facts" generated in each session (rules, project notes, corrections, etc.) to local Markdown (default ~/.dsh-memory), and automatically injects a ≤14KB "hot memory package" at the start of each new session, with the ability to recall historical details on demand. The entire data set is stored on your own computer, requiring no database or external vector services.
Where is memory data stored? Will it leak to the cloud?
Stored by default in the ~/.dsh-memory/ directory under the user's home directory, which is a regular Markdown folder. The repository itself contains no personal data. If you need visualization, you can set the MEMORY_VAULT environment variable to point to your own Obsidian Vault, and all read/write operations happen locally on your machine.
Do I need to manually configure anything after installation?
The first run automatically creates the ~/.dsh-memory/ skeleton (including subdirectories like memory/events/index/projects and empty user_profile.md/rules.md), requiring no manual configuration. To switch to Obsidian mode or customize the path, set the MEMORY_VAULT and DSH_HOME environment variables.
Will the Agent secretly modify my memory files?
No. All write operations (memory_write) are dry-run by default (preview), only actually writing to disk when the user explicitly confirms and sets apply=true; writes also have four layers of protection: 30-second lease lock, SHA-256 preconditions, before-image backups, and commit receipts. Corrections must supersede the original entry and never overwrite historical raw logs.
Is Python required to use this?
Yes. The memory engine is implemented using Python standard library scripts (no pip packages required), requiring Python 3.10+ with the command name available as python; if your executable is named py or python3, set the PYTHON environment variable to point to it before starting Harness.
How do I uninstall? Will there be residual files?
Run npx @deepseek-ai/dsh plugin --profile web remove @zhujunpeng12/dsh-memory-system in the web profile directory to uninstall the plugin itself; the plugin will not delete memory data under ~/.dsh-memory/, so if you won't use it anymore before uninstalling, you need to manually back up or delete that directory.
Do I need Obsidian?
No. It's a regular local Markdown folder by default, viewable with any editor; only when you want to use Obsidian's visualization features like bidirectional links and relationship graphs, you can set MEMORY_VAULT to point to your Vault to switch to Vault mode. Templates are in templates/vault/.
Can cold recall understand paraphrases?
No. Cold recall is based on exact matching + Chinese bigram BM25 + metadata reranking, suitable for precise/near-precise matches (proper nouns, code identifiers, dates, clear topics); paraphrase recall, long-tail expressions, and cross-language recall capabilities are limited. Vector semantic search is disabled by default to maintain zero dependencies.
— source: plugin_wiki.faq_json
Compatibility
- DSH: 0.1.0-rc.7
- Node: 22 或 24(>=22)
— source: plugin_wiki.compatibility_json
Pitfalls
Review the upstream repo before installing. This guide is auto-derived from indexed fields and may lag the latest release. If anything contradicts the official docs, treat the upstream source as authoritative.
— source: general rule