In the plugin-based ecosystem of DeepSeek Harness (DSH), building agents with long-term memory is a common requirement. Traditional memory solutions often rely on static logs with low retrieval efficiency, or on external cloud services that introduce privacy risks. dsh-living-memory aims to solve these issues by providing a fully localized memory storage and retrieval solution with self-maintenance capabilities.
Plugin Introduction¶
dsh-living-memory is a “living” memory plugin designed for DeepSeek Harness and maintained by dearbld. It captures information from agent conversations, lessons learned, and decisions made into a local SQLite knowledge base, and performs periodic proactive maintenance: deduplication, merging, association into a knowledge graph, and simulation of the hippocampus’s “forgetting-reuse” mechanism.
Core Features¶
- Fully local and single-file storage: Data is stored entirely locally in a single SQLite file. By default, no telemetry data leaves the device. The optional vector channel is disabled until configured.
- Self-maintained nightly inspection: The plugin periodically runs nightly inspections to process the store. It performs deduplication and merging (handling highly similar entries), temporal decay (unused entries have reduced weight), conflict detection (when old and new memories conflict, it flags rather than silently overwrites), and knowledge graph construction.
- Hybrid recall mechanism: Supports hybrid retrieval across seven signals, using the Reciprocal Rank Fusion (RRF) algorithm to merge rankings. This includes full-text search (SQLite FTS5 + jieba tokenization), decay factors, relevance weighting, co-occurrence statistics, knowledge graph PPR algorithm, and hop-count enhancement.
- Chinese-first processing: Uses a dedicated Chinese tokenization configuration to ensure accurate retrieval of Chinese corpora.
- Web GUI telemetry panel: Integrated into the DSH Web GUI to provide data snapshots and audit trails.
- Separation of data and code: Guard rules and dictionary configurations are JSON data files rather than code logic. This means that adjusting defensive strategies or customizing terminology does not require modifying source code, and published packages will not include site-specific blacklists.
Installation and Enablement¶
Use the official installation command to complete registration. The command invokes the corresponding package manager based on the specified profile (default is web).
dsh plugin --profile web add dsh-living-memory
After installation, restart DSH. The plugin automatically registers the following tools:
memory: Providessearch(search),timeline(timeline),stats(statistics),read_episodic(read episodic memory), andread_evolution(read evolution) capabilities.memory_write: Provides typed write functionality (fact/decision/todo/lesson), with support for optional relationship edges.
The plugin automatically mounts read/write roles through cordis.patch.yml, with zero configuration by default. If write permissions need to be restricted, adjust the file.
Data Location and Configuration¶
Data files are stored by default under the DSH configuration path in the user’s home directory:
~/.dsh/dsh-living-memory/
The directory contains database files, daily snapshots, and configuration files (such as guard-rules.json and dict-extra.json).
Vector Channel (Optional)¶
The plugin supports a vector channel to enhance retrieval, but it is disabled by default. To enable it, configure EMBEDDING_BAILIAN_KEY in DSH’s credential manager. The plugin then reads the key through DSH’s credential pipeline and does not store the key locally.
Guard Rules and Dictionary¶
According to the design philosophy, guard rules and dictionaries are data files, not code.
- Guard rules: Organized into three layers, with the first layer having the highest priority. They include three rule groups: deny (hard blocking), sensitive (not automatically extracted), and warning (soft blocking).
- Dictionary: Used for entity recognition and knowledge graph type labeling. It supports overriding the default configuration with a custom JSON file.
Typical Usage¶
In the agent workflow, follow these steps:
- Search before acting: Before executing a task, call
memory search <topic>to check for relevant past decisions or facts. - Write key information: Use
memory_writeto record decisions, lessons, or todo items, specifying their types. - View the timeline: Use
memory timelineto view a memory overview sorted by time in descending order, helping the agent locate context. - Rely on nightly inspection: Let the plugin automatically perform deduplication, merging, and decay during nightly runs to keep the knowledge base clean and accurate.
Notes¶
- The plugin runs with the permissions of the current DSH process. Ensure you review the source code and license (MIT) before installation.
scripts/preflight.cjsis run automatically beforenpm publishfor pre-release compliance scanning.- The plugin does not force dependency on any external services. Even if the vector channel is unavailable, the remaining six local signals can guarantee basic functionality.