Introduction¶
The extension mechanism for DSH is to package capabilities as plugins. In multi-session tasks, the current context is insufficient to carry information that needs to be retained for the long term: user preferences, high-importance notes, and reusable processes might be lost in subsequent sessions. imemory is a DSH plugin that automatically extracts memories after a round, recalls and injects relevant memories before every step, consolidates reusable processes into learned-* skills, and provides a web management panel. Below is an introduction to its features, installation methods, and precautions.
What is it¶
imemory corresponds to the GitHub repository bass1125/imemory with an MIT license. Its memory files are plain text, with entries separated by a single line §. The plugin extracts information worth keeping from the conversation after a round via the LLM, and recalls relevant memories in subsequent steps. The current release is still in beta, and the interface and behavior may change with iteration.
Core Features¶
- Automatic extraction after rounds: The LLM distills persistent information from the conversation and writes it to memory, with an
importancescore of 1-10; anything below 3 is automatically discarded. - Recall and injection before every step: Before every model step, keyword initial screening combined with LLM semantic reranking injects relevant memories into the context.
- Session start memory: The first step of a new session injects the user profile and high-importance notes.
- Conflict merging, deduplication, decay and elimination: Solidified every 6 hours.
- Skill learning loop: Reusable processes can be consolidated into
learned-*skills. - Provides 6 tools:
memory_search,memory_add,memory_update,memory_forget,memory_sessions,memory_consolidate. - Web management panel:
/imemory/. - Zero dependencies: Does not
importany@deepseek-aipackages. - Profile-agnostic:
webServeris an optional service.
Installation and Enablement¶
Target DSH version is 0.1.0-rc.6, requires Node >= 20.
Manual Mount¶
Taking the web profile as an example, copy the plugin file to the profile directory:
cp imemory.mjs ~/.dsh/profiles/web/imemory.mjs
Then append the mount line at the end of the profile’s cordis.patch.yml:
- insert:
- id: imemory
name: ./imemory.mjs
Finally, restart dsh. If you modify the imemory.mjs module itself, you can also add a query string to the name to force re-importing:
name: ./imemory.mjs?v=2
Bundle Installation¶
The documentation provides both npm and git installation commands; use as needed:
dsh plugin --profile web add imemory
dsh plugin --profile web add https://github.com/bass1125/imemory.git
If the profile already has a manually mounted imemory line, delete it before using bundle installation to avoid double mounting.
Configure Memory Directory¶
The memory directory is specified by config.memDir in the mount entry; it can be set to an absolute path, a path starting with ~, or a relative path. For example:
- insert:
- id: imemory
name: ./imemory.mjs
config:
memDir: ~/.dsh/my-memories
Access Management Panel¶
When webServer is available, you can access the management panel address below:
http://<dsh-host>:<dsh-port>/imemory/
Typical Usage¶
After the above steps, you can verify as follows:
- The first step of a new session will inject the user profile and high-importance notes.
- The model’s tool list will appear with
memory_search,memory_add,memory_update,memory_forget,memory_sessions,memory_consolidate. - If
webServeris available, access the/imemory/management panel.
Memory files are plain text, with entries separated by a single line §. Reusable processes can be consolidated into learned-* skills.
Suitable Scenarios and Precautions¶
imemory is suitable for DSH users who need to retain user preferences, high-importance notes, and reusable processes across sessions. Pre-installation notes:
- The plugin runs with the permissions of the current
dshprocess; check the source code and the MIT license before installing. - The current release is still in beta, and the interface and behavior may change with iteration.
- Target DSH version is
0.1.0-rc.6, requiresNode >= 20. - If the profile already has a manually mounted line, delete it before using bundle installation to avoid double mounting.
- Modifying the
imemory.mjsmodule itself requires restartingdsh, or adding a query string to thenameto force re-importing.
Closing¶
imemory puts post-round extraction, step-by-step recall, and learned-* skill consolidation into the DSH plugin workflow, suitable for scenarios requiring long-term memory and reusable processes.
- Community Directory: https://www.skillhub.cn/plugins/bass1125/imemory
- GitHub: https://github.com/bass1125/imemory