The plugin-based architecture of DeepSeek Harness (DSH) allows developers to extend functionality through plugins. In agent development, knowledge is discarded after a conversation ends. The dsh-plugin-memory plugin uses the Session Distillation mechanism to transform completed conversation turns into persistent knowledge entries and register them as Skills for use in subsequent sessions.
The plugin is maintained by 16480000 and is licensed under MIT. It distills question-and-answer interactions and tool calls into structured data, stores them in a local directory, and exposes them to the model through memory-<slug> skills.
Installation¶
Install via npm (recommended, no build permissions required):
dsh plugin --profile <name> add dsh-plugin-memory
Install via GitHub (from source):
dsh plugin --profile <name> add github:16480000/dsh-plugin-memory
When installing from GitHub using pnpm ≥10, add the allowBuilds configuration to the profile’s pnpm-workspace.yaml:
allowBuilds:
dsh-plugin-memory: true
Install via a local tarball:
pnpm pack
dsh plugin --profile <name> add ./dsh-plugin-memory-0.1.0.tgz
Configuration¶
The plugin supports overriding default settings through the profile’s cordis.patch.yml. The main configuration items are as follows:
| Configuration | Type | Default | Description |
|---|---|---|---|
autoDistill |
boolean | true |
Whether to automatically distill completed turns. |
memoryDir |
string | <DSH_HOME>/memory |
Memory storage directory. |
distillProvider |
string | session route | Provider used for distillation. |
distillModel |
string | session route | Model used for distillation. |
maxTokens |
number | 3000 |
Output Token limit per distillation or merge call. |
Example override configuration:
- id: memory
name: dsh-plugin-memory
config:
autoDistill: false
Core Features¶
-
Automatic Collection
On everyturn/endwith reasoncompleted, the plugin collects the question-and-answer content and tool call results from the conversation. -
Distillation and Merging
The plugin invokes an auxiliary model to distill the collected content into a strict JSON format, includingtitle,answer,sources, and an optionalmerge_withfield. If the model determines that the current entry has the same topic as an existing entry, returningmerge_withtriggers a merge call; if merging fails, the new entry is kept and overrides the existing entry. -
Persistent Storage
Entries are persisted in the<DSH_HOME>/memorydirectory. Each entry generates a Markdown file<slug>.mdand an index file_index.json. Index writes are atomic (temporary file + rename). -
Skill Registration
The plugin registers amemoryskill provider and offersmemory-<slug>skill candidates (Rank 550, ranked below hand-written skills). Loading the skill returns the corresponding entry Markdown content. -
Service API
The plugin registers thectx.memoryservice, which provides the following methods:list(): Returns the current memory index.readEntry(slug): Reads the Markdown content of a specific entry.settled(session): Waits for all pending distillation tasks in the session to complete.
Notes¶
- Missing security policy: The plugin has no content security policy, and distilled answers are stored as-is.
- Filter limitations: The incomplete answer filter is marker-based and may produce false positives or false negatives.
- Scope isolation: All sessions share one memory directory; isolation by workspace or agent scope is not supported yet.
- Management mechanism: The directory lists all entries, with no session-level limits or size-based eviction mechanism.
- Dependency requirements: A DeepSeek Harness build that includes the
purpose: 'memory'vocabulary and thememory/*event mechanism is required. Older versions can still load the plugin and distill content, but some functionality will be missing.
Conclusion¶
dsh-plugin-memory provides basic Session Distillation capability for DeepSeek Harness. It is suitable for scenarios that require building long-term conversation context or a knowledge base. Review the source code and license before installation.