Preface¶
When developing multi-turn conversations or Agents in DSH (DeepSeek Harness), a common approach is to rely on vendor-side memory banks or cloud-based vector retrieval: the data is not local, retrieval fails when the network is disconnected, and if the pipeline silently fails, the UI still displays “Enabled” yet injects 0 items for extended periods. Maintainer a1141171521’s dsh-memfuse (repo a1141171521/dsh-plugin-memfuse) establishes plain-text Markdown on disk as the source of truth; the read, write, injection, and retrieval paths do not call any model; automatically extracting memories from conversations can be toggled independently and is enabled by default, following the conversation model. Below we introduce its positioning, storage, and installation methods.
What Is This¶
dsh-memfuse is a long-term memory plugin for DSH (npm package name dsh-memfuse, current version 0.1.0, license MIT). Data defaults to landing in ~/.dsh/memory/, can be edited with any editor and tracked with git diff. Community directory page: skillhub.cn plugin page. For the authoritative feature list and technical notes, see docs/spec.md in the repository.
What Problems It Solves¶
The README uses three comparisons to summarize the design orientation:
| Common Practice | Consequences | dsh-memfuse |
|---|---|---|
| Memories stored in vendor databases | Hard for users to export, modify, or audit | Plain-text Markdown on local disk |
| Retrieval relies on cloud vectors | Retrieval fails during network outages or rate limiting | Local CJK bigram + BM25, zero network |
| No feedback when pipeline fails | Toggle appears on but doesn’t work | Failures written into injection content and status.md |
Auto-extraction is the only part that uses models by default; you can disable it under “Settings → Memory.” When disabled, the remaining capabilities (persisting to disk, retrieval, injection, manual writing) are still available, and the raw Q&A will be written into sessions/ as a fallback.
Storage Layout and Source of Truth¶
The default root directory is ~/.dsh/memory/ (it can be placed in a git repo to track changes):
~/.dsh/memory/
├── index.md ← L0 global index (derived, can be deleted and rebuilt)
├── memories/<id>.md ← Atomic memories (source of truth)
├── skills/<id>.md ← Reusable skills (source of truth)
├── sessions/<date>.md ← Raw Q&A per turn (source of truth)
└── .memory/
├── state.json
├── usage.jsonl
└── status.md
index.md, status.md, and usage.jsonl are derived views; if deleted, the plugin will rebuild them. A single memory is Markdown with YAML front matter, fields include id, kind, priority (P0/P1/P2), confidence, title, summary, anchor, tags, lifecycle, stats, etc.; the body is human-readable description.
The forgetting chain includes: admission scoring, priority-based expiration (e.g., P1 expires after 30 days / P2 after 7 days without being recalled), dormancy, weak renewal, capacity-budget eviction, and physical deletion after being dormant for 30 days. P0 and user-written memories do not expire and are not deleted via eviction (destructive operations only mark them).
Core Capabilities (Documented Part)¶
Retrieval and Injection¶
- Retrieval: bigram tokenization + BM25, combined by priority,
confidence, andstats(recall/injection/feedback); injection is budgeted—P0 remains resident, related blocks take the top N by score, and if there are too many, it degrades to a single index line. - Trust boundary is annotated during injection: entries are treated as reference material rather than instructions, and are sanitized via
lib/guard.jsto avoid credential-like content being written into the memory store.
Zero-LLM Path¶
Read, write, inject, retrieve, and skill determination are designed to make zero model calls; the repository README states tests pass under zero-LLM conditions (badge shows 134 passing; the end of the README also mentions 142 tests; refer to the repository’s current test script). Auto-extraction has an independent master switch, enabled by default (since 2026-10-17); when disabled, health status will note the master switch state and it is not considered a fault.
UI and Skills (H7/H8)¶
- Turn-tail candidate card (
conversation.chat.turnTail): when a set of memories can be solidified into a skill, it inline-displays “Refine into skill / Not needed”; rendering counts as “viewed,” and after “Not needed,” if the same cluster key remains unchanged it will not prompt again. - Two-stage refinement: after clicking “Refine into skill,” the host calls the model to generate a draft; after the user “Keeps” it, it is written into
~/.dsh/skills/<name>/SKILL.mdwithout requiring a restart; if not installed, drafts remain inpending-skills/.
Agent Tools¶
| Tool | Description |
|---|---|
memfuse_recall |
Retrieve memories; level=l0/l1/l2 controls detail level |
memfuse_write |
The only write path; mode=add/replace/delete, protects P0/user assets |
memfuse_status |
Pipeline health: item count, distribution, last success/failure, pending confirmation queue |
memfuse_extract |
Manually run extraction; supports dryRun |
memfuse_feedback |
Report whether memories are useful (learning-loop signal) |
memfuse_skill |
Skill library: list / show / distill / approve / reject / patch / dismiss |
Installation and Activation¶
The plugin reads/writes files under ~/.dsh/ with the permissions of the current DSH process; please review the source code and the MIT license before installing. The official README provides two methods and does not present a unified one-click command dsh plugin add github:... as the preferred approach.
Method A: Mount package in profile (Recommended)¶
Edit ~/.dsh/profiles/<profile>/package.json:
{
"dependencies": {
"dsh-memfuse": "link:<absolute path to this repo>"
},
"dsh": {
"profile": {
"bundles": [
"@deepseek-ai/dsh-base",
"@deepseek-ai/dsh-web-app",
"dsh-memfuse"
]
}
}
}
When using link:, changes to the code require restarting the host process; the client bundle requires restarting the application to take effect.
Method B: cordis patch¶
Edit ~/.dsh/profiles/<profile>/cordis.patch.yml (must use insert: syntax):
- insert:
- id: dsh-memfuse
name: 'dsh-memfuse'
config:
extract:
enabled: false
For the full configuration options, see cordis.patch.yml in the repository root. The README notes extract.enabled is set to false in the patch example; the Settings page’s “Enable memory learning” master switch documents that it is on by default—refer to your actual profile and the Settings page.
Settings Entry¶
Recommended: Settings → left “Memory” (alongside Account, General, Models, Plugins, etc.). A tri-state “Memory learning” banner appears at the top. You can also enter the same form from Plugins → dsh-memfuse card → Package page. Options include: enable memory learning, follow the conversation model, extraction model, model-unavailable strategy, fallback model, candidate persistence method, skill suggestion switch, etc.
Settings → Built-in Plugins is a read-only list and does not render the form for this plugin.
Updates: The README states you can use git pull or reinstall via dsh plugin add and then restart DSH; the Settings page’s “Check for updates” only does a read-only comparison of the remote version (e.g., v0.1.0).
Development and Self-Testing (Optional)¶
In the directory where the source has been obtained, you can run tests and previews without installing DSH:
npm test
npm run preview
npm run demo
npm run preview starts a static server and opens docs/preview/turn-tail-card.html, loading the real lib/client.js for offline preview of candidate card styles. Requires Node >= 18.
Use Cases and Notes¶
Suitable for developers who want to retain preferences, agreements, and project context long-term within DSH, and require auditable, manually editable data and retrieval that does not depend on the network. If you do not want to consume any model quota at all, you can disable memory learning and still use manual memfuse_write, session persistence, and local retrieval injection.
This plugin belongs to the community ecosystem (SkillHub directory; not officially affiliated with DeepSeek / High-Flyer), GitHub stars about 3 (subject to the repository page). For feedback, please use Issues; the README also provides a DSH plugin QQ group 1105449571 (remark “dsh 插件” to join).
Closing¶
dsh-memfuse turns long-term memory into “local Markdown source of truth + local retrieval + visible failures + optional auto-extraction,” forming a clear division of labor with cloud black-box memory. Directory page: https://www.skillhub.cn/plugins/a1141171521/dsh-plugin-memfuse; source and README: https://github.com/a1141171521/dsh-plugin-memfuse.