dsh-bundle-memory: Local Workspace Memory

Preface

When running agents in DeepSeek Harness (DSH), session context grows with each turn, but there is often no fixed location for information across sessions or tasks. Global memory is convenient but prone to mixing Project A’s conventions with Project B’s deployment details. If you want “memory to follow the current working directory, with clear boundaries, and be version-controllable when necessary,” you need a local storage solution controlled by path that the agent can read and write. Below is an introduction to the community plugin dsh-bundle-memory (Memory Management), maintained by OraSkyC and categorized as “Memory.”

What is this

dsh-bundle-memory is a DSH plugin: it provides the agent with a memory repository that follows the workspace. Once enabled, memory defaults to ./memory/ in the current working directory; the root contains an auto-maintained MEMORY.md index. You can create subdirectories for categorization when needed, or write directly in the root if no categorization is required.

The plugin registers four tools with the Host: memory_save, memory_recall, memory_search, and memory_forget. Both the index and entries are Markdown (.md), with no npm runtime dependencies, using only Node built-in modules.

Directory Structure

The memory root directory is resolved relative to the session working directory (see “Workspace Boundaries” below). The typical layout is as follows:

<your working directory>/
└── memory/                       ← Memory root (configurable)
    ├── MEMORY.md                 ← Index, auto-generated by plugin
    ├── User-Preferences-pnpm.md  ← Uncategorized, written directly in root
    ├── Deployment-Notes.md
    └── Project-Conventions/       ← Create subdirectories as needed
        └── Commit-Messages-in-Chinese.md

When memory_recall is called without arguments, it returns the index content. This includes the workspace path, memory root, entry count, and links to each .md file grouped by category.

The Four Tools

Tool Description
memory_save Saves a memory entry. Required: title, content; category is optional (e.g., Project Conventions or people/work, max 3 levels), omitted means written to root. Default behavior for duplicate names is an error; silent overwrites do not occur. Overwriting requires explicitly passing overwrite: true.
memory_recall No arguments → returns the index; with name → reads a specific entry. name can be a relative path (e.g., Project-Conventions/Commit-Messages-in-Chinese.md) or a unique suffix (e.g., Commit-Messages-in-Chinese). If multiple matches are found, it errors out and lists candidates rather than guessing.
memory_search Performs full-text search on all memories (title, tags, body, case-insensitive) and returns matching paths with excerpts.
memory_forget Deletes a single memory entry. Accepts only a single .md file; does not delete directories or operate on paths outside ./memory/.

This version does not automatically inject the index into the session context; the agent must proactively call memory_recall or memory_search. You can agree in the project’s AGENTS.md to “call memory_recall to view the index before starting work.”

Why “Follows the Workspace”

The memory root directory is calculated relative to the session working directory (exec.agent.session.header.cwd), therefore:

  • Content written in Project A is not visible in Project B sessions, avoiding cross-project contamination;
  • When memory is in the same repository as code, it can be committed to version control as needed; it remains available after cloning on a new machine;
  • If centralized storage is desired, the root config item can be set to a relative path (e.g., notes/mem), still relative to the working directory.

This is a different orientation from “Global Memory”: this plugin chooses the latter with clear workspace boundaries.

Installation and Enablement

DSH Requirements: web or any profile with the Host tools service; Node >= 22.19.0. The plugin depends on the Host’s tools and webServer (inject = ['tools', 'webServer'] in the Cordis patch).

Settings → Plugins → Add Plugin, enter:

https://github.com/OraSkyC/dsh-bundle-memory

Or via command line:

dsh plugin --profile desktop add https://github.com/OraSkyC/dsh-bundle-memory

Restart DSH after installation.

Settings

Path: Settings → Plugins → Memory Management. UI changes take effect immediately without restart.

Deployment defaults are written in cordis.patch.yml (restart DSH required after modification). User overrides are stored in a sparse layer at %USERPROFILE%\.dsh\state\dsh-bundle-memory\settings.json; “Restore Defaults” deletes the corresponding key and falls back to deployment defaults.

Key Default Description
enabled true If false, memory tools are not registered, but the settings panel remains accessible.
root memory Memory root directory, relative to session working directory, max 3 levels.
indexFile MEMORY.md Index filename, located in the memory root.
autoIndex true Automatically rebuild index after every save or delete.
maxEntryBytes 262144 Max body size for a single memory entry (1024–4194304 bytes).
searchMaxResults 20 Default number of results returned by memory_search (1–100).

Typical Usage

  1. After installing and restarting DSH, start a session in the target project directory; the agent calls memory_recall (no args) to view the index projected from MEMORY.md.
  2. Write conventions or preferences: call memory_save, e.g., store “Commit Messages in Chinese” with category: Project Conventions, or omit category to write “User prefers pnpm” in the root.
  3. Remember something but don’t know the path: call memory_search to search by keyword.
  4. Read a specific entry: call memory_recall, passing the relative path or unique suffix to name.
  5. Deprecate an entry: call memory_forget, targeting only a single .md file.

If memory/MEMORY.md is accidentally modified, delete the file; it will be rebuilt on the next memory save or delete, or trigger a rebuild by calling memory_recall with no arguments. Content manually appended to the index will disappear during the next rebuild—you should add new .md files or use memory_save.

Whether to include ./memory/ in Git is determined by the project’s .gitignore; the plugin does not enforce it.

Design Points (Expectations during use)

Index is a projection: MEMORY.md is regenerated by scanning .md files on disk for front matter. It does not maintain an independent “ledger,” so the index and file contents will not be inconsistent over time; the trade-off is that you should not expect manual edits to the index to persist permanently.

Entry Format: Each entry is Markdown with YAML front matter (only key: value lines, no full YAML parser). Without front matter, the title falls back to the filename. Binary or attachments are not supported; only .md is recognized.

Path Protection: Performs fragment validation, hierarchy limits, and post-resolution confirmation on name / category passed by the agent to ensure they remain within the memory root; deletion is allowed only for .md files. The README states that the above logic has host-side test coverage.

Working Directory Source: The tool implementation uses exec.agent.session.header.cwd ?? process.cwd(); the cwd in the session header is the workspace, not the DSH installation directory’s process.cwd().

Applicable Scenarios and Notes

Suitable for scenarios requiring the persistence of conventions, preferences, and deployment notes within a single repository or working directory, read/written by agents via tools, and full-text searchable. Not suitable as a general attachment library or a unified cross-workspace knowledge base (unless constrained by self-imposed configuration and workflows).

The DSH ecosystem philosophy is “Everything is a plugin”; community directories like SkillHub are independent sites and have no official affiliation with DeepSeek / High-Flyer. It is recommended to read the source code and MIT license before installing the plugin; the plugin runs with DSH process privileges. Although write paths have multi-layer validation, you should still exercise your own judgment regarding sensitive information within the repository.

Links

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

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

Xiaoye