dsh-plugin-memory-lite: DSH Local-First Cross-Session Memory

Introduction

DeepSeek Harness (DSH) sessions have natural boundaries: after switching sessions or when the context is compacted, conclusions aligned in previous rounds often don’t carry over, forcing developers to repeatedly explain architecture conventions, pitfalls, and project background. Some in the community write rules into a global AGENTS.md and rely on long context to compensate, but that’s only “visible in the current turn”—not a searchable, cross-workspace reusable long-term memory.

Below is an introduction to dsh-plugin-memory-lite by maintainer eighteentang, located in the “Memory” category of the DSH plugin directory: data is stored in local SQLite with no network connections, no uploads, and no dependency on external memory services; it performs background log accumulation, on-demand injection, and optional “organize into entries” (which consumes model quota).

What This Is

dsh-plugin-memory-lite is positioned as local-first cross-session memory for DSH—automatically accumulating logs each round, optionally organizing during idle time, and injecting on demand when needed. Licensed under MIT; see GitHub for the repository and the SkillHub plugin page for the directory listing.

It addresses “information loss after session breaks”: the plugin works in three layers in the background (see table below) and deliberately ensures that the log layer never enters the prompt—only distilled long-term entries are injected, avoiding bloating the context budget and breaking prefix caching.

Layer What It Does When Cost
Log layer Append conversation to local storage at end of each round Automatic, every round Zero model calls
Long-term entry layer Distill conclusions from logs into memory entries Click “Organize Now” or enable idle auto-organize One model call per run
Injection layer Append memory relevant to the current user message as an independent message at the end of the conversation Automatic, every round Zero cost

Before logs are written to disk, host-injected system boilerplate (such as user global AGENTS.md inside <system-reminder>) is stripped out, along with content duplicated from earlier in the conversation; rounds with no meaningful content are not recorded.

Core Features

Automatic Accumulation and On-Demand Injection

The default-enabled autoCapture writes logs at the end of each round (no model quota consumed); autoRecall searches for relevant memories by keywords when a user message arrives and injects them. Injection is “append-only”: it appends as an independent message after the messages already retrieved for this round, without rewriting existing history. Entries already injected in the same session won’t be injected again; after context compression, the record is reset and permanent memories are restored.

Organize into Entries (Optional, Consumes Quota)

Long-term entries require you to click “Organize Now” in the settings page by default, avoiding unexpected quota consumption. If autoDistill is set to true, automatic organizing can occur after 30 minutes of idle time (up to 4 times per day, subject to configuration constraints). During organizing, the model input first strips system boilerplate, then samples by taking the first 40% + last 60%.

Persona and Work Standards (Permanent Each Round)

The two text boxes above “Memory Control” in the settings page can hold persona settings, work standards, and behavioral guidelines—no formatting requirements. They are stored at:

$DSH_HOME/memory-lite/persona/persona.md
$DSH_HOME/memory-lite/persona/rules.md

They function as a section of the system prompt, effective every round; changes take effect in the next round after saving. They cease to be effective if the plugin is disabled or uninstalled.

User-Level Memory (Cross-Workspace)

Facts unrelated to specific projects can be written to the user-level store:

$DSH_HOME/memory-lite/global/memory.db   ← User-level (cross-workspace)
<workspace>/.dsh-memory/memory.db       ← That workspace (default)

Saying “Remember (cross-workspace): …” in conversation writes via memory_note with scope="user". During recall, the current workspace and user-level memories are merged and sorted; on tie, workspace-level entries take priority. This is still subject to injection limits like injectMaxItems.

Model-Visible Tools

In conversation, you can directly ask the assistant to call (names depend on the plugin):

  • “Remember: …” → memory_note
  • “Search what I said before about …” → memory_search
  • “Mark that entry as completed” → memory_update
  • “Forget that entry” → memory_forget (deletion requires approval)

Memory entries have three states: Active (can be recalled), Completed (still searchable and recallable), Deactivated (no longer injected, can be restored).

Search and Limitations

Search is keyword-level, not semantic vector-based; Chinese text is matched by continuous strings and substrings, so rephrasing may not yield results. Each workspace defaults to one database; the log layer has a per-session limit of approximately 200 entries—when exceeded, data is first archived to jsonl before rows are removed from the database.

Installation and Activation

Command-line installation (original instructions; replace <your-profile-name> with your actual profile):

dsh plugin --profile <your-profile-name> add github:eighteentang/dsh-plugin-memory-lite#v1.3.0

Alternatively, in the client sidebar under “Plugins” → “Add Plugin”, paste the address. Pinning a version is recommended, e.g.:

https://github.com/eighteentang/dsh-plugin-memory-lite#v1.3.0

Do not paste Releases pages or non-repo-root addresses like …/tree/main; use #v1.3.0 appended to the repo root URL for versioning. All versions are listed in the repository CHANGELOG; DSH plugins currently require uninstalling before installing a new version to upgrade.

After installation, restart the client, and the “Memory Control” section will appear in the settings page.

The plugin can be configured in the profile’s cordis.patch.yml (excerpt):

- id: memory-lite
  name: dsh-plugin-memory-lite
  config:
    autoCapture: true
    autoRecall: true
    autoDistill: false
    distillIdleMinutes: 30
    distillMinIntervalMinutes: 30
    distillMaxPerDay: 4
    injectMaxItems: 3
    injectMaxChars: 2000
    crossWorkspaceSearch: true
    distillProvider: ''
    distillModel: ''

With the default autoDistill: false, the model is only called to organize when you click “Organize Now”.

Typical Usage

  1. After installation and restart, no daily operation is needed: logs are automatically recorded each round, and relevant memories are automatically injected for each user message.
  2. When you need long-term recallable conclusions, say “Remember: …” in conversation, or search/modify status in the settings page list, and click “Organize Now” when needed.
  3. Use “Remember (cross-workspace): …” for cross-project universal conventions to write to the user-level store; write rules that must be followed every round into the persona/work standards text boxes.
  4. Deleting memories: prefer changing entries to “Deactivated”; use memory_forget for complete single-entry deletion (requires confirmation); directly deleting <workspace>/.dsh-memory/ will lose all memories in that workspace irrecoverably.

Data path summary:

<workspace>/.dsh-memory/memory.db
<workspace>/.dsh-memory/archive/
$DSH_HOME/memory-lite/global/
$DSH_HOME/memory-lite/persona/
$DSH_HOME/memory-lite/workspaces.json

Use Cases and Considerations

Suitable for developers who want local self-hosted conversation accumulation in DSH without stuffing the entire chat log into the prompt: daily zero-quota logging and injection, concentrating “quota consumption” on the optional distillation step.

Before installation, it’s recommended to review the repository source code and MIT license yourself. The plugin reads/writes SQLite and files under $DSH_HOME with current DSH process permissions; sensitive content is marked sensitive when written, and the injection path is fail-closed. Community directories like SkillHub have no official affiliation with DeepSeek/幻方, and the DSH ecosystem itself is an extension approach of “everything is a plugin”.

Idle auto-organizing depends on the host process staying running; no organizing occurs when the client is closed.

Conclusion

dsh-plugin-memory-lite uses local SQLite to separate “logging, distilling entries, on-demand injection”, doesn’t silently consume organizing quota by default, and emphasizes injection discipline and deletion approval. For further information or installation, see the directory page eighteentang/dsh-plugin-memory-lite and the GitHub repository.

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

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

Xiaoye