Preface¶
When developing agents in DeepSeek Harness (DSH), context window management is a core pain point. As the number of conversation turns increases, history grows rapidly; without control, the model can forget early key preferences or project facts. Meanwhile, processing long-term memory often requires introducing a standalone vector database or vector service, increasing system complexity. The DSH Hermes Memory plugin aims to solve these problems. It provides DSH with a lightweight long-term memory solution that supports hierarchical storage, automatic refinement, and compression, without requiring a standalone database process.
Plugin Overview¶
DSH Hermes Memory is a lightweight long-term memory plugin for local DeepSeek Harness. It borrows Hermes’ hierarchical and traceable ideas, and distills stable facts from conversations into structured memories through automatic refinement and compression mechanisms. The project is maintained by liuyuhao1122 and is licensed under MIT.
Core Capabilities¶
The plugin provides the following main features:
- Hierarchical memory storage: Memories are divided into
USER.md(user preferences),MEMORY.md(cross-project experience),projects/<project hash>.md(current project facts), andPROCEDURES.md(reusable procedures), and are injected into prompts as needed. - Automatic refinement and compression: Stable facts are automatically extracted after a session ends, and self-compression is performed when a character limit is reached or duplicate content is detected, keeping memory file sizes manageable.
- Privacy protection: Session logs are gzip-compressed and AES-256-GCM encrypted, with support for masking sensitive data.
- Tool-based query and management: A series of tool commands are provided for searching, reading, remembering, and deleting facts.
Installation and Enablement¶
Before using the plugin, ensure the environment meets the following dependencies:
- Node.js 20 or later
- DeepSeek Harness 0.2.0-rc.2
Installation Steps¶
Add the plugin to Harness using the official plugin installation command:
dsh plugin --profile web add github:liuyuhao1122/dsh-hermes-memory
After installation, restart the dsh web process to load the new plugin. The plugin automatically creates a data directory at $DSH_HOME/memories-hermes (or .dsh/memories-hermes under the user directory if the environment variable is not set).
Typical Usage¶
After installation, you can interact with memory through the tool commands provided by the plugin.
Tool Commands¶
- Search: Retrieve four layers of memory and recent raw session text.
hermes_memory_search({query, limit?})
- Read: Read a specific memory layer.
hermes_memory_read({layer})
- Source expansion: Expand original fragments by reference.
hermes_memory_source({ref})
- Add fact: Force-add a fact to the specified layer.
hermes_memory_remember({fact, layer})
- Delete fact: Remove matching entries from active memory.
hermes_memory_forget({fact, layer})
Data Structure¶
The plugin generates the following files under the data directory:
* USER.md: User preferences, injected into prompts.
* MEMORY.md: Cross-project experience, injected into prompts.
* projects/<project hash>.md: Current project facts, injected into prompts.
* PROCEDURES.md: Reusable procedures, read on demand.
* sessions/*.jsonl: Encrypted session fragments.
* memory.key: Local encryption key; must be preserved when backing up.
Notes and Limitations¶
- No standalone service: The plugin does not start a database, vector service, or standalone process; it relies entirely on DSH’s model quota and the local file system.
- Limitations of forget: The
forgetcommand only removes entries from active Markdown files and blocks normal search; it does not immediately erase encrypted sessions or refinement logs. - Retention period: Raw archives are retained for 30 days by default; refinement archives are retained for 365 days by default.
- Version compatibility: Compatibility has only been verified with DSH 0.2.0-rc.2; other preview versions are untested.
- Key security: Losing
memory.keycauses the plugin to stop initializing; it must be backed up together with log files.
Summary¶
DSH Hermes Memory provides DSH with a hierarchical memory solution that does not require an additional database. Through automatic refinement and compression, it can effectively manage context while maintaining data privacy. It is suitable for developers who want to quickly build agents with long-term memory capability in a local environment. For more details, see the plugin directory or the GitHub repository.