DeepSeek Harness Hub
← 返回列表

elementor-i/dsh-agentmemory

DeepSeek Harnessspec-screened在 GitHub 查看 ↗
未验证

面向 DeepSeek Harness 的 agentmemory — 通过本地 REST 服务器提供完整的…

尚未跑自动兼容性验证,可查看页面内的依赖与入口分析。 · 最近上游提交 2026/8/17 · 已提供中文文档

DeepSeek Harness (dsh) 的 agentmemory:通过本地 REST 服务器提供完整的 memory_* 工具、捕获钩子和上下文注入

综合分
29.7
GitHub 分
29.7
用户评分
★ Stars
4
周下载量
安装插件(需先安装 dsh CLI 引擎:npm install -g @deepseek-ai/dsh)
dsh plugin --profile web add elementor-i/dsh-agentmemory
该插件未发布到 npm,走 GitHub 源安装(pnpm 若拦截 prepare 脚本,按其提示在 pnpm-workspace.yaml 的 allowBuilds 中放行后重跑)
数据截至 2026/9/18(元数据每日更新 · 实装验证按队列轮转,单条结论的验证时间见上方)
依赖的 DSH / Cordis 模块
@deepseek-ai/cordis@deepseek-ai/dsh-tools@deepseek-ai/dsh-system-prompt@deepseek-ai/schemastery
用户评分
还没有人投票,来当第一个
订阅周报,不错过优质插件更新
每周一封 · 高评分插件 + 新用户活动

README

dsh-agentmemory

面向 DeepSeek Harness 的 agentmemory — 通过本地 REST 服务器提供完整的 memory_ 工具、自动捕获钩子,以及可选的上下文注入。

English ·

License: MIT
CI
dsh

dsh-agentmemory 将 agentmemory(一个面向编码代理的本地记忆服务器)连接到 DeepSeek Harness(DSH)。它暴露完整的 memory_ 工具集,从会话、提示词和工具活动中自动捕获观察记录,并可将召回上下文注入系统提示词——全部通过本地 REST 服务器完成,无需 MCP 桥接。

功能特性

- 完整工具面 — 全部 54 个 memory_ 工具(8 个核心工具)映射到 /agentmemory/,外加 memory_observe 和一个可访问任意端点的 memory_http 逃生通道。
- 自动捕获 — 会话、提示词、工具使用、子代理、工作流和审批活动都会在后台记录为观察记录。
- 上下文注入 — 可选启用;会话中召回的上下文会被添加到系统提示词中。
- 默认安全 — 凭据脱敏、按调用超时、非阻塞观察,以及受标志位限制的破坏性工具。
- 无需 MCP — 无需 stdio 桥接,无需子进程;唯一依赖是运行中的 REST 服务器(localhost:3111)。

环境要求

在同一台机器上运行 agentmemory 服务器(默认 http://127.0.0.1:3111,查看器位于 3113):

curl -fsS http://127.0.0.1:3111/agentmemory/livez
{"service":"agentmemory","status":"ok"} when healthy

如果服务器不可用,插件会记录一条警告,且 memory_ 工具会返回错误;harness 本身仍会正常运行。

安装

原生挂载

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

向 ~/.dsh/config.yaml(或针对所有配置文件的 $DSH_HOME/cordis.patch.yml)添加一个 insert 补丁:

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

然后重启 DSH。编译产物已提交,因此无需构建步骤。

官方 CLI

npm registry (recommended) — @elementor-i/dsh-agentmemory@^0.1.1
npx -p @deepseek-ai/dsh dsh plugin --profile web add @elementor-i/dsh-agentmemory

or directly from the source repository
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:elementor-i/dsh-agentmemory

将 web 替换为你的配置文件名称。该包声明了 dsh.bundle.patch,因此会作为配置文件层加载;编译产物已提交,因此安装时不会运行构建。
插件管理器(AI 辅助)

Oh-DSH-Desktop 的插件管理器通过隔离预览和回滚进行安装。它由 AI 编码代理通过工具驱动——而非 shell 命令——因此最快的路径是将此提示粘贴给你的助手:

从 Oh-DSH-Desktop 插件管理器安装 dsh-agentmemory:刷新插件目录,将安装准备为隔离预览,并在我审查预览后应用它。

在底层,助手会调用以下工具:

desktop_plugin_search  { query: 'dsh-agentmemory', refresh: true }   # confirm it is in the catalog
desktop_plugin_prepare { action: 'install', pluginId: 'dsh-agentmemory' }
desktop_plugin_apply   {}                                            # after you approve the preview

注意事项:

- 该插件必须已在公共 DSH 目录中。该目录每小时从标记为 dsh-plugin 的 GitHub 仓库重建一次,因此新发布的仓库大约会在一小时内出现。
- desktop_plugin_apply 会重启正在运行的 DSH 运行时——请在应用前审查隔离预览。

配置

所有键都是可选的,并具有安全的默认值。环境变量 AGENTMEMORY_URL、AGENTMEMORY_SECRET 和 AGENTMEMORY_PROJECT_NAME 会作为回退被采用。

dsh-agentmemory:
baseURL: http://127.0.0.1:3111   # empty -> $AGENTMEMORY_URL -> default
secret: ""                       # empty -> $AGENTMEMORY_SECRET (Bearer)
timeoutMs: 10000
observeTimeoutMs: 3000           # fire-and-forget hook timeout
registerTools: true
coreToolsOnly: false             # true -> only the 8 core tools
dangerousTools: false            # true -> expose destructive/expensive tools
projectName: ""                  # empty -> $AGENTMEMORY_PROJECT_NAME -> git repo basename
injectContext: false             # inject recalled context into the system prompt
injectMaxChars: 4000
healthCheck: true
hooks:
enabled: true
capturePrompts: true
captureToolUse: true
toolNameFilter: []             # non-empty -> only these tool names
captureSubagents: true
captureWorkflow: true
captureApprovals: false
preCompactSnapshot: false      # approximate PreCompact on request-error
maxObservationBytes: 8000
redactSecrets: true

| 键 | 默认值 | 描述 |
| --- | --- | --- |
| baseURL | http://127.0.0.1:3111 | agentmemory REST 基础 URL |
| secret | "" | Bearer 密钥(回退到 AGENTMEMORY_SECRET) |
| timeoutMs | 10000 | 每个工具的 HTTP 超时 |
| observeTimeoutMs | 3000 | 钩子观察超时(即发即忘) |
| registerTools | true | 注册 memory_ 工具集 |
| coreToolsOnly | false | 仅注册 8 个核心工具 |
| dangerousTools | false | 暴露 governance_delete、heal、consolidate、reflect、crystallize |
| injectContext | false | 将召回的上下文注入系统提示 |
| healthCheck | true | 如果服务器不可达,在启动时发出警告 |

钩子
活动通过 DSH 的官方事件自动捕获。处理器是非阻塞的:请求使用短超时且从不被 await,waterfall 事件始终调用 next()。

| agentmemory hook | DSH event | Mode |
| --- | --- | --- |
| SessionStart | session/created | emit |
| UserPromptSubmit | agent/inbox/inserted | emit |
| PreToolUse | tools/pre-execute | waterfall |
| PostToolUse / PostToolUseFailure | tools/result | emit |
| PreCompact (approx) | agent/request-error | waterfall |
| SubagentStart / SubagentStop | subagent/start / subagent/end | emit |
| Notification | approval/request | waterfall |
| TaskCompleted | agent/turn-stopping | serial |
| SessionEnd | session/disposed → /session/end | emit |
| context injection | system-prompt/assemble | waterfall |

工具

核心集(默认注册,或在 coreToolsOnly 下独占注册):

memory_save · memory_recall · memory_smart_search · memory_sessions · memory_lesson_save · memory_consolidate · memory_reflect · memory_diagnose

其余 46 个:memory_commits · memory_commit_lookup · memory_compress_file · memory_file_history · memory_timeline · memory_vision_search · memory_lesson_recall · memory_lesson_delete · memory_graph_query · memory_relations · memory_patterns · memory_profile · memory_audit · memory_verify · memory_heal · memory_crystallize · memory_governance_delete · memory_slot_create · memory_slot_get · memory_slot_append · memory_slot_replace · memory_slot_list · memory_slot_delete · memory_action_create · memory_action_update · memory_frontier · memory_next · memory_lease · memory_checkpoint · memory_routine_run · memory_signal_send · memory_signal_read · memory_sentinel_create · memory_sentinel_trigger · memory_sketch_create · memory_sketch_promote · memory_facet_tag · memory_facet_query · memory_mesh_sync · memory_team_share · memory_team_feed · memory_snapshot_create · memory_export · memory_claude_bridge_sync · memory_obsidian_export · memory_insight_list

附加项:

- memory_observe — 手动记录一条原始观察(自动捕获通常已覆盖此功能)。
- memory_http — 使用 JSON 正文或查询调用任意 /agentmemory/ 端点(用于没有专用工具的端点)。

工作原理

三个部分通过本地 REST 服务器协同工作:

- 工具 — 每个 memory_ 工具映射到匹配的 /agentmemory/ 端点。
- 钩子 — DSH 生命周期事件作为观察转发到服务器。
- 注入 — 在会话开始时,服务器返回召回的上下文,当启用 injectContext 时,该上下文会被添加到系统提示中。

DSH events     ──▶  /agentmemory/observe        automatic capture
memory_ tools ──▶  /agentmemory/*              on-demand operations
session start  ──▶  context ──▶ system prompt   optional injection

兼容性
工具名称和端点遵循 agentmemory 的官方参考。运行中的服务器可能与最新版本有所不同:

- 某些功能默认处于禁用状态(例如 /slots 会返回 503 并附带启用提示);
- 较新的端点可能尚未存在。

当收到 4xx 或 5xx 响应时,请遵循响应正文中的提示,或对齐服务器版本。memory_http 可以访问那些没有专用工具的端点。

开发

从源码构建:

npm install
npm run typecheck
npm run build
npm test        # read-only checks against a running server

常见问题

插件管理器安装失败——我还能尝试什么?

Oh-DSH-Desktop 的插件管理器和官方 CLI 最终都会运行 dsh plugin --profile  add 。如果插件管理器在你的环境中失败,CLI 是一个等效的备选方案:

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

将 desktop 替换为你的 profile 名称,然后重启 DSH。如果你管理的是 desktop profile,请使用与桌面应用相同的 DSH_HOME 运行该命令(在 macOS 上为 ~/Library/Application Support/Oh-DSH-Desktop/dsh)。

ERR_PNPM_UNEXPECTED_STORE 或“pnpm failed in profile directory”

当 profile 的 node_modules 是从一个已不存在的 pnpm store 链接而来时,就可能发生这种情况——例如,在插件管理器的预览目录被清理之后。在 macOS 上观察到的一种变通方法是,从当前 store 重新链接,然后重试:

CI=true dsh plugin --profile desktop install
dsh plugin --profile desktop add @elementor-i/dsh-agentmemory

(CI=true 让 pnpm 无需交互式提示即可重新创建 node_modules。)

插件管理器在 gh 上超时

插件管理器会调用 GitHub CLI(gh)来解析提交和克隆仓库。如果它报告 gh 超时,而同样的命令在你自己的终端中可以正常工作,那么重试——或使用上面的 CLI 路径——通常是继续推进的最快方式。

这些说明描述的是在特定环境中观察到的症状;它们并不保证每个环境的行为都相同。

许可证

MIT © 2026 Element

致谢

- agentmemory —— 本插件所连接的内存服务器。
- DeepSeek Harness —— 宿主及其事件系统。

上游仓库有新提交时邮件通知你(每天最多一封,无更新不打扰),随时一键退订。

💬 加入 DPharness 群聊

插件用法、部署报错、新插件第一时间同步——群里问,比一个人翻文档快。

点击加入 QQ 群
DPharness 群聊二维码,手机 QQ 扫码进群
扫码进群