dsh-fish-memory: A Fading Long-Term Memory for DeepSeek Harness Sessions

Introduction

DSH’s context window is limited. As conversation turns increase, earlier content gradually gets diluted, making it difficult for the model to recall key information from the early stages. The dsh-fish-memory plugin aims to solve this problem by providing long-term memory for designated sessions. It simulates a “fish memory” mechanism where data is not permanently retained but instead loses its “vividness” over time, automatically filtering out important content and preventing the context from being filled with junk information.

Installation and Activation

This plugin is maintained by Yuuyuko-uu and is released under the MIT license. Installation requires using DSH’s Web interface.

dsh plugin --profile web add github:Yuuyuko-uu/dsh-fish-memory

After installation, DSH needs to be restarted. Once restarted, locate the “Fish Memory” option in the settings page.

Core Features

The plugin’s core logic is based on vividness and importance rather than simple storage.

  • A Forgetting Mechanism: Each memory has a vividness score with a default half-life of 30 days. The plugin does not physically delete memories but makes them harder to retrieve by reducing their vividness.
  • Automatic Filtering: The plugin determines which content in conversations is worth retaining, with a daily quota to prevent excessive recording.
  • Smart Retrieval: Retrieval is based on evidence and vividness ranking. It uses local vocabulary for tokenization to avoid interference from common words.
  • Fact Marking: Supports marking important attributes as “long-term facts,” storing them flat without time-based decay.
  • Visual Analysis: Provides a memory list and a “Last Recall” feature, showing which memories were selected, which were not, and the reasons behind those decisions.

Usage Flow

Before use, you must enable the toggle switch for the target session in the settings page; the default state is disabled.

  1. Enable Session Memory: Find the target session in the session list and turn on the memory toggle.
  2. Normal Conversation: Once enabled, the plugin automatically records conversations. It has a maximum daily recording limit (default: 8 items) and a maximum injection limit per session (default: 6 items).
  3. View Results: Expand the “Memory List” to view all records, or check “Last Recall” to see which memories the model retrieved for the current query.

Importing Old Archives

If you previously wrote archives in Markdown or plain text, you can migrate them to the plugin.

  1. Expand “Import from Old Archives” in the settings page.
  2. Select the folder containing archives or fill in the path, then click “Scan Archives.”
  3. Review the candidate list generated by the plugin and check the content you want to import.
  4. Click “Import Selected,” then click “Start Refining.” This process calls the model to rewrite the original text into memory format.

Fact Keys

For attributes that may change (such as height or location), using “Fact Keys” ensures only the latest state is retained.

  • Format: Object.Aspect, e.g., her.height.
  • Usage: The same key corresponds to the same subject, and the plugin retains only the latest entry. Older entries are marked as “superseded.”
  • Note: Keys cannot contain specific values (e.g., her.height170); only the attribute part should be written.
  • Cleaning: The plugin provides a “Clean & Fill Keys” feature that can automatically fill in keys for old entries, but this requires caution. It is recommended to “Try 8 Items” first to verify the results.

Data Storage

  • Location: Data is stored locally at %USERPROFILE%\.dsh\fish-memory\, with one file per session.
  • Format: Plain text JSON with automatic backups before each modification.
  • Permissions: Since local vocabulary tokenization is used, the plugin does not consume dialogue token counts.

Use Cases

This plugin is suitable for scenarios requiring long-term context continuity, such as using DSH as an AI assistant or companion. It does not consume dialogue tokens, and all data is fully localized. Please ensure that the DSH Web interface is installed before use.

Plugin Directory
GitHub Repository

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

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

Xiaoye