The design philosophy of DeepSeek Harness is “everything is a plugin.” When building agents with DSH, session memory often requires a separate MCP server for management. This approach has limitations: MCP servers typically operate in a “pull” mode, meaning the model must actively invoke tools to write memory; moreover, memory logic is separated from DSH’s session logs and permission system. The dsh-statecore plugin solves this problem by mounting the StateCore memory engine directly into the DSH plugin context, allowing memory management to participate in the session flow like other native capabilities.
This is a native memory plugin for DeepSeek Harness, maintained by yul761. It is based on StateCore technology and provides auditable facts and evidence chains. The plugin uses the MIT license and primarily addresses automatic ingestion, injection, and persistence of agent session memory.
Core Features¶
- Automatic Ingestion: During a session, automatically converts
user/messageandassistant/messageinto project memory, without requiring the model to actively call write tools. The plugin identifies machine-generated messages (such as context injection and compression checkpoints) and skips them, ensuring that the memory store only contains real conversational content. - Automatic Injection: Automatically injects a project memory digest into the model context during the
agent/pre-stepstage. - Compression Protection: After session compression, immediately summarizes ingested memory, ensuring that key facts are not lost after compression.
- Web Management Interface: Provides a “StateCore Memory” section in the settings page of
dsh web, where you can view grouped facts, open evidence chains (why), or perform a two-step reviewed forget operation. - Five Native Tools: Registers the
remember,recall,facts,why, andforgettools throughdsh-tools. These tools have honest JSON schemas, support retrieving structured evidence chains viaawait tools.why({factId})in Code Mode, and follow DSH’s permission and display workflow.
Installation and Enablement¶
Install the plugin using the following command:
dsh plugin --profile web add -w dsh-statecore
Start the service:
dsh --profile web
Typical Usage¶
- Shared Data Flow: The database stored by this plugin shares the
~/.statecoredirectory withstatecore-mcp. Facts remembered in a DSH session will also appear in thefactstool of Claude Code. - Model Invocation: The memory digest runs on the model already configured in the DSH host, without requiring a separate API Key.
- Local Storage: By default, data is stored in a SQLite file named
.statecoreunder the user’s home directory.
Notes¶
- Not an MCP Server: This is a plugin mounted into the DSH plugin context, not a standalone MCP server.
- Data Isolation: When
urlis not set by default, all read/write operations, except model invocations, target the local embedded SQLite storage. - Lifecycle: The plugin cleanly unregisters its tools during destruction and supports hot module replacement (HMR).
- Data Sharing: It shares the same storage data with
statecore-mcp.
dsh-statecore integrates the memory engine into DSH’s native context, providing tighter integration and stronger auditability than traditional MCP servers. It is suitable for agent development scenarios that require long-term, traceable memory within DSH sessions.