Preface

The core philosophy of DeepSeek Harness (DSH) is plugin-based design. When developing agents, implementing persistent memory usually requires manually handling session state, data serialization, and cleanup logic. dsh-gentle-engram is an adapter designed for this purpose. It bridges Engram’s persistence capabilities into DSH workflows and manages state through Cordis lifecycle hooks.

What This Is

This is a Host Cordis plugin maintained by eehcx. It provides an Engram integration for DeepSeek Harness and ensures that Engram’s persistence behavior runs reliably within DSH.

Core Features

The plugin primarily provides the following capabilities:

  1. Tool invocation: Reuses the official @deepseek-ai/dsh-mcp-client line to invoke Engram MCP stdio tools.
  2. Lifecycle hooks: Hooks into multiple key DSH points, including session startup, receiving an input prompt, tool result return, turn stop, and agent destruction.
  3. Context injection: Seeds relevant Engram context and passes it to the next model call.
  4. Asynchronous persistence: Asynchronously saves prompts and filtered passive tool learning content.
  5. Write serialization: Serializes writes per session and waits for pending writes to complete at turn boundaries.
  6. Session cleanup: Closes the Engram session when the agent is destroyed and logs a structured summary.
  7. Security: Never directly accesses Engram’s SQLite files and avoids forwarding parameters that may contain sensitive information.

Installation and Setup

Using this plugin requires the following prerequisites:

  • DeepSeek Harness is installed and the dsh plugin command is enabled.
  • Engram is installed on the system and available in PATH.
  • A DSH profile is configured, such as web.

Installation steps:

  1. Run the installation command:
    npx @deepseek-ai/dsh plugin --profile web add dsh-gentle-engram
  1. After the installation is complete, restart the DSH service.

Before starting DSH, it is recommended to check whether Engram is available:

engram --version

Use Cases and Notes

This plugin is suitable for scenarios that require integrating persistent memory into DSH.

Notes:
* This package is a Host bundle, and its cordis.patch.yml file manages both the MCP bridge and the lifecycle plugin.
* Do not edit the plugin’s bundled preset files, and do not manually add a second Engram MCP line.
* This plugin depends on Engram being present. If Engram is not installed or is unavailable, the plugin cannot function properly.

Short Conclusion

dsh-gentle-engram simplifies the integration of DeepSeek Harness and Engram through automated lifecycle management. Developers do not need to manually handle session closure and context persistence to gain persistent memory capabilities.