camplus360/agent-memory-bridge

One bridge. Every AI coding agent. One shared searchable memory. Cross-session, cross-engine memory for pi-coding-agent, DeepSeek Harness and OpenCode, powered by claude-mem. Capture tool/conversation observations to a local worker and inject relevant past context automatically.

Project Overview项目介绍

agent-memory-bridge is a cross-agent memory bridge that unifies the capture, storage and recall protocols of six AI coding agents into one shared, searchable archive. It plugs into OpenCode (native plugin), CodeBuddy and Codex CLI (hooks.json), pi (npm extension), Hermes (engine.py snippet) and DeepSeek Harness / dsh (npm Cordis plugin), funneling every session event through a single claude-mem-worker.py that owns session id namespacing in the form <agent>-<sessionId> to prevent cross-agent collisions. The architecture diagram in the README shows all six adapters converging on the same worker, which then forwards to a pluggable backend selected via the CLAUDE_MEM_BACKEND environment variable.

The typical workflow begins with starting a memory backend — claude-mem on 127.0.0.1:37701 by default or mem0 on port 8000 — and verifying that curl -s http://127.0.0.1:37701/api/health returns "status":"ok". The user then clones the Gitee or GitHub mirror, runs ./install.sh --all to register every adapter at once, or ./install.sh --agent codebuddy|codex|opencode|pi|hermes|dsh to pick a single one. Per-agent npm packages such as @camplus360/agent-memory-bridge-dsh and @camplus360/agent-memory-bridge-opencode ship separately for finer-grained installs. Hooks automatically forward UserPromptSubmit to init, PostToolUse to observation and Stop to summarize, so the editor never blocks while memory calls run in the background.

Dependencies are minimal: bash, curl, jq and python3, with no compiled artifacts, which keeps the project portable across Linux, macOS and Windows WSL. The repository is dual-licensed — the unified worker, installer, tests and the CodeBuddy / Codex / Hermes / OpenCode / dsh adapters are MIT, while agents/pi is a derivative fork kept under AGPL-3.0-or-later because it derives from the AGPL-era claude-mem / pi-agent-memory. First-run caveats include confirming the worker health endpoint before editing, knowing that an empty SessionStart is intentionally dropped, and noting that hook failures exit 0 silently to keep editors responsive. The roadmap already lists Claude Code CLI, Gemini CLI and Cursor as upcoming adapters, alongside packaged checksums and ephemeral end-to-end container tests.

agent-memory-bridge 是一个跨编码代理的记忆桥接工具,统一六款 AI 编程代理的会话存储与检索协议。它通过原生插件、hooks.json 或 npm 包方式接入 OpenCode、CodeBuddy、Codex CLI、pi、Hermes 与 DeepSeek Harness (dsh),所有代理共享同一份由 claude-mem-worker.py 管理的记忆库,session id 采用 <agent>-<sessionId> 命名空间防止冲突。

典型使用流程是先启动后端 worker(默认 claude-mem 监听 127.0.0.1:37701,可选 mem0 监听 8000),再执行 ./install.sh --all 或 --agent <name> 选择性安装适配器,最后通过环境变量 CLAUDE_MEM_BACKEND 在 claude-mem、mem0 或双写模式之间切换。该项目适合同时使用多个 AI 编码代理、需要在会话间与跨工具检索历史上下文的开发者。

依赖仅需 bash、curl、jq 与 python3,无编译产物,支持 Linux、macOS 与 Windows WSL。仓库采用 MIT 与 AGPL-3.0 多许可(pi 适配器源自 AGPL 时代代码,其余为 MIT)。首次运行前必须先确认 curl /api/health 返回 ok,否则 hook 静默退出;OpenCode 适配器附带 8 项 mock 测试,test-hooks.sh 可对所有 shell hook 进行本地回归。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 2 warnings2 项注意
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
  • No DSH plugin manifest detected - it may only carry the dsh-plugin topic, so the install method must be confirmed on the spot未检测到 DSH 插件清单:可能只是打了 dsh-plugin 话题,安装方式要现场确认
  • Not DSH-native: a multi-platform tool that may require Node / Electron or another runtime first非 DSH 原生,是多平台兼容工具:可能要先装 Node / Electron 等运行时
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:camplus360/agent-memory-bridge

把 camplus360/agent-memory-bridge 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

agent-memory-bridge

One bridge. Every AI coding agent. One shared, searchable memory.

English · 简体中文

License: MIT License: AGPL v3 PRs Welcome

Mirrors — Gitee · GitHub · npm: agent-memory-bridge · npm: @camplus360/agent-memory-bridge-opencode · npm: @camplus360/agent-memory-bridge-dsh


✨ Why you need this

Run several AI coding agents — OpenCode, CodeBuddy, Codex CLI, pi, Hermes, DeepSeek Harness (dsh) — and each one invents its own memory capture: different hooks, different payloads, different corner cases. Maintaining six separate hacks means the protocol drifts, and one broken hook silently stops remembering anything.

agent-memory-bridge collapses all of that into one source of truth — a single, shared, searchable memory across every agent you use.


🎯 Highlights

亮点 说明
🔄 多 Agent 适配 OpenCode / CodeBuddy / Codex CLI / pi / Hermes / dsh 一套协议全兼容,六端共享同一记忆库
🚀 极致易用 一条命令安装,一条命令启用,./install.sh --all 搞定全部
🌍 多平台适配 macOS / Linux / Windows(WSL) 通用,bash + curl + python3 零额外依赖
🔌 后端记忆库可拔插 claude-mem(LLM 摘要 + 向量检索)/ mem0(服务端事实抽取)/ both(双写),一个环境变量切换
📥 自动捕获 自动记录用户提问、工具调用、助手回复、会话结束,无需手动操作
🌐 中英双语 完整英文 + 简体中文文档,README 双语同步

Features

  • One repository, pick your agents — install adapters for OpenCode, CodeBuddy, Codex CLI, pi, Hermes and/or dsh with a single ./install.sh --agent <name>.
  • One protocol, six adapters — session id namespacing (<agent>-<sessionId>) prevents cross-agent collisions; payload fields are identical everywhere.
  • npm-installable adapters — pi (npm:agent-memory-bridge), opencode (npm:@camplus360/agent-memory-bridge-opencode) and dsh (npm:@camplus360/agent-memory-bridge-dsh) ship as installable npm packages; one command to add, one to enable.
  • Pluggable backends — claude-mem (session-based, LLM summaries), mem0 (flat, server-side fact extraction), or both (dual-write), switched with one environment variable.
  • Hook-safe by design — short timeouts, retries with backoff, and a silent exit 0 when the worker is down. Your editor never hangs on a memory call.
  • Correct JSON — built with jq / python3, so quotes, backslashes and multiline tool output cannot corrupt a payload.
  • Tested — the OpenCode plugin ships with 8 mocked tests; test-hooks.sh runs every shell hook against a local mock worker.
  • Cross-platform — pure bash + curl + python3, no compiled dependencies; runs on Linux, macOS and WSL.

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev gord-dsh-worktree 下一个 Next dsh-reach →