Introduction

When developing agents with DeepSeek Harness (DSH), common technical challenges include how to help an Agent remember decisions in long conversations, maintain rule consistency, and preserve project context across multiple requests. Manually maintaining memory files or relying on unstable conversation history often fails to meet production requirements.

The dsh-memory plugin provides DSH with a persistent, searchable project-level memory solution. It stores decisions, architecture notes, sprint goals, and session summaries in a local DuckDB database file, and provides a complete management interface through the Web Client. This ensures that rules and context are injected into every model request via system prompts and remain effective at all times.

Plugin Overview

The plugin is maintained by navid-kianfar and is released under the MIT open-source license. It creates a dedicated DuckDB file for each DSH project (located at <project>/.dsh/memory.db) to store various types of memory data. The Web Client provides a dedicated Memory tab, allowing developers to search, filter, edit, import, and export memories.

Core Features

1. Memory Management and Retrieval

The Memory tab in the Web Client integrates core memory management features:
* Multidimensional search: Supports semantic search (with Embeddings) and keyword search (BM25F).
* Status filtering: Supports filtering memories by status such as Active, Archived, and Expired.
* Action panel: Provides operations such as creating a new memory, creating a new rule, importing instruction files, exporting JSON, and rebuilding vector indexes.
* Session history: Displays summaries and read/write statistics for the last 50 memory sessions.

2. Forced Rule Injection

Rules are injected via system prompts rather than ordinary messages. This means changes to rules take effect immediately when the model processes the next request.
* Conflict priority: When rules recorded by the Agent conflict with user rules, user rules take precedence.
* Real-time editing: Rules can be edited directly in the interface without restarting the service or modifying configuration files.
* Text preview: Provides a toggle to view the actual rule block text received by the model, ensuring the injection format is correct.

3. Session Context

The plugin maintains independent session context for top-level agents:
* At the start of a session, the model receives the latest session summary, sprint goals, and decisions from the last 7 days.
* These are sent as a system prompt block, helping the model quickly enter the project’s context.

4. Data Import/Export and Lifecycle

  • Instruction import: Supports importing from .md, .markdown, or .txt files (such as AGENTS.md or CLAUDE.md). File headings determine categories, and list items determine rules.
  • Data export: Supports exporting all memories in a project to a JSON file.
  • Retention policy: Supports setting expiration times by category (for example, session for 30 days and decision for 365 days) and supports a priority policy (Priority 1 can extend the lifecycle).

Installation and Activation

Installing the plugin requires configuration through the Web Client.

dsh plugin --profile web add @achasoft/dsh-memory
dsh web

After installation, you can see the new Memory tab on the left side of the Web Client conversation interface.

Typical Usage

  1. Import project rules: Create AGENTS.md in the project root directory, defining categories and a rule list. Import it using the Import feature in the plugin interface, and the rules will take effect immediately.
  2. Retrieve session summaries: Top-level agents automatically receive the previous session summary and sprint goals when they start, without manual pasting.
  3. Subagent limitations: Subagents (origin: 'subagent') comply with rules but do not receive session context or memory sessions.

Notes

  • Environment requirements: The plugin requires Node.js version ^22.19 || >=24.
  • Subagent differences: Sessions with origin: 'subagent' have no memory sessions and do not receive session context.
  • Injected-text limits: To control the token cost per request, the rule block in the system prompt has length limits: 2,000 characters per rule, 24,000 characters for the entire rule block, and 12,000 characters for session context. Overlimit content is truncated.
  • Vector search configuration: Semantic search requires configuring an Embeddings interface (such as an OpenAI-compatible endpoint); otherwise, only keyword search is supported.

Conclusion

dsh-memory solves the problem of disorganized context management in DSH development by turning memory into data and systematizing rules. Combined with DuckDB’s querying capabilities and the convenient operations of the Web UI, it can significantly improve the maintainability and consistency of Agent projects. For more details, see the GitHub repository or plugin directory.