Skip to content

#1 Persistent memory for AI coding agents based on real-world benchmarks

fix(devin): capture sessions from the Devin plugin and prepare it for the marketplace (#1570)

Rohit Ghumareec28162bb3f6
diff --git a/CHANGELOG.md b/CHANGELOG.md
index aa031b24..c7e8f497 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,10 +9,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
### Fixed
- **Session summaries cover the whole session again** (#745). 0.9.30 completed a session on the first per-turn Stop and ignored every later end, so summaries and graph extraction stopped at turn 1. `mem::observe` now reopens a completed session when new observations arrive, the Stop hook sends `final: false` so the session stays open, and an idle finalizer completes it once nothing has happened for `AGENTMEMORY_FINALIZE_IDLE_MS` (default 2 minutes). SessionEnd, the CLI and the OpenCode plugin send `final: true` and complete at once; a request without the flag behaves as before. The sweep summarizes a session before marking it abandoned (#737).
+- **The Devin plugin captures sessions.** A plugin install loaded `hooks/hooks.json`, whose capitalized Claude Code matchers never match Devin's tool names and whose extra events Devin rejects, so capture never fired. `plugin/hooks.json` now carries the six Devin hooks with lowercase matchers, and Devin loads it first. Verified on Devin CLI 3000.11.3: one session recorded session start, prompt, tool use and session end.
- **Summaries are incremental.** `mem::summarize` keeps a watermark (`coveredThrough`) and summarizes only the observations captured since the last run, merging them into the stored summary with one reduce call. A session end with nothing new costs no LLM call, and the reflect, graph and skill fan-out is skipped for it.
### Changed
+- The Devin plugin manifest adds a display name and logo, says it is for Devin CLI and Devin Desktop only, and runs `@agentmemory/mcp` at the release version instead of the latest one. `npm run docs:sync` moves that pin on each version bump.
- `@agentmemory/mcp` pins the exact matching `@agentmemory/agentmemory` release instead of a `~` range, so an installed shim never resolves a newer runtime than the one it was published with.
## [0.9.30] - 2026-10-06
diff --git a/README.md b/README.md
index 83576d11..18695707 100644
--- a/README.md
+++ b/README.md
@@ -779,7 +779,7 @@ The agentmemory entry is the **same MCP server block** across every host that us
| **Claude Desktop** | `claude_desktop_config.json` (Application Support) | Merge into `mcpServers`. Restart Claude Desktop after editing. |
| **Cline / Roo Code / Kilo Code** | Cline MCP settings (Settings UI → MCP Servers → Edit) | Same `mcpServers` block. |
| **Devin CLI (MCP + hooks)** | `~/.config/devin/config.json` | `agentmemory connect devin` merges the MCP entry; `--with-hooks` adds six native auto-capture hooks (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop, SessionEnd) with Devin'"'"'s lowercase tool matchers. Verify with `devin mcp list` and `/hooks` inside devin. |
-| **Devin CLI (full plugin)** | `plugin/.devin-plugin/` | `devin plugins install ./plugin` from a checkout registers all 17 skills as `/agentmemory:<skill>` slash commands plus the MCP server. Devin plugin hooks cannot fire `SessionStart`/`SessionEnd`, so pair it with `connect devin --with-hooks` for full session capture. |
+| **Devin CLI + Desktop (full plugin)** | `plugin/.devin-plugin/` | `devin plugins install rohitg00/agentmemory#plugin` registers all 17 skills as `/agentmemory:<skill>` slash commands, the MCP server, and six auto-capture hooks (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop, SessionEnd) from `plugin/hooks.json`. Verify with `devin plugins info agentmemory` and `/hooks`. Local sessions only: cloud Devin sessions cannot reach a local agentmemory server. |
| **Devin (cloud)** | Settings → Connections → MCP servers | Add a custom MCP (STDIO): command `npx`, args `-y @agentmemory/mcp@latest`, env `AGENTMEMORY_URL` pointing at a network-reachable agentmemory deployment plus `AGENTMEMORY_SECRET` (cloud sessions cannot reach localhost — see [`deploy/`](deploy/)). Store the secret in Devin Secrets, then use "Test listing tools" to verify all 54 tools appear. |
| **Gemini CLI** | `~/.gemini/settings.json` | `gemini mcp add agentmemory npx -y @agentmemory/mcp --scope user` (auto-merges). |
| **GitHub Copilot CLI (MCP only)** | `~/.copilot/mcp-config.json` | `agentmemory connect copilot-cli` merges `mcpServers.agentmemory`; Copilot picks it up on next launch or `/mcp`. |
diff --git a/plugin/.devin-plugin/plugin.json b/plugin/.devin-plugin/plugin.json
index f4e00e48..4a73bda1 100644
--- a/plugin/.devin-plugin/plugin.json
+++ b/plugin/.devin-plugin/plugin.json
@@ -1,7 +1,9 @@
{
"name": "agentmemory",
+ "displayName": "agentmemory",
"version": "0.9.30",
- "description": "Persistent memory for AI coding agents. Captures sessions, recalls with hybrid BM25 + vector + graph search, and exposes 54 memory tools over MCP. Keyless by default, runs on your machine.",
+ "description": "Persistent memory for Devin CLI and Devin Desktop. Captures every session automatically, recalls with hybrid BM25 + vector + graph search, and exposes 54 memory tools over MCP. Keyless by default, runs on your machine. Not supported in cloud sessions.",
+ "logo": "assets/icon.svg",
"author": {
"name": "Rohit Ghumare",
"email": "[email protected]"
@@ -21,7 +23,7 @@
"command": "npx",
"args": [
"-y",
- "@agentmemory/mcp"
+ "@agentmemory/[email protected]"
],
"env": {
"AGENTMEMORY_URL": "${AGENTMEMORY_URL:-http://localhost:3111}",
diff --git a/plugin/hooks.json b/plugin/hooks.json
new file mode 100644
index 00000000..e990f925
--- /dev/null
+++ b/plugin/hooks.json
@@ -0,0 +1,67 @@
+{
+ "hooks": {
+ "SessionStart": [
+ {
+ "hooks": [
+ {
+ "type": "command",
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/session-start.mjs\""
+ }
+ ]
+ }
+ ],
+ "UserPromptSubmit": [
+ {
+ "hooks": [
+ {
+ "type": "command",
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/prompt-submit.mjs\""
+ }
+ ]
+ }
+ ],
+ "PreToolUse": [
+ {
+ "matcher": "^(exec|edit|write|read|apply_patch|grep|glob)$",
+ "hooks": [
+ {
+ "type": "command",
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/pre-tool-use.mjs\""
+ }
+ ]
+ }
+ ],
+ "PostToolUse": [
+ {
+ "matcher": "",
+ "hooks": [
+ {
+ "type": "command",
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/post-tool-use.mjs\""
+ }
+ ]
+ }
+ ],
+ "Stop": [
+ {
+ "matcher": "",
+ "hooks": [
+ {
+ "type": "command",
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/stop.mjs\""
+ }
+ ]
+ }
+ ],
+ "SessionEnd": [
+ {
+ "hooks": [
+ {
+ "type": "command",
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/session-end.mjs\""
+ }
+ ]
+ }
+ ]
+ }
+}
diff --git a/plugin/skills/agentmemory-agents/SKILL.md b/plugin/skills/agentmemory-agents/SKILL.md
index bd8da9eb..3eb20e98 100644
--- a/plugin/skills/agentmemory-agents/SKILL.md
+++ b/plugin/skills/agentmemory-agents/SKILL.md
@@ -12,7 +12,9 @@ user-invocable: false
agentmemory connect claude-code # or cursor, codex, gemini-cli, ...
```
-After wiring, restart the host or run its MCP reload (for example `/mcp` in Claude Code) so it picks up the server. Then confirm the agent lists agentmemory's tools.
+After wiring, restart the host or run its MCP reload (for example `/mcp` in Claude Code, or a new session after `devin mcp list` in Devin CLI) so it picks up the server. Then confirm the agent lists agentmemory's tools.
+
+Devin CLI and Devin Desktop can also install the whole plugin with `devin plugins install rohitg00/agentmemory#plugin`, which adds the skills, the MCP server, and the capture hooks in one step. Cloud Devin sessions cannot reach a local agentmemory server, so the plugin is for local sessions only.
## Workflow
diff --git a/plugin/skills/agentmemory-hooks/SKILL.md b/plugin/skills/agentmemory-hooks/SKILL.md
index fb89a225..3147d628 100644
--- a/plugin/skills/agentmemory-hooks/SKILL.md
+++ b/plugin/skills/agentmemory-hooks/SKILL.md
@@ -4,7 +4,7 @@ description: The agentmemory plugin hooks that capture observations automaticall
user-invocable: false
---
-The Claude Code plugin registers lifecycle hooks so memory is captured automatically. You do not have to call `memory_save` for routine work; the hooks observe tool use, prompts, and session boundaries and write observations for you.
+The agentmemory plugin registers lifecycle hooks so memory is captured automatically. You do not have to call `memory_save` for routine work; the hooks observe tool use, prompts, and session boundaries and write observations for you.
## Quick start
@@ -15,6 +15,14 @@ For Claude Code, install its plugin:
/plugin install agentmemory
```
+For Devin CLI and Devin Desktop, install the plugin and start a new session:
+
+```bash
+devin plugins install rohitg00/agentmemory#plugin
+```
+
+Run `/hooks` inside Devin to confirm the agentmemory hooks are loaded. Plugin hooks run only in local Devin sessions, not in cloud sessions.
+
Hermes and OpenClaw use their native integrations and lifecycle contracts. Follow the matching integration setup instructions and verify a real turn creates an observation. Installing shared skills or connecting MCP alone does not enable automatic capture. Watch recorded observations in the viewer at `http://localhost:3113` when using the default port.
## What the hooks do
@@ -26,7 +34,7 @@ Hermes and OpenClaw use their native integrations and lifecycle contracts. Follo
## Important
-- The Claude Code hooks capture by default without an LLM. Summary generation (`AGENTMEMORY_AUTO_COMPRESS`) and hook context injection (`AGENTMEMORY_INJECT_CONTEXT`) are separate options. Native integrations have their own recall/capture settings; inspect the host configuration instead of assuming these flags control every plugin.
+- The plugin hooks capture by default without an LLM. Summary generation (`AGENTMEMORY_AUTO_COMPRESS`) and hook context injection (`AGENTMEMORY_INJECT_CONTEXT`) are separate options. Native integrations have their own recall/capture settings; inspect the host configuration instead of assuming these flags control every plugin.
- If observations are missing, confirm the plugin is enabled and the server is running. See [TROUBLESHOOTING.md](TROUBLESHOOTING.md).
## See also
diff --git a/scripts/docs-sync.ts b/scripts/docs-sync.ts
index 19d4b810..cf0de949 100644
--- a/scripts/docs-sync.ts
+++ b/scripts/docs-sync.ts
@@ -249,6 +249,7 @@ const VERSION_FILES: Array<{ file: RegExp; pattern: (v: string) => RegExp; repla
{ file: /^src\/version\.ts$/, pattern: (v) => new RegExp(`(VERSION = ")${escapeRegex(v)}(")`), replace: (v) => `$1${v}$2` },
{ file: /^AGENTS\.md$/, pattern: (v) => new RegExp(`(## Current Stats \\(v)${escapeRegex(v)}(\\))`), replace: (v) => `$1${v}$2` },
{ file: /^packages\/mcp\/package\.json$/, pattern: (v) => new RegExp(`("@agentmemory/agentmemory":\\s*"~?)${escapeRegex(v)}(")`), replace: (v) => `$1${v}$2` },
+ { file: /^plugin\/\.devin-plugin\/plugin\.json$/, pattern: (v) => new RegExp(`("@agentmemory/mcp@)${escapeRegex(v)}(")`), replace: (v) => `$1${v}$2` },
];
function syncVersion(files: Map<string, string>, from: string, to: string): void {
diff --git a/test/devin-connect-hooks.test.ts b/test/devin-connect-hooks.test.ts
index 01f664b6..8c3eb49a 100644
--- a/test/devin-connect-hooks.test.ts
+++ b/test/devin-connect-hooks.test.ts
@@ -1,5 +1,6 @@
import { describe, it, expect } from "vitest";
-import { resolve } from "node:path";
+import { existsSync, readFileSync } from "node:fs";
+import { join, resolve } from "node:path";
import { spawn } from "node:child_process";
import {
buildMergedHooks,
@@ -120,3 +121,42 @@ describe("hook payload compatibility with Devin CLI", () => {
expect(typeof parsed.hookSpecificOutput?.additionalContext).toBe("string");
});
});
+
+describe("Devin plugin package", () => {
+ const readJson = (path: string) => JSON.parse(readFileSync(path, "utf8"));
+ const manifest = readJson(join(PLUGIN_ROOT, ".devin-plugin", "plugin.json"));
+ const pluginHooks = readJson(join(PLUGIN_ROOT, "hooks.json")) as HookManifest;
+
+ it("ships the Devin hook set at the plugin root, where Devin loads plugin hooks first", () => {
+ expect(pluginHooks).toEqual(readJson(join(PLUGIN_ROOT, "hooks", "hooks.devin.json")));
+ expect(Object.keys(pluginHooks.hooks).sort()).toEqual([...DEVIN_EVENTS].sort());
+ });
+
+ it("points every plugin hook at a bundled script", () => {
+ for (const entries of Object.values(pluginHooks.hooks)) {
+ for (const entry of entries) {
+ for (const handler of entry.hooks) {
+ const script = /\$\{CLAUDE_PLUGIN_ROOT\}\/(scripts\/[\w-]+\.mjs)/.exec(handler.command)?.[1];
+ expect(script).toBeDefined();
+ expect(existsSync(join(PLUGIN_ROOT, script!))).toBe(true);
+ }
+ }
+ }
+ });
+
+ it("gives the marketplace card a name and a bundled logo", () => {
+ expect(manifest.displayName).toBe("agentmemory");
+ expect(existsSync(join(PLUGIN_ROOT, manifest.logo))).toBe(true);
+ });
+
+ it("pins the MCP server to the released package version", () => {
+ const { version } = readJson(resolve(PLUGIN_ROOT, "..", "package.json"));
+ expect(manifest.version).toBe(version);
+ expect(manifest.mcpServers.agentmemory.args).toContain(`@agentmemory/mcp@${version}`);
+ });
+
+ it("states that cloud sessions are not supported", () => {
+ expect(manifest.description).toMatch(/Devin CLI and Devin Desktop/);
+ expect(manifest.description).toMatch(/Not supported in cloud sessions/);
+ });
+});