Preface

In DeepSeek Harness (DSH) agent development, how to persist state, maintain context consistency across sessions, and safely manage sensitive information are common challenges for developers. Traditional solutions often lack unified storage-domain management and fine-grained scope control.

dsh-hermes-memory aims to provide DSH with a native, persistent memory solution. It does not depend on complex external vector databases, but instead leverages DSH’s own storage domains and session query services to provide a complete toolchain for writing, retrieving, and cleaning up memory.

Plugin Introduction

dsh-hermes-memory is a DSH plugin maintained by lcthe and belongs to the “Memory” category.

It focuses on solving memory management problems for agents running over long periods. Its core value lies in providing a secure, scope-based persistent storage mechanism, supporting automatic context injection at session start, and offering comprehensive idempotency and security scanning capabilities.

Core Capabilities

The plugin provides a set of explicit tools and configuration items for managing memory across different dimensions.

Basic Memory Operations

The plugin provides a set of basic tools for creating, reading, updating, and deleting memory entries.

  • memory_save: Save a memory entry.
  • memory_search: Retrieve memory entries.
  • memory_replace: Replace an existing memory.
  • memory_remove: Remove a memory entry.

These operations cover multiple scopes from global to project level.

Scopes and Persistence

Fine-grained scope separation is supported to ensure memory isolation.

  • Scope types: Supports Global, User, Project, and Failure memory.
  • Storage mechanism: Uses DSH’s storage-domain for persistence and includes Schema validation to ensure data structure consistency.
  • Session injection (V3 Scope): Supports optional V3 session-start injection. When a new session starts, the system injects a bounded reference context message to help the agent quickly enter context.

Security and Cleanup

Security is an important consideration for memory plugins.

  • Security scanning: Performs Secret and Prompt Injection scanning before writing to prevent sensitive information leakage or malicious injection.
  • Expiration cleanup: Supports expiration cleanup policies based on lastReferencedAt or updatedAt. Failure memory has an independent retention period, while other memory uses a general retention period.
  • Idempotency: Through source provenance and content deduplication mechanisms, repeated identical operations do not produce duplicate records.

Management and Monitoring Tools

In addition to basic CRUD operations, it also provides management tools for viewing system status.

  • memory_list: Lists bounded records under the current scope, category, and workspace.
  • memory_stats: Reports the number of records and characters used for each scope.
  • memory_pin / memory_pins / memory_unpin: Used to manage “Standing Context”, that is, fixed reference information that remains unchanged.

Automatic Capture and Provenance

The plugin can automatically capture rules from real interactions.

  • Event capture: Captures rules based on user/message events, such as recording project conventions, user preferences, or correction records.
  • Provenance tracking: Captured records include source: 'session' provenance, containing the Session ID and event sequence number.

Installation and Dependencies

The plugin is available as an npm package and is currently at version 0.3.0.

Because no explicit install_command is provided, integration usually requires using DSH’s plugin management mechanism or installing the npm package directly. Before installation, ensure the following Peer Dependencies are satisfied:

{
  "@deepseek-ai/cordis": "~4.0.4",
  "@deepseek-ai/dsh-agent": ">=0.2.0-rc.1 <0.3.0",
  "@deepseek-ai/dsh-client-locale": ">=0.2.0-rc.1 <0.3.0",
  "@deepseek-ai/dsh-client-ui-renderer": ">=0.2.0-rc.1 <0.3.0",
  "@deepseek-ai/dsh-client-ui-settings": ">=0.2.0-rc.1 <0.3.0",
  "@deepseek-ai/dsh-client-ui-slots": ">=0.2.0-rc.1 <0.3.0",
  "@deepseek-ai/dsh-llm": ">=0.2.0-rc.1 <0.3.0",
  "@deepseek-ai/dsh-session": ">=0.2.0-rc.1 <0.3.0",
  "@deepseek-ai/dsh-session-query": ">=0.2.0-rc.1 <0.3.0",
  "@deepseek-ai/dsh-settings": ">=0.2.0-rc.1 <0.3.0"
}

Use Cases and Boundaries

Use cases:
* Agent development that requires maintaining context across different sessions.
* Categorized management of memory data, such as by project or by user.
* Scenarios requiring automatic recording of user preferences or project corrections.

Notes and boundaries:
* No UI: There is currently no plan to develop a standalone memory management UI. All operations are completed through CLI tools or programmatic interfaces.
* Not a UI replacement: This plugin does not replace DSH’s chat UI or session Shell.
* Deferred features: Vector retrieval, custom session database access, and similar features are currently in a Deferred state and have not been implemented yet.
* Asset copyright: The plugin does not copy Pi’s runtime code, commands, TUI, branding, or visual assets; it only reuses general engineering design ideas.

Summary

dsh-hermes-memory provides a solid foundation for the DSH plugin ecosystem. By using native storage domains and session query services, it addresses core pain points in agent memory persistence and secure retrieval. For developers who need to build long-term memory capabilities, this is a tool worth considering.

View plugin directory
View source code