Introduction¶
The DeepSeek Harness (DSH) ecosystem already contains dozens of memory plugins, but it lacks a unified sharing standard. The official core only ships with an MCP memory example that is disabled by default. This plugin aims to fill this gap by building a deterministic, hierarchical, and cross-agent recognizable memory system using pure Markdown files.
It provides the Memory Standard Protocol (mm), supporting hierarchical memory structures, deterministic budget management, cross-agent interoperability, and session log digesting. The plugin provides a dsh toolchain and a standalone CLI. Its core library relies on Node.js built-in modules and has no additional dependencies.
Core Features¶
Hierarchical Memory Structure¶
It adopts a hierarchical design:
* MEMORY.md: a manually loaded index file that serves as the entry point for quick browsing. The default hard limit is 200 lines or 25 KiB.
* memories/
Deterministic Budget Management¶
Strict budget limits are enforced to eliminate silent data truncation:
* Write budget: each write is limited by character count. If the limit is exceeded, usage information is returned, requiring the agent to compress and retry.
* File limit: each detailed file has a hard byte limit.
* Index limit: when MEMORY.md exceeds the line or byte limit, the system explicitly raises an error and requires the index to be rewritten, rather than automatically truncating it.
Cross-Agent Interoperability¶
- Open format: based on pure Markdown and not dependent on proprietary protocols.
- URI recognition: supports portable URIs in the
mm://<memoryId>/<topic>format. - Schema definition: provides
schema/memory.schema.jsonto describe note structures. - Open API: provides public read/write interfaces, allowing any agent or tool to read from or write to the same files.
Write Timing and Snapshots¶
- Frozen snapshot:
mem_readloads a snapshot once at session start. Reads and searches within the session are based on that snapshot. Write operations are first staged (pendingWrites) and persisted to disk only after the session ends. This ensures session-view consistency and preserves prompt caching. - Digest collaboration: the
mem_digesttool recognizes official dsh session logs and compaction outputs, extracts candidate memories from them, but does not automatically write them. The agent decides whether to commit.
Toolchain¶
The plugin provides the following command-line tools:
* mem_read: reads the index or a specified detail.
* mem_write: writes or updates notes.
* mem_search: searches memories (supports FTS5 or scan mode).
* mem_budget: outputs a budget report (including index limits, per-note usage, and pending writes).
* mem_digest: extracts memory candidates from log files.
Installation and Enablement¶
The plugin is installed as a dsh bundle. Run the following in the directory containing the package:
dsh plugin --profile demo add github:JohnXu22786/memory-standard
After installation, start the profile configuration:
dsh --profile demo
At this point, the mem_* toolchain and the memory-standard system sections are loaded.
Configuration¶
The plugin ships with default configuration. All values can be modified by overriding the memory-standard line. Configuration options include:
root: memory root directory; defaults to$DSH_MEMORY_ROOT.memoryId: memory ID.indexLines/indexBytes: hard line and byte limits for MEMORY.md.detailMaxBytes: maximum bytes for a single detailed file.defaultWriteBudget: default character budget per write.nudge: toggle and interval for session-end or periodic reminders.
Typical Usage¶
Command-line tools¶
# Read memory
mem_read
# Search memory
mem_search deploy
# View budget
mem_budget
# Extract memory candidates from logs (no write)
mem_digest --file session.log.jsonl
Programming interface¶
In dsh plugin code, retrieve the memory instance via the service to perform operations:
const memory = ctx.get('memory');
// Write note
memory.write({
topic: 'deploy-region',
content: 'us-east-1',
summary: 'Deployment region'
});
// Search memories
const results = memory.search('deploy');
Use Cases and Notes¶
- Target audience: developers who need long-term memory, multi-session state preservation, and cross-agent collaboration.
- Environment requirements: Node.js >= 20.0.0 is required.
- Version compatibility: verified with
dsh@0.1.0-rc.6. - Permission note: this plugin runs with the current dsh process permissions. It is recommended to review the source code and license (MIT) before installation.
Summary¶
By introducing the mm protocol, this plugin provides a standardized memory layer for the DSH ecosystem. It uses pure Markdown files and deterministic budgets to address pain points in data loss and interoperability, making it suitable as a foundation for building long-term memory systems.
- Plugin directory: https://www.skillhub.cn/plugins/JohnXu22786/memory-standard
- Project address: https://github.com/JohnXu22786/memory-standard