DeepSeek Harness Local Memory Plugin

Introduction

In conversational agent development, cross-session memory is a common pain point: users repeatedly explain their preferences across different sessions, Agents re-step on known pitfalls, and stale decisions continue to be executed under outdated versions. This redundant work both wastes tokens and degrades the user experience.

DeepSeek Harness (DSH)’s plugin architecture provides room for extension on this type of problem. dsh-memory-harness is a local-first memory plugin that stores preferences, decisions, project facts, and known pitfalls worth retaining from conversations into a local SQLite database, and proactively recalls them at session start and when needed.

Plugin Positioning

dsh-memory-harness is a local-first cross-session memory plugin developed by maintainer yeweimei, categorized under “Memory.” It does not store entire chat transcripts; instead, it extracts structured information (preferences, decisions, known pitfalls, project summaries) and delivers it back to the Agent when needed through hybrid retrieval.

The plugin depends on DSH 0.2.x and Node.js ≥ 22.5, uses the built-in node:sqlite module, and has no npm runtime dependencies.

Core Capabilities

Local SQLite Storage

All memories are stored in a local SQLite database (default: ~/.dsh/memory/memory.db), with a backup directory at ~/.dsh/memory/backups. Data always stays on the local machine and is never uploaded to any remote service.

Hybrid Retrieval

The plugin combines three retrieval methods: vector search, keyword search, and graph search. Vector search requires configuring an OpenAI-compatible Embedding service, keyword search relies on SQLite FTS5 full-text index, and graph search is used to identify relationships between memories.

Time Awareness

Each memory carries two time fields:

  • createdAt: the time the memory was written to the database
  • observedAt: the time the fact was actually stated or observed

Search and list operations support filtering by observedAt, and time-based decay in sorting is also based on observedAt. During extraction, observedAt is derived from the message timestamps in the conversation transcript; manual saves can specify it explicitly.

Auto-Capture & Admissibility

The plugin uses a “rules + LLM + auto-admissibility” capture pipeline by default:

  1. When a user message hits keywords like “remember,” “don’t do this again,” or “pitfall,” the rules layer generates a candidate
  2. When a tool call fails, the rules layer immediately recalls known pitfalls and appends the error signature to the result
  3. Every N turns or on a scheduled scan (default 30 minutes), the LLM extracts structured information (pitfall, decision, preference, project facts) from the conversation to generate candidates
  4. After candidates are persisted, the LLM admissibility layer makes a per-item decision: add (enter memory), update (replace a similar old memory), or skip (discard)

LLM admissibility is enabled by default. Parameters such as minConfidence, maxPerRun, and includeRules can be adjusted via settings. Unconfirmed candidates remain in the panel’s “Pending” tab, where they can be manually accepted or ignored.

Tiered Storage & Revision History

Data format v8 introduces tiered storage and lifecycle management:

  • tier: working (session-level), semantic (general facts), episodic (summary-type)
  • status: candidate, active, dismissed, superseded, archived
  • revision: incremented on each change, retaining the latest 20 revision snapshots
  • supersededBy / validFrom / archivedAt: supersession chain and validity period

update overwrites the record but preserves the old snapshot. supersede / admissibility update does not overwrite the old record; instead, it marks it as superseded. Retrieval only fetches the current active version.

Conflict Handling & Validity Period

Memories can have a validUntil expiry set. Upon expiry, they enter review rather than being silently deleted. “Conflicting” memories are decided by the user by default and are never silently removed. The panel provides “Review” and “Conflicts” tabs for handling outdated, incorrect, duplicate, and conflicting entries.

Installation & Activation

Installation

Install from GitHub:

dsh plugin --profile web add github:yeweimei/dsh-memory-harness

Download dsh-memory-harness-0.22.1.tgz from Releases:

dsh plugin --profile web add "file:/absolute/path/dsh-memory-harness-0.22.1.tgz"

You can also install via DSH’s Plugin Manager.

Configuration

After installation, refresh or restart DSH, then open Settings → Memory.

Configure Embedding

Fill in the OpenAI-compatible Embedding service configuration:

  • Base URL
  • Model name
  • Dimensions
  • API Key (if the service requires one)

After saving, the panel will display the embedding health status. Without configuration, memories can still be saved, but without semantic vectors; retrieval falls back to keyword search.

Configure LLM (Optional)

Auto-extraction, auto-admissibility, and conflict detection require an LLM:

  • Leave blank: uses DSH’s current default model
  • Specify an OpenAI-compatible endpoint + model: uses the designated model

Runtime Requirements

  • DeepSeek Harness 0.2.x (verified on 0.2.2-rc.1)
  • Node.js ≥ 22.5
  • A writable local directory (default: ~/.dsh/memory)

Daily Usage

Recording Memories

  • Ask the Agent to call memory action=save
  • Run the /remember ... command
  • The Agent will auto-capture and save

Retrieving Memories

  • The Agent auto-retrieves and injects when needed
  • Run /memory search <keyword>
  • Search in the “Memory” panel in the sidebar

Rating Recalls

The recall overlay provides two dimensions: “relevant this time” and “memory quality.” Submissions can be revoked within 10 seconds.

Organizing Memories

  • The panel’s “Review” tab handles outdated, incorrect, duplicate, and conflicting entries
  • The panel’s “Organize” tab merges near-duplicate memories (cosine similarity ≥ 0.92)
  • Supports backup, JSON export, and rollback

Processing Candidates

The panel’s “Pending” tab displays candidate entries, which can be edited before acceptance, or accepted / ignored / restored.

Evaluation

The repository includes LongMemEval benchmarks:

  • Retrieval layer (LongMemEval-S, 50 questions): Recall@10 96%
  • End-to-end (Oracle turn, 20 questions): 70.0%
  • End-to-end (S chunk, 12 questions): 66.7%

Reader / Judge uses local qwen3.6-35b-a3b-mtp, runs entirely against a temporary SQLite instance, and does not read or write the production memory database.

Use Cases

Suitable for agent scenarios that require long-term context maintenance and cross-session reuse of decisions and preferences. The plugin runs with the current DSH process permissions; review the source code and license before installation.

Conclusion

dsh-memory-harness provides DSH with a structured memory layer through local SQLite storage, hybrid retrieval, and auto-admissibility. Rather than storing entire conversations, it transforms valuable preferences, decisions, and pitfalls into searchable, evaluable, and manageable memories.

Directory Page | GitHub

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye