akitaonrails / ai-memory
akitaonrails / ai-memory
Long-term memory for AI coding agents. Quit Claude Code mid-task, start OpenAI Codex in the same directory, continue without re-explaining the architecture, the failed approaches, or the open questions. 为 AI 编程助手提供长期记忆功能。你可以在任务进行到一半时退出 Claude Code,在同一目录下启动 OpenAI Codex,并直接继续工作,无需重新解释架构、失败的尝试或遗留的问题。
Support Matrix
支持矩阵
Area Status Notes 区域 状态 说明
Linux Supported Primary Docker/server target and CI platform. Published Docker images support linux/amd64 and linux/arm64. Native Arch/AUR packages include system and user systemd units. Linux 支持 主要的 Docker/服务器目标及 CI 平台。发布的 Docker 镜像支持 linux/amd64 和 linux/arm64。原生的 Arch/AUR 软件包包含系统级和用户级的 systemd 单元。
macOS Supported Workspace tests run in CI; tagged releases publish native ai-memory-macos-aarch64.tar.gz and ai-memory-macos-x86_64.tar.gz binaries. The native binary is the recommended path on Apple Silicon. See docs/macos.md. macOS 支持 工作区测试在 CI 中运行;带标签的发布版本提供原生的 ai-memory-macos-aarch64.tar.gz 和 ai-memory-macos-x86_64.tar.gz 二进制文件。在 Apple Silicon 上推荐使用原生二进制文件。详见 docs/macos.md。
Windows via WSL2 Supported Use the Linux install path inside WSL2 when the agent runs there. Windows (通过 WSL2) 支持 当代理在 WSL2 中运行时,请使用 Linux 安装路径。
Native Windows Experimental Tagged releases publish ai-memory-windows-x86_64.zip with ai-memory.exe; Docker Desktop wrapper and source builds are also available. Local supported profiles default to host-native hook commands; Claude Code may use its Windows exec form, while other agents use native single command strings matching their hook schema. PowerShell/Git Bash scripts are compatibility fallbacks. See docs/windows.md. 原生 Windows 实验性 带标签的发布版本提供包含 ai-memory.exe 的 ai-memory-windows-x86_64.zip;同时也提供 Docker Desktop 封装和源码构建版本。本地支持的配置文件默认使用宿主机原生钩子命令;Claude Code 可能使用其 Windows 执行格式,而其他代理则使用符合其钩子模式的原生单行命令字符串。PowerShell/Git Bash 脚本作为兼容性备选方案。详见 docs/windows.md。
Claude Code Supported MCP config + lifecycle hooks; native commands enforce capture exclusions. install-mcp —session-aware optionally enables per-session auto-scope isolation through a local stdio bridge. Optionally captures the assistant’s final turn on Stop when installed with —capture-assistant and the server enables capture_assistant (double opt-in, off by default). Claude Code 支持 MCP 配置 + 生命周期钩子;原生命令强制执行捕获排除。install-mcp —session-aware 可选地通过本地 stdio 网桥启用每会话自动范围隔离。如果安装时使用了 —capture-assistant 且服务器启用了 capture_assistant(双重确认,默认关闭),则可在停止时选择性地捕获助手的最后一次对话。
Codex Supported MCP config + lifecycle hooks; native commands enforce capture exclusions. No automatic true session-end hook, so run ai-memory finalize-session when you need a final summary/handoff. Codex 支持 MCP 配置 + 生命周期钩子;原生命令强制执行捕获排除。没有自动的真实会话结束钩子,因此当你需要最终总结/交接时,请运行 ai-memory finalize-session。
Command Code Supported MCP config (/.commandcode/mcp.json) + its four stable lifecycle-hook events (/.commandcode/settings.json); native commands enforce capture exclusions and SessionStart injects handoffs. Stop is only a turn boundary, so use ai-memory finalize-session —agent command-code after the final turn. ai-memory run command-code adds exact v3 native-session resume and visible-event import; experimental unsandboxed Mods remain excluded.
Command Code 支持 MCP 配置 (/.commandcode/mcp.json) + 其四个稳定的生命周期钩子事件 (/.commandcode/settings.json);原生命令强制执行捕获排除,且 SessionStart 会注入交接信息。Stop 仅作为对话轮次边界,因此在最后一轮对话后请使用 ai-memory finalize-session —agent command-code。ai-memory run command-code 增加了精确的 v3 原生会话恢复和可见事件导入;实验性的非沙箱 Mods 仍被排除在外。
Devin CLI Supported MCP config + lifecycle hooks. Hooks use Devin’s PostCompaction event, inject handoffs via hookSpecificOutput.additionalContext, and omit subagent events because Devin does not expose them. Devin CLI 支持 MCP 配置 + 生命周期钩子。钩子使用 Devin 的 PostCompaction 事件,通过 hookSpecificOutput.additionalContext 注入交接信息,并省略子代理事件,因为 Devin 不会暴露这些事件。
OpenCode Supported Remote MCP config + generated TypeScript plugin; generated plugin enforces capture exclusions. OpenCode 支持 远程 MCP 配置 + 生成的 TypeScript 插件;生成的插件强制执行捕获排除。
Cursor Supported MCP config + lifecycle hooks. Cursor 支持 MCP 配置 + 生命周期钩子。
Gemini CLI Supported MCP config + lifecycle hooks. Gemini CLI 支持 MCP 配置 + 生命周期钩子。
Oh My Pi / OMP Supported Use —client omp / —agent omp (or oh-my-pi) for native .omp MCP config + TypeScript extension; generated extension enforces capture exclusions. Oh My Pi / OMP 支持 使用 —client omp / —agent omp (或 oh-my-pi) 以获取原生的 .omp MCP 配置 + TypeScript 扩展;生成的扩展强制执行捕获排除。
Pi Supported Generated ~/.pi/agent/extensions/ai-memory.ts extension provides lifecycle capture and an HTTP MCP bridge; generated extension enforces capture exclusions. Pi 支持 生成的 ~/.pi/agent/extensions/ai-memory.ts 扩展提供生命周期捕获和 HTTP MCP 网桥;生成的扩展强制执行捕获排除。
Crush Managed-only ai-memory run crush resumes its project-local session database and supplies portable context through a temporary supported global-context file; no lifecycle-hook installer is provided. Crush 仅托管 ai-memory run crush 会恢复其项目本地的会话数据库,并通过临时支持的全局上下文文件提供可移植上下文;不提供生命周期钩子安装程序。
Managed workstreams Opt-in ai-memory run provides transparent cross-harness continuity for Claude Code, Codex, OpenCode, Pi, Crush, Kimi Code, Command Code, both incompatible Kiro CLI engines, OMP, Grok Build CLI, and Antigravity CLI. Direct launches remain unchanged. See docs/managed-workstreams.md. 托管工作流 可选的 ai-memory run 为 Claude Code、Codex、OpenCode、Pi、Crush、Kimi Code、Command Code、两个不兼容的 Kiro CLI 引擎、OMP、Grok Build CLI 和 Antigravity CLI 提供透明的跨工具连续性。直接启动方式保持不变。详见 docs/managed-workstreams.md。
Claude Desktop MCP-only Uses mcp-remote; no lifecycle hooks. Claude Desktop 仅 MCP 使用 mcp-remote;无生命周期钩子。
OpenClaw Supported MCP config + native plugin lifecycle hooks; generated plugin enforces capture exclusions. OpenClaw 支持 MCP 配置 + 原生插件生命周期钩子;生成的插件强制执行捕获排除。
Antigravity CLI Supported MCP config (serverUrl) + lifecycle hooks (agy alias). Only PreInvocation with invocationNum = 0 maps to SessionStart; later model calls cannot consume a next-session handoff. No automatic true session-end hook, so run ai-memory finalize-session —agent antigravity-cli after the final turn when you need a summary, handoff, and opt-in SessionEnd consolidation. ai-memory run antigravity (aliases antigravity-cli, agy) adds managed workstream resume via —conversation; conversation text is not decoded, so the ledger for this harness comes from hook capture. Antigravity CLI 支持 MCP 配置 (serverUrl) + 生命周期钩子 (agy 别名)。只有 invocationNum = 0 的 PreInvocation 映射到 SessionStart;后续的模型调用无法消费下一会话的交接信息。没有自动的真实会话结束钩子,因此当你需要总结、交接和可选的 SessionEnd 合并时,请在最后一轮对话后运行 ai-memory finalize-session —agent antigravity-cli。ai-memory run antigravity (别名 antigravity-cli, agy) 通过 —conversation 增加托管工作流恢复功能;对话文本不会被解码,因此该工具的账本数据来自钩子捕获。
Grok Build CLI Supported MCP config (install-mcp —client grok → $GROK_HOME/config.toml, default ~/.grok/config.toml) + lifecycle hooks (install-hooks —agent grok → $GROK_HOME/hooks/ai-memory.json, default ~/.grok/hooks/ai-memory.json, Grok-specific hook bundle). Capture works; no hook handoff injection — Grok ignores SessionStart stdout, so recover handoffs via MCP memory_handoff_accept. ai-memory run grok adds managed workstream resume with the context packet delivered natively through —rules. Skills root: .grok/skills / $GROK_HOME/skills (default ~/.grok/skills). Grok Build CLI 支持 MCP 配置 (install-mcp —client grok → $GROK_HOME/config.toml, 默认 ~/.grok/config.toml) + 生命周期钩子 (install-hooks —agent grok → $GROK_HOME/hooks/ai-memory.json, 默认 ~/.grok/hooks/ai-memory.json, Grok 专用钩子包)。捕获功能正常;无钩子交接注入 —— Grok 会忽略 SessionStart 的标准输出,因此需通过 MCP memory_handoff_accept 恢复交接信息。ai-memory run grok 增加了托管工作流恢复功能,上下文数据包通过 —rules 原生传递。技能根目录:.grok/skills / $GROK_HOME/skills (默认 ~/.grok/skills)。
Swival CLI MCP-only install-mcp —client swival —apply merges a native HTTP entry into the project-root .swival/mcp.json, preserving sibling servers. Lifecycle and managed-workstream support are not claimed because Swival’s callback contract does not expose a stable session identifier. Swival CLI 仅 MCP install-mcp —client swival —apply 将原生 HTTP 条目合并到项目根目录的 .swival/mcp.json 中,同时保留同级服务器。不声明生命周期和托管工作流支持,因为 Swival 的回调契约未暴露稳定的会话标识符。
Zero Supported install-mcp —client zero (native HTTP + bearer in ~/.config/zero/config.json) + lifecycle hooks via install-hooks —agent zero —apply (exec-form native commands in ~/.config/zero/hooks.json, JSON payload on stdin, no shell). Capture works incl. specialist (subagent) events; no handoff injection — Zero discards sessionStart stdout, so recover handoffs via MCP memory_handoff_accept. Zero 支持 install-mcp —client zero (原生 HTTP + ~/.config/zero/config.json 中的 bearer 令牌) + 通过 install-hooks —agent zero —apply 实现的生命周期钩子 (exec 格式的原生命令位于 ~/.config/zero/hooks.json,JSON 负载通过 stdin 传递,不使用 shell)。捕获功能正常,包括专家(子代理)事件;无交接注入 —— Zero 会丢弃 sessionStart 的标准输出,因此需通过 MCP memory_handoff_accept 恢复交接信息。
Kimi Code Supported MCP config (url entry in /.kimi-code/mcp.json) + lifecycle hooks ([[hooks]] in /.kimi-code/config.toml 中的 [[hooks]],包含 10 个事件,包括子代理启动/停止和用于捕获工具失败的 PostToolUseFailure);两条路径均遵循 $KIMI_CODE_HOME。交接信息通过 UserPromptSubmit 标准输出注入 (Kimi Code 会丢弃 SessionStart 钩子的标准输出);ai-memory run kimi 增加了托管工作流恢复功能。/.kimi-code/config.toml, 10 events including subagent start/stop and PostToolUseFailure for tool-failure capture); both paths honor $KIMI_CODE_HOME. Handoffs inject via UserPromptSubmit stdout (Kimi Code discards SessionStart hook stdout); ai-memory run kimi adds managed workstream resume.
Kimi Code 支持 MCP 配置 (/.kimi-code/mcp.json 中的 url 条目) + 生命周期钩子 (
Kiro CLI Supported MCP config uses install-mcp —client kiro-cli (alias kiro) and Kiro’s Bedrock-compatible schema flavor. Kiro CLI 支持 MCP 配置使用 install-mcp —client kiro-cli (别名 kiro) 以及 Kiro 的 Bedrock 兼容模式。