Introduction

The core design philosophy of DeepSeek Harness (DSH) is “everything is a plugin,” enhancing agent capabilities through extension plugins. dsh-memgas is a long-term memory plugin among them, addressing the problems of agents losing project context during multi-session interactions and being unable to reuse historical conventions and decisions.

Plugin Purpose

This plugin is maintained by user quqxui and is open-sourced under the MIT license. It provides long-term memory storage capabilities for DSH, with its core lying in multi-channel retrieval fusion and a memory evolution loop.

Core Features

Multi-Channel Retrieval Fusion

The plugin runs four retrieval channels in parallel and outputs final results based on Reciprocal Rank Fusion (RRF):
* Lexical: Based on SQLite FTS5, preserving identifier integrity; suitable for paths, package names, and error codes.
* Dense: Vector similarity; suitable for paraphrased queries.
* Granularity: Entropy-router–based weighting that determines the retrieval unit (session/turn/summary/keyword).
* Graph: Association graph retrieval based on personalized PageRank; suitable for multi-hop associations.

Memory Evolution Loop

The plugin runs six maintenance processes in a background queue to continuously optimize the memory store:
* Associate: Cluster and associate new memories with existing memories.
* Reconcile: Merge duplicates and resolve conflicts.
* Reinforce: Increase the weights of frequently used memories.
* Decay: Archive unused memories.
* Abstract: Generate summaries for large clusters.
* Re-associate: Refresh the association graph.

Local Storage

Data is stored in local SQLite, with no dependency on external API keys or model downloads, and it never leaves the machine.

Installation and Activation

Installing the plugin requires access to the npm registry or direct installation from GitHub.

dsh plugin --profile web add dsh-memgas

or

dsh plugin --profile web add github:quqxui/dsh-memgas

The repository includes a prebuilt single-file artifact, so GitHub installation does not require a build step. After installation, restart DSH to activate it; it works with zero configuration by default.

Typical Usage

Model Tools

The model can call the following tools:
* memory_save: Save facts or conventions.
* memory_search: Search memories.
* memory_status: View status.

User Commands

Users can manage memories through commands with the /memory prefix:

/memory search <query>      # 检索并列出记忆卡片
/memory diag <query>        # 查看各检索通道的详细结果和融合过程
/memory list [n]            # 按重要性列出记忆
/memory export              # 导出记忆为 JSON
/memory forget <id>         # 归档记忆

Example

Save project conventions in a session:

$ dsh --profile headless "Use memory_save to remember: this project deploys on port 8080,
                          and dependencies are managed with pnpm."

Saved to memory:
1. **Environment**: the project's deployment port is 8080.
2. **Convention**: dependencies are managed with pnpm (not npm/yarn).

In a new session, ask directly without explicitly invoking tools; the plugin has already injected the memory into the context:

$ dsh --profile headless "What port does this project deploy on? What manages dependencies?
                          Answer directly."

From long-term memory:
- **Deployment port**: 8080
- **Dependency management**: pnpm

Configuration and Extension

Although it supports zero-configuration operation, it can still be customized via cordis.patch.yml. Configuration items include mode selection (lite/hybrid/memgas), recall count, automatic summarization toggle, and local model embedder configuration.

Use Cases and Considerations

This plugin is suitable for scenarios requiring maintenance of complex project context across sessions. Data is stored entirely locally, making it suitable for privacy-sensitive projects. It is recommended to review the source code and license before installation.