Introduction¶
DeepSeek Harness (dsh) splits capabilities into plugins, with the core not carrying long-term memory by default. Common community approaches include SQLite FTS5 or memory plugins with web interfaces: the former is not friendly to Chinese retrieval, while the latter may cause the entire plugin tree to fail to start in pure IM environments (profiles without web surfaces like Feishu or WeChat) due to inject: ['webServer'].
Below is an introduction to dsh-memory-md published by maintainer smallwhitelin (SkillHub category: Memory). It uses a manually editable Markdown file as the source of truth, performs case-insensitive substring matching for retrieval, only injects into tools and systemPrompt, and does not depend on a web interface.
What Is This¶
dsh-memory-md is a minimalist long-term memory plugin for dsh: CJK-friendly substring search, directly editable Markdown by humans, and no web interface required.
It is positioned as Explicit memory: when users say “remember…”, “change to…”, or “forget…”, the model calls the corresponding tool; it does not automatically accumulate, call additional models, or build indexes. You decide what to store.
Two Differences from Common Approaches¶
-
Searchable Chinese: FTS5’s default tokenizer often treats entire Chinese sentences as single words, so substrings like “墨绿色” (dark green) may have 0 hits; this plugin uses substring matching, so any Chinese fragment, English text, or even a few characters can match without touching the tokenizer.
-
Works in pure IM: Only
inject: ['tools', 'systemPrompt'], no database writing, no network access, no subprocess launching, suitable for profiles like@dsh-feishu/dsh-feishu.
Core Features¶
Memory File¶
The default path is determined by the configuration path, recommended:
path: !!js dshHomePath('memory/MEMORY.md')
That is ~/.dsh/memory/MEMORY.md. Example structure:
# Memory
<!-- One entry per line, `- content`; edit this file directly, changes take effect next round -->
- User prefers replies in Chinese
- User's favorite color is dark green
- Deployment machine workspace is /home/zero/workspace
You can directly use an editor to add, delete, or modify lines, and the next conversation round will re-read the file to apply changes. When the plugin modifies entries, it only touches the target line, using atomic writing (.tmp then rename) to avoid partial files.
Tools¶
| Tool | Function | Matching |
|---|---|---|
memory_add(text) |
Add a new entry (completely identical content is automatically skipped) | — |
memory_replace(old_text, new_text) |
Modify an entry (entire line replacement, position unchanged) | Case-insensitive substring, must uniquely match |
memory_remove(old_text) |
Remove an entry | Same as above |
memory_search(query) |
Search | Same as above |
Uses substring positioning instead of IDs, so references won’t become invalid after manual editing; multiple matches will cause an error, requiring more specific input and retry.
Injection¶
Memory content is injected as a system prompt section. Default maxInjectChars: 3000, exceeding will truncate and prompt to use memory_search instead. Suitable for stable fact lists, not for building large knowledge bases.
Installation and Activation¶
Choose any method below, replace <your profile> with the actual profile name; restart the profile service after changes (or automatically takes effect if hot reload is supported).
Method A — From GitHub (no account needed)
dsh plugin --profile <your profile> add github:smallwhitelin/dsh-memory-md
Method B — npm (after publication)
dsh plugin --profile <your profile> add dsh-memory-md
Method C — Manually write profile’s cordis.patch.yml
- insert:
- id: memory-md
name: 'dsh-memory-md'
config:
path: !!js dshHomePath('memory/MEMORY.md')
maxInjectChars: 3000
Configuration Options¶
| Key | Default | Description |
|---|---|---|
path |
Required | Path to Markdown memory file |
maxInjectChars |
3000 | Maximum characters injected per round |
searchLimit |
20 | Maximum number of results returned per memory_search call |
order |
50 | Prompt section order |
Typical Usage¶
- Install and configure
path, then start the profile. - Say “remember I prefer replies in Chinese” in conversation → model calls
memory_add. - Say “change my favorite color to dark blue” →
memory_replace, using old content substring to uniquely locate the line. - When memory grows and exceeds injection limits, let the model use
memory_searchto query keywords instead of relying on the entire injection. - For batch organization, directly edit
MEMORY.md, and changes take effect next round after saving.
Use Cases and Notes¶
Suitable for: Need to long-term remember a small amount of stable facts in IM; want the file to be readable and diffable; Chinese retrieval must be reliable; don’t want to enable web or SQLite FTS.
Environment: Node ≥ 24 (consistent with dsh requirements); zero runtime dependencies (only node:fs / node:path). To uninstall, delete the corresponding plugin from the profile and restart, the Markdown file remains on disk.
Security: The plugin reads and writes the file pointed to by path with the current dsh process permissions. Before installation, please review the GitHub repository source code and MIT license yourself. The community directory SkillHub plugin page and DeepSeek / High-Flyer have no official affiliation, it’s only for ecosystem inclusion.
Conclusion¶
dsh-memory-md consolidates long-term memory into a single Markdown file: Chinese substring searchable, explicit tool-based CRUD operations, no web binding. When integrating, you can refer to the SkillHub directory page or GitHub README for installation commands and configuration fields.
- Directory page: https://www.skillhub.cn/plugins/smallwhitelin/dsh-memory-md
- GitHub: https://github.com/smallwhitelin/dsh-memory-md