Introduction

In DSH, each session is independent by default. After a conversation ends, the model forgets the previous context, which means you have to repeatedly explain your principles, red lines, and ways of working. dsh-user-mirror is designed to solve this problem. It enables the model to actively identify reusable decision criteria during its thinking process, reuse them across sessions, and inject them back into the system prompt according to a token budget.

Plugin Positioning

This is a DSH plugin. Its core purpose is to help the model remember the user’s “how to think” (principles, red lines, ways of working, aesthetics), rather than “what they said” (facts, paths, accounts).

The plugin relies on the model’s active judgment in the think chain to call a tool and record decision criteria. The data is stored locally and injected into the system prompt during the next prompt assembly according to a token budget.

Core Features

  1. Learn from the think chain and record
    When the model recognizes during reasoning that the user has expressed reusable decision criteria, it calls a tool to record them, together with a reason.

  2. Reuse memory across sessions
    Recorded principles, red lines, and ways of working are automatically injected into the system prompt in subsequent sessions, without requiring repeated input.

  3. Profile display in the Memory tab
    In the Memory tab, it displays as a profile: a one-line sketch, four sections (principles, red lines, ways of working, aesthetics), and intensity font weight (font weight represents the number of times it has been confirmed).

  4. 30-day forgetting mechanism
    It uses a half-life decay strategy (default: 30 days). Unconfirmed memories decay over time, preventing unbounded memory growth.

  5. Token-budget injection
    When injecting into the system prompt, it controls by token budget rather than simply filling by number of items, preventing context overflow.

  6. Tool calls
    Provides two tools: mirror_remember(text, kind, reason) and mirror_forget(text, reason).

Installation and Configuration

Before installing, make sure Node.js is installed.

npx @deepseek-ai/dsh plugin --profile <your profile> add @dsh-plugins/dsh-user-mirror

Environment requirements: Only web profiles that provide storageDomain and webServer are supported. Headless profiles will fail because these two services are missing.

After installation, you can override default parameters in cordis.patch.yml:

- insert:
    - id: dsh-mirror
      name: dsh-user-mirror
      config:
        maxPreferences: 20   # Memory capacity limit (number of items)
        halfLifeDays: 30     # Half-life (days); older memories become weaker
        maxTokens: 500       # Token budget for injection
        sectionOrder: 160    # Position in the system prompt (smaller values appear earlier)

Usage

  1. Record memories
    The model will automatically call the tool. You can also configure the model to record specific types of preferences.

  2. Revoke memories
    If something is recorded incorrectly, it can be revoked through the tool or the UI.

  3. Clear data
    Delete the dsh_mirror domain to clear locally stored preference data.

Known Limitations and Notes

  • No query tool: The v0.6 version removed the query tool; currently it can only write but not query. If something is recorded incorrectly, you need to wait for decay or for a new statement on the same topic to overwrite it.
  • Chinese synonym defect: It is known that Chinese synonymous rephrasings (for example, “Always reply in Chinese” and “Always use Chinese replies”) may be misjudged as two different memories.
  • Data scope: It only records decision criteria (principles/red lines/ways of working/aesthetics) and does not record facts (paths, accounts, server addresses, etc.).
  • Dependency loading: It depends on ai-orb at runtime, but it is not bundled; it is loaded via same-origin loading.

Ecosystem Info

  • Maintainer: webkubor
  • License: MIT
  • Directory: https://www.skillhub.cn/plugins/webkubor/dsh-mirror
  • GitHub: https://github.com/webkubor/dsh-mirror