Introduction¶
DeepSeek Harness (DSH) relies on a plugin system to build extension capabilities. For context-dependent agents, long-term memory is key to maintaining coherence and improving accuracy, but simple storage easily leads to information redundancy, conflicts, and even contamination. dsh-plastic-memory is a plugin that provides memory storage, classification, retrieval, and governance capabilities for DSH, aiming to give agents a malleable memory capability and lifecycle management.
Core Features¶
The plugin mainly provides the following capabilities:
- Memory Classification and Extensibility: It includes five built-in memory types:
profile(identity),preference(preferences),knowledge(knowledge),project(project), andreference(reference). It supports extending custom types by configuring templates on top of the base types. - Workspace Isolation and Write Protection: Project memories are physically isolated from one another and invisible to each other; global memories are read-only. The model cannot directly write to the global scope. Any operation that promotes project memories to the global scope must be explicitly confirmed by the user, preventing contamination of global rules.
- Built-in Multi-layer Governance: It provides a memory health check mechanism that can block high-risk information (such as API keys), govern rule conflicts, and prevent cognitive degradation caused by long-term operation.
- Causal Tracing: Each memory is anchored to an original conversation trace slice. The model can call tools to trace back the original context in which the memory was generated, preventing hallucinations.
- Markdown File Storage: Memories are persisted as standard Markdown files, supporting transparent viewing and editing.
Installation and Activation¶
The plugin is currently in the Beta stage (v0.1.1-beta.3).
Runtime Requirements:
* Node.js ^22.19.0 || >=24
* DeepSeek Harness v0.1.7-rc.2 or later
Installation Command:
dsh plugin --profile web add dsh-plastic-memory@0.1.1-beta.3
After installation, the plugin declaration is automatically written to the configuration file of the corresponding Profile. It takes effect after restarting the Profile.
Toolset¶
The plugin provides the following tools, which can be used for daily interaction and memory governance:
Daily Interaction Tools¶
memory_save: Accumulates or updates a memory. It includes built-in duplicate validation and key detection. When similar content is encountered, it actively guides an update or forces an overwrite.memory_search: Multi-dimensional full-text search, supporting filtering by type and scope.memory_forget: Batch removal of memories. An archive snapshot is created automatically before deletion, and it can be restored within 14 days.memory_snapshot: Snapshot management. Supports manual tagging, difference comparison, historical version rollback, and recovery from accidental deletion.memory_source: Causal tracing. Traces back the original conversation trace slice used when the memory was distilled.
Memory Health Governance Tools¶
memory_health: Evaluates the quality of the entire memory library and returns a health score (0-100).memory_scan: Performs a deep full-library health check. It checks the rule layer (keys, orphaned references, broken files) and the semantic layer (conflicts, redundancy), and provides remediation suggestions.memory_confirm: Confidence refresh and disposition decisions. Confirm the confidence level of stale memories to extend their lifecycle, or manually arbitrate conflict scan results.memory_promote: Memory promotion flow. Promotes verified project-specific memories to the global scope. This operation must be confirmed by an explicit user instruction.
Configuration and Storage¶
Configuration Items¶
The plastic-memory configuration can be adjusted in the Profile’s cordis.patch.yml. Key configuration items include:
writeMode: Write mode (currentlyproactive).snapshotTokenBudget: Maximum token budget limit for context injection.evidenceLookup: Evidence tracing mode (off/strict/active).template: Preset scenario template (coding/office/custom).customTypes: Custom memory type definition dictionary.governance.enabled: Whether to enable the proactive governance layer.memoryRoot: Storage root path. Defaults to${DSH_HOME:-~/.dsh}/memories.
Storage Structure¶
Memories are stored in the local file system. The directory structure is as follows:
<memoryRoot>/
global/ # 全局记忆(跨项目共享)
<id>.md # 独立记忆词条
MEMORY.md # 全局聚合索引
<项目slug>-<hash>/ # 项目记忆(工作区隔离)
.workspace # 关联的本地绝对路径标记
<id>.md
MEMORY.md
Manual Editing Considerations¶
The plugin has an external change detection mechanism. Before calling tools, it automatically reloads.
When manually editing Markdown files, timestamps must be kept in UTC millisecond format, such as 2026-09-01T08:30:00.000Z. Files with incorrect formats are isolated and do not affect loading of other memories, but they remain visible in health checks.
Applicable Scenarios¶
This plugin is suitable for scenarios that require building DSH Profiles or agents with long-term memory capabilities. Through classification, isolation, and governance mechanisms, it helps developers resolve memory confusion caused by long-term agent operation.
Sources:
* GitHub Repository
* Community Directory