dsh-ai-memory: Enable DSH Sessions to Write to ai-memory Shared Memory

Preface

ai-memory converges sessions from multiple types of coding agents into a retrievable Markdown wiki, so harnesses like Claude Code, Codex, Cursor, Gemini CLI can share the same memory. DSH can also read content written by others through ai-memory, but at session end it doesn’t trigger the “session end” path that ai-memory depends on: raw observations stay in the store but don’t enter the wiki, so other harnesses can’t search what you did in DSH.

dsh-ai-memory is a bridging plugin made by maintainer rasyidmmz on the DSH side, categorized as “memory”. It doesn’t build a new memory system, but instead calls the local ai-memory’s finalize-session at DSH session end, organizing observations already captured by hooks into wiki pages, aligned with the same-memory store written by Claude Code, Codex, etc.

What is this

In one sentence: an adapter layer between DSH and ai-memory — about 800 lines of JavaScript, calling your installed ai-memory binary via shell. The repo doesn’t contain ai-memory source code, nor is it a fork.

Need to clarify boundaries upfront (emphasized in README):

  • The plugin is not ai-memory; it doesn’t package or replace the upstream project.
  • The plugin is not responsible for collection; it only finalizes sessions already captured by ai-memory. Collection relies on lifecycle hooks you’ve separately wired up in DSH.
  • No affiliation or endorsement with the ai-memory author; it’s a third-party integration.

Core features

Closing DSH’s consolidation loop

ai-memory consolidates raw records into a readable wiki at session end. DSH’s end path doesn’t emit the disposal event, so historically the common situation is: DSH can search memories written by others, but DSH’s own sessions stop at raw observations. After installing this plugin, DSH session end triggers ai-memory finalize-session, and the output enters the wiki shared with other harnesses.

Startup preflight and missing-item prompts

At startup it can do preflight (enabled by default), printing to the harness log whether ai-memory was found, the version, data directory, and server address. If the binary isn’t installed or capture hooks aren’t wired up, the log will name which half is missing and point to installation instructions and the hook template path in the repo docs/hooks-dsh.json.

Session end and concurrency

Per the package description: skip subagents, queue concurrently-ending sessions for processing; sweep is enabled by default, used for sessions left un-finalized after forced restarts (can be disabled in config).

Bundled DSH hook template

ai-memory’s built-in install-hooks doesn’t support --agent dsh. You need to hand-write DSH lifecycle hooks; the repo provides a reference file docs/hooks-dsh.json. The plugin will not automatically write hook lines into cordis.patch.yml, to avoid duplicate collection with existing hooks or interfering with desktop hot-reload config.

Installation and activation

Environment requirements

  • DSH: >=0.1.7-rc.2 and <0.3.0 (see package.json dsh.engines)
  • Node: >=22.5.0
  • Local ai-memory CLI installed and executable; ai-memory service running, and DSH wired up for capture per template (see prerequisites below)

Install commands

Install from DSH plugin source:

dsh plugin --profile web add dsh-ai-memory

Install from GitHub:

dsh plugin --profile web add github:rasyidmmz/dsh-ai-memory

After installation, restart DSH. The loader imports plugins without a cache-buster, so new or modified plugins require a process restart to take effect.

Search for ai-memory in the harness log; you should see something like:

[dsh-ai-memory] active v1.2.0 -- fast path session/disposed (zero idle cost) + ...
[dsh-ai-memory] preflight: ai-memory v3.1.1 | data_dir=... | server=127.0.0.1:49374

(The plugin version in the log depends on the package you actually installed; package.json is currently 1.2.1.)

Optional configuration

By default no config block is needed. For non-standard install paths you can write to the profile’s plugin config as needed, e.g.:

- insert:
    - id: ai-memory
      name: dsh-ai-memory
      config:
        exePath: /usr/local/bin/ai-memory   # default: platform-standard location or ai-memory in PATH
        dataDir: /home/me/.local/share/ai-memory  # default: unset, resolved by CLI itself
        agentKind: claude-code              # default: claude-code (see README, not an arbitrary value)
        sweep: true                         # default: true
        preflight: true                     # default: true
        timeoutMs: 120000                   # default: 120000

dataDir is generally left unset, consistent with how hooks resolve it.

Typical usage

Prerequisite: make capture work independently first

  1. Install and run the service per ai-memory upstream.
  2. Referring to this repo’s docs/hooks-dsh.json, add hook wiring in the profile’s cordis.patch.yml (README says this is usually an insert: line pointing to @deepseek-ai/dsh-hooks-claude-code, follow the template for specifics).
  3. Verify collection works in the project directory:
ai-memory status          # sessions and observations should grow continuously
ai-memory doctor          # run inside the project directory

When capture isn’t working, this plugin has no sessions to finalize; fix the hook first, then talk about the plugin.

Daily use

After installing the plugin and restarting DSH, just open and close DSH sessions normally: at end, the plugin calls finalize-session. Other harnesses already connected to ai-memory can retrieve the corresponding wiki pages via the existing MCP/HTTP. If the server isn’t running, the plugin prints a clear warning at startup and doesn’t finalize; this is a different problem from capture failure.

Use cases and caveats

Who it’s for: Developers already using ai-memory for unified multi-harness memory, who often work in DSH and want DSH sessions to write to the same wiki as Claude Code/Codex/Cursor etc.

Who it’s not for: Users who just want “their own memory” inside DSH, don’t want to install and operate ai-memory, or don’t want to hand-write DSH hooks — this plugin only fills in the finalize step.

Security & permissions: The plugin runs with the current DSH process permissions and executes the local ai-memory command. Before installing, read the GitHub repo source and MIT license, confirm exePath points to a trusted binary.

Community directory: The plugin’s metadata can be browsed at the SkillHub directory page; this site is a community plugin directory, with no official affiliation with DeepSeek / High-Flyer. The DSH ecosystem emphasizes “everything is a plugin”, and this package is one such memory-type integration.

Closing

dsh-ai-memory’s value isn’t a new memory engine, but letting DSH move from being a read-only consumer to a peer writer in the ai-memory ecosystem: session end triggers consolidation, observations become a retrievable wiki, for other harnesses to pick up tasks. For the upstream memory engine, please support akitaonrails/ai-memory.

  • Directory page: https://www.skillhub.cn/plugins/rasyidmmz/dsh-ai-memory
  • Source & docs: https://github.com/rasyidmmz/dsh-ai-memory
羽毛球分组比赛记分
小程序二维码

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

Xiaoye