Preface

In frameworks like DSH where “everything is a plugin,” the conversations, prompts, tool calls, and sub-agent activities generated during agent runtime often exist only within the current context. If you want subsequent tasks to reuse these observations, or to inject context recalled from a memory store into the system prompt, you need a stable memory backend.

The following introduces dsh-agentmemory: it connects the local agentmemory REST service to DSH, making the memory_* tools, automatic capture hooks, and optional context injection available as plugins.

What This Is

dsh-agentmemory is a DSH plugin maintained by elementor-i, licensed under MIT.

It is positioned as DSH’s memory plugin. Its core function is to expose the locally running agentmemory service to DSH: the full set of memory_* tools, background observation capture, and optional context injection that can be disabled.

It does not require MCP bridging; its only dependency is the local REST service.

Core Capabilities

  • Full tool surface: Includes all 54 memory_* tools (8 of which are core tools), mapped to /agentmemory/*; additionally provides memory_observe and memory_http escape hatches for accessing arbitrary endpoints.
  • Automatic capture: Sessions, prompts, tool usage, sub-agents, workflows, and approval activities are recorded as observations in the background.
  • Context injection: Optional; when enabled, adds context recalled from sessions to the system prompt.
  • Safe by default: Includes credential redaction, per-call timeouts, non-blocking observation, and destructive or high-cost tools controlled by the dangerousTools toggle.
  • No MCP dependency: No stdio bridging or additional subprocesses required; the running REST service (default localhost:3111) is the only dependency.

Prerequisites and Checks

The agentmemory service needs to be running locally first. The default address is http://127.0.0.1:3111, and the viewer port is 3113.

You can check if the service is available using the following command:

curl -fsS http://127.0.0.1:3111/agentmemory/livez

If the service is unavailable, the plugin will log a warning, and the memory_* tools will return errors, but DSH itself will continue running.

Installation and Enablement

Using the DSH CLI

Replace web with the actual profile name you are using:

npx -p @deepseek-ai/dsh dsh plugin --profile web add @elementor-i/dsh-agentmemory

After installation, restart the corresponding profile according to your DSH configuration method.

Native Mounting

If you prefer not to use the CLI, you can also clone the source code locally and add an insert patch pointing to lib/index.js in your configuration:

git clone https://github.com/elementor-i/dsh-agentmemory ~/dsh-plugins/dsh-agentmemory

Add something like the following to ~/.dsh/config.yaml, or to $DSH_HOME/cordis.patch.yml which applies to all profiles:

- insert:
    - id: dsh-agentmemory
      name: '$HOME/dsh-plugins/dsh-agentmemory/lib/index.js'

Then restart DSH.

Configuration

All configuration options are optional and have safe defaults. The environment variables AGENTMEMORY_URL, AGENTMEMORY_SECRET, and AGENTMEMORY_PROJECT_NAME are read as fallbacks.

Common keys are as follows:

dsh-agentmemory:
  baseURL: http://127.0.0.1:3111
  secret: ""
  timeoutMs: 10000
  registerTools: true
  coreToolsOnly: false
  dangerousTools: false
  injectContext: false
  injectMaxChars: 4000
  healthCheck: true
  hooks: {}

Where:

  • baseURL: The agentmemory REST service address.
  • secret: Bearer secret; falls back to AGENTMEMORY_SECRET when empty.
  • timeoutMs: HTTP timeout for a single tool call.
  • registerTools: Whether to register the memory_* tool set.
  • coreToolsOnly: When true, only the 8 core tools are registered.
  • dangerousTools: When true, exposes destructive/high-cost tools.
  • injectContext: Whether to inject recalled context into the system prompt; disabled by default.
  • injectMaxChars: The character limit for injected context.
  • healthCheck: Whether to warn at startup if the service is unreachable.
  • hooks: Configuration items related to automatic capture.

Typical Usage

  1. First, confirm that the local agentmemory service is available:
curl -fsS http://127.0.0.1:3111/agentmemory/livez
  1. Install the plugin into the target profile:
npx -p @deepseek-ai/dsh dsh plugin --profile web add @elementor-i/dsh-agentmemory
  1. If you just want to keep the default safe behavior, no additional configuration is needed; the memory_* tools will be registered, automatic capture will take effect according to the hooks configuration, and context injection is disabled by default.

  2. If you need to add recalled context to the system prompt, turn on injectContext and limit the character count as needed:

dsh-agentmemory:
  injectContext: true
  injectMaxChars: 4000
  1. Restart DSH. After that, you can let the agent use the memory_* tools or access other agentmemory endpoints via memory_http.

Applicable Scenarios and Notes

This plugin is suitable for developers who already run the agentmemory service locally and want to integrate memory tools directly into DSH. If you want DSH to automatically record sessions, prompts, tool calls, and sub-agent activities, and want to reuse the recalled results in subsequent tasks, it can wrap the REST service into tools that DSH can call directly.

Notes:

  • The plugin runs with the permissions of the current DSH process. You should review the source code behavior and the MIT license before installation.
  • Destructive/high-cost tools are not exposed by default; enable them via dangerousTools only when necessary.
  • Context injection is disabled by default. Enabling it increases the system prompt length, so it is recommended to set injectMaxChars at the same time.
  • When installing via the public directory, the plugin needs to already exist in the public DSH catalog; this directory is rebuilt hourly from GitHub repositories tagged dsh-plugin. The community directory is an independent site and is not equivalent to the official DeepSeek or High-Flyer app store.

Links

  • Catalog page: https://www.skillhub.cn/plugins/elementor-i/dsh-agentmemory
  • GitHub: https://github.com/elementor-i/dsh-agentmemory