@agentmemory/agentmemory 0.9.26 → 0.9.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/AGENTS.md +6 -6
  2. package/README.md +104 -42
  3. package/dist/cli.d.mts.map +1 -1
  4. package/dist/cli.mjs +239 -170
  5. package/dist/cli.mjs.map +1 -1
  6. package/dist/config-ChC9EtgV.mjs +259 -0
  7. package/dist/config-ChC9EtgV.mjs.map +1 -0
  8. package/dist/{connect-bmZ5eqYN.mjs → connect-JnsJXc68.mjs} +136 -42
  9. package/dist/connect-JnsJXc68.mjs.map +1 -0
  10. package/dist/hooks/notification.mjs +2 -1
  11. package/dist/hooks/notification.mjs.map +1 -1
  12. package/dist/hooks/post-commit.mjs +2 -1
  13. package/dist/hooks/post-commit.mjs.map +1 -1
  14. package/dist/hooks/post-tool-failure.mjs +2 -1
  15. package/dist/hooks/post-tool-failure.mjs.map +1 -1
  16. package/dist/hooks/post-tool-use.mjs +2 -1
  17. package/dist/hooks/post-tool-use.mjs.map +1 -1
  18. package/dist/hooks/pre-compact.mjs +2 -1
  19. package/dist/hooks/pre-compact.mjs.map +1 -1
  20. package/dist/hooks/pre-tool-use.mjs +2 -1
  21. package/dist/hooks/pre-tool-use.mjs.map +1 -1
  22. package/dist/hooks/prompt-submit.mjs +2 -1
  23. package/dist/hooks/prompt-submit.mjs.map +1 -1
  24. package/dist/hooks/session-end.mjs +2 -1
  25. package/dist/hooks/session-end.mjs.map +1 -1
  26. package/dist/hooks/session-start.mjs +2 -1
  27. package/dist/hooks/session-start.mjs.map +1 -1
  28. package/dist/hooks/stop.mjs +2 -1
  29. package/dist/hooks/stop.mjs.map +1 -1
  30. package/dist/hooks/subagent-start.mjs +2 -1
  31. package/dist/hooks/subagent-start.mjs.map +1 -1
  32. package/dist/hooks/subagent-stop.mjs +2 -1
  33. package/dist/hooks/subagent-stop.mjs.map +1 -1
  34. package/dist/hooks/task-completed.mjs +2 -1
  35. package/dist/hooks/task-completed.mjs.map +1 -1
  36. package/dist/{image-refs-C7h9L5wx.mjs → image-refs-BKLmp_sD.mjs} +4 -22
  37. package/dist/image-refs-BKLmp_sD.mjs.map +1 -0
  38. package/dist/image-refs-C2YU7BIm.mjs +34 -0
  39. package/dist/image-refs-C2YU7BIm.mjs.map +1 -0
  40. package/dist/index.mjs +559 -205
  41. package/dist/index.mjs.map +1 -1
  42. package/dist/{image-store-Gpo2mgM9.mjs → keyed-mutex-DTHtcZrt.mjs} +14 -11
  43. package/dist/keyed-mutex-DTHtcZrt.mjs.map +1 -0
  44. package/dist/{logger-yHTcEBAI.mjs → logger-BEB7pCI9.mjs} +1 -1
  45. package/dist/{logger-yHTcEBAI.mjs.map → logger-BEB7pCI9.mjs.map} +1 -1
  46. package/dist/{schema-Dsr_V2Wp.mjs → schema-CNiCWzV9.mjs} +5 -1
  47. package/dist/schema-CNiCWzV9.mjs.map +1 -0
  48. package/dist/{src-u7kAEUC0.mjs → src-CzgoepGU.mjs} +482 -83
  49. package/dist/src-CzgoepGU.mjs.map +1 -0
  50. package/dist/{standalone-C1yPO519.mjs → standalone-YsZFFQBM.mjs} +8 -5
  51. package/dist/standalone-YsZFFQBM.mjs.map +1 -0
  52. package/dist/standalone.d.mts.map +1 -1
  53. package/dist/standalone.mjs +6 -2
  54. package/dist/standalone.mjs.map +1 -1
  55. package/dist/{tools-registry-Dzxv9iUu.mjs → tools-registry-D3NEoe5m.mjs} +4 -254
  56. package/dist/tools-registry-D3NEoe5m.mjs.map +1 -0
  57. package/package.json +4 -1
  58. package/plugin/.claude-plugin/plugin.json +1 -1
  59. package/plugin/.codex-plugin/plugin.json +1 -1
  60. package/plugin/plugin.json +2 -2
  61. package/plugin/scripts/notification.mjs +2 -1
  62. package/plugin/scripts/notification.mjs.map +1 -1
  63. package/plugin/scripts/post-commit.mjs +2 -1
  64. package/plugin/scripts/post-commit.mjs.map +1 -1
  65. package/plugin/scripts/post-tool-failure.mjs +2 -1
  66. package/plugin/scripts/post-tool-failure.mjs.map +1 -1
  67. package/plugin/scripts/post-tool-use.mjs +2 -1
  68. package/plugin/scripts/post-tool-use.mjs.map +1 -1
  69. package/plugin/scripts/pre-compact.mjs +2 -1
  70. package/plugin/scripts/pre-compact.mjs.map +1 -1
  71. package/plugin/scripts/pre-tool-use.mjs +2 -1
  72. package/plugin/scripts/pre-tool-use.mjs.map +1 -1
  73. package/plugin/scripts/prompt-submit.mjs +2 -1
  74. package/plugin/scripts/prompt-submit.mjs.map +1 -1
  75. package/plugin/scripts/session-end.mjs +2 -1
  76. package/plugin/scripts/session-end.mjs.map +1 -1
  77. package/plugin/scripts/session-start.mjs +2 -1
  78. package/plugin/scripts/session-start.mjs.map +1 -1
  79. package/plugin/scripts/stop.mjs +2 -1
  80. package/plugin/scripts/stop.mjs.map +1 -1
  81. package/plugin/scripts/subagent-start.mjs +2 -1
  82. package/plugin/scripts/subagent-start.mjs.map +1 -1
  83. package/plugin/scripts/subagent-stop.mjs +2 -1
  84. package/plugin/scripts/subagent-stop.mjs.map +1 -1
  85. package/plugin/scripts/task-completed.mjs +2 -1
  86. package/plugin/scripts/task-completed.mjs.map +1 -1
  87. package/plugin/skills/_shared/TROUBLESHOOTING.md +38 -0
  88. package/plugin/skills/agentmemory-agents/REFERENCE.md +28 -0
  89. package/plugin/skills/agentmemory-agents/SKILL.md +34 -0
  90. package/plugin/skills/agentmemory-architecture/SKILL.md +33 -0
  91. package/plugin/skills/agentmemory-config/REFERENCE.md +42 -0
  92. package/plugin/skills/agentmemory-config/SKILL.md +37 -0
  93. package/plugin/skills/agentmemory-hooks/REFERENCE.md +20 -0
  94. package/plugin/skills/agentmemory-hooks/SKILL.md +39 -0
  95. package/plugin/skills/agentmemory-mcp-tools/REFERENCE.md +65 -0
  96. package/plugin/skills/agentmemory-mcp-tools/SKILL.md +39 -0
  97. package/plugin/skills/agentmemory-rest-api/REFERENCE.md +129 -0
  98. package/plugin/skills/agentmemory-rest-api/SKILL.md +43 -0
  99. package/plugin/skills/commit-context/EXAMPLES.md +71 -0
  100. package/plugin/skills/commit-context/SKILL.md +53 -8
  101. package/plugin/skills/commit-history/EXAMPLES.md +71 -0
  102. package/plugin/skills/commit-history/SKILL.md +51 -9
  103. package/plugin/skills/forget/EXAMPLES.md +75 -0
  104. package/plugin/skills/forget/SKILL.md +54 -14
  105. package/plugin/skills/handoff/EXAMPLES.md +56 -0
  106. package/plugin/skills/handoff/SKILL.md +56 -9
  107. package/plugin/skills/recall/EXAMPLES.md +74 -0
  108. package/plugin/skills/recall/SKILL.md +50 -11
  109. package/plugin/skills/recap/EXAMPLES.md +60 -0
  110. package/plugin/skills/recap/SKILL.md +51 -13
  111. package/plugin/skills/remember/EXAMPLES.md +67 -0
  112. package/plugin/skills/remember/SKILL.md +53 -17
  113. package/plugin/skills/session-history/EXAMPLES.md +59 -0
  114. package/plugin/skills/session-history/SKILL.md +54 -11
  115. package/plugin/skills/write-agentmemory-skill/SKILL.md +40 -0
  116. package/dist/connect-bmZ5eqYN.mjs.map +0 -1
  117. package/dist/image-refs-C7h9L5wx.mjs.map +0 -1
  118. package/dist/image-store-Gpo2mgM9.mjs.map +0 -1
  119. package/dist/rolldown-runtime-twds-ZHy.mjs +0 -14
  120. package/dist/schema-Dsr_V2Wp.mjs.map +0 -1
  121. package/dist/src-u7kAEUC0.mjs.map +0 -1
  122. package/dist/standalone-C1yPO519.mjs.map +0 -1
  123. package/dist/tools-registry-Dzxv9iUu.mjs.map +0 -1
  124. package/dist/version-BMFYFFut.mjs +0 -6
  125. package/dist/version-BMFYFFut.mjs.map +0 -1
@@ -0,0 +1,75 @@
1
+ # forget worked examples
2
+
3
+ ## 1. Delete a leaked secret
4
+
5
+ User: "Forget that note where I pasted the API key."
6
+
7
+ Search:
8
+
9
+ ```json
10
+ memory_smart_search { "query": "api key", "limit": 20 }
11
+ ```
12
+
13
+ Response:
14
+
15
+ ```json
16
+ {
17
+ "results": [
18
+ { "id": "abc12345", "sessionId": "7f3a9c21", "title": "Pasted staging API key",
19
+ "narrative": "STAGING_KEY=sk-live-..." }
20
+ ]
21
+ }
22
+ ```
23
+
24
+ Present and gate:
25
+
26
+ > Found 1 match:
27
+ > - `abc12345` (session `7f3a9c2`) "Pasted staging API key"
28
+ >
29
+ > Delete this memory? (yes/no)
30
+
31
+ After the user says yes:
32
+
33
+ ```json
34
+ memory_governance_delete { "memoryIds": ["abc12345"], "reason": "user privacy request" }
35
+ ```
36
+
37
+ Response:
38
+
39
+ ```json
40
+ { "deleted": 1 }
41
+ ```
42
+
43
+ Present:
44
+
45
+ > Deleted 1 memory (`abc12345`).
46
+
47
+ ## 2. Drop a whole session's observations
48
+
49
+ User: "Delete everything from the throwaway spike session."
50
+
51
+ Search, identify the session, then collect every memory id in it:
52
+
53
+ ```json
54
+ memory_smart_search { "query": "spike prototype throwaway", "limit": 20 }
55
+ ```
56
+
57
+ Response has 4 results all with `sessionId: c98f1100`. Show all four, get a yes,
58
+ then pass every id:
59
+
60
+ ```json
61
+ memory_governance_delete {
62
+ "memoryIds": ["m1", "m2", "m3", "m4"],
63
+ "reason": "drop throwaway spike session"
64
+ }
65
+ ```
66
+
67
+ Never send `{ "sessionId": "c98f1100" }`; the MCP deletes by memory id only.
68
+
69
+ ## 3. User declines
70
+
71
+ User: "Actually, on second thought, keep them."
72
+
73
+ Do not call delete. Confirm:
74
+
75
+ > Understood, nothing deleted. The 4 memories from session `c98f110` are intact.
@@ -1,26 +1,66 @@
1
1
  ---
2
2
  name: forget
3
- description: Delete specific observations or sessions from agentmemory. Use when user says "forget this", "delete memory", or wants to remove specific data for privacy.
3
+ description: Delete specific observations from agentmemory after showing them and getting explicit confirmation. Use when the user says "forget this", "delete memory", "remove that note", or wants to scrub specific data for privacy.
4
4
  argument-hint: "[what to forget - session ID, file path, or search term]"
5
5
  user-invocable: true
6
6
  ---
7
7
 
8
8
  The user wants to remove data from agentmemory: $ARGUMENTS
9
9
 
10
- **IMPORTANT**: This is a destructive operation. Always confirm with the user before deleting.
10
+ ## Quick start
11
11
 
12
- Steps:
12
+ ```json
13
+ memory_smart_search { "query": "old api key in config", "limit": 20 }
14
+ ```
13
15
 
14
- 1. First search for matching observations with the `memory_smart_search` MCP tool (provided by the agentmemory server this plugin wires up via `.mcp.json`). Use the user's input as the `query` with `limit: 20`.
15
- 2. Show the user what was found — session IDs, observation IDs, titles — and ask for explicit confirmation before deleting.
16
- 3. Once confirmed, call `memory_governance_delete` with:
17
- - `memoryIds: [<id>, ...]` — an array (or comma-separated string) of the memory IDs returned by the search in step 1
18
- - `reason: "<short reason>"` — optional, defaults to `"plugin skill request"`
16
+ Show the matches, get a yes, then:
19
17
 
20
- If the user wants to drop an entire session's observations, collect every memory ID in that session from the search results and pass them all via `memoryIds`. The standalone MCP doesn't accept a bare `sessionId` argument — it deletes by memory ID only.
21
- 4. Confirm the deletion count back to the user.
18
+ ```json
19
+ memory_governance_delete { "memoryIds": ["abc12345", "def67890"], "reason": "user privacy request" }
20
+ ```
22
21
 
23
- **Never delete without explicit user confirmation.** If the MCP tools aren't available, the stdio MCP shim didn't start — tell the user to:
24
- 1. Run `/plugin list` in Claude Code and confirm `agentmemory` shows as enabled.
25
- 2. Restart Claude Code (the plugin's `.mcp.json` is only read on startup).
26
- 3. Check `/mcp` to see whether the `agentmemory` MCP server is connected.
22
+ Expected output:
23
+
24
+ ```text
25
+ Found 2 matching memories. Confirmed. Deleted 2 memories.
26
+ ```
27
+
28
+ ## Why
29
+
30
+ This is destructive and irreversible. Show exactly what will be deleted and get
31
+ an explicit yes before calling delete. Delete by memory ID, never a bare session.
32
+
33
+ ## Workflow
34
+
35
+ 1. Search with `memory_smart_search`, the user's text as `query`, `limit: 20`.
36
+ 2. Show what matched: session ids, memory ids, titles. Ask for explicit
37
+ confirmation. Do not proceed on silence or a vague "sure, whatever".
38
+ 3. On confirmation, call `memory_governance_delete` with `memoryIds` (array or
39
+ comma-separated string) and optional `reason` (default `plugin skill request`).
40
+ 4. To drop a whole session, collect every memory id in that session from the
41
+ search results and pass them all. The MCP does not accept a bare `sessionId`.
42
+ 5. Report the deletion count back.
43
+
44
+ ## Anti-patterns
45
+
46
+ WRONG: search returns matches, you immediately call `memory_governance_delete`
47
+ without showing them or waiting for a yes.
48
+
49
+ RIGHT: list the matches, ask "Delete these 2? (yes/no)", and only delete after
50
+ an explicit yes.
51
+
52
+ ## Checklist
53
+
54
+ - Matches were shown to the user before any delete.
55
+ - An explicit yes was received, not assumed.
56
+ - `memoryIds` holds real ids from the search, never a bare `sessionId`.
57
+ - Final message states the actual count deleted.
58
+
59
+ ## See also
60
+
61
+ - `remember`: the write side; forget is its undo.
62
+ - `recall`: find the exact memory id before deleting.
63
+
64
+ ## Troubleshooting
65
+
66
+ See ../_shared/TROUBLESHOOTING.md if `memory_smart_search` or `memory_governance_delete` is not available.
@@ -0,0 +1,56 @@
1
+ # handoff worked examples
2
+
3
+ ## 1. Resume with an open question
4
+
5
+ User: "Where were we?"
6
+
7
+ Project cwd: `/Users/dev/app`. Invocation:
8
+
9
+ ```json
10
+ memory_sessions { "limit": 20 }
11
+ ```
12
+
13
+ Response:
14
+
15
+ ```json
16
+ {
17
+ "sessions": [
18
+ { "id": "7f3a9c21", "cwd": "/Users/dev/app", "title": "Auth refresh rework",
19
+ "status": "completed", "startedAt": "2026-06-07T09:00:00Z",
20
+ "summary": "Reworked refresh rotation. Open: should logout revoke all device tokens?",
21
+ "concepts": ["jwt-refresh-rotation", "logout"] }
22
+ ]
23
+ }
24
+ ```
25
+
26
+ Pull supporting context:
27
+
28
+ ```json
29
+ memory_recall { "query": "jwt-refresh-rotation logout", "limit": 10 }
30
+ ```
31
+
32
+ Present:
33
+
34
+ > Resuming `7f3a9c2` "Auth refresh rework".
35
+ > **Open question:** should logout revoke all device tokens or just the current one?
36
+ > Touched `auth/refresh.ts`, `auth/logout.ts`. Refresh rotation is done.
37
+ > **Next step:** decide the revoke scope, then finish `auth/logout.ts`.
38
+
39
+ ## 2. Sibling-repo guard
40
+
41
+ Project cwd: `/Users/dev/repo-a`. Sessions include one with `cwd:
42
+ /Users/dev/repo-a-staging`.
43
+
44
+ A raw prefix would match `repo-a-staging`. The boundary check rejects it because
45
+ `/Users/dev/repo-a-staging` does not equal `/Users/dev/repo-a` and does not start
46
+ with `/Users/dev/repo-a/`. Pick the real `repo-a` session instead, or fall back
47
+ to the most recent session overall if none matches.
48
+
49
+ ## 3. Empty session
50
+
51
+ User: "Resume."
52
+
53
+ If the matched session has zero observations:
54
+
55
+ > The most recent session `c98f110` for this project has no recorded
56
+ > observations. Nothing to hand off. Want to start fresh from the current state?
@@ -1,21 +1,68 @@
1
1
  ---
2
2
  name: handoff
3
- description: Resume the most recent agent session for the current working directory. Use when the user says "where were we", "resume", "handoff", "pick up where I left off", or starts a session with no fresh context.
3
+ description: Resume the most recent agent session for the current working directory, leading with any unanswered question. Use when the user says "where were we", "resume", "handoff", "pick up where I left off", or starts a session with no fresh context.
4
4
  argument-hint: "[optional cwd override]"
5
5
  user-invocable: true
6
6
  ---
7
7
 
8
8
  The user wants to resume work. Optional cwd override: $ARGUMENTS
9
9
 
10
- Determine the current project path: if `$ARGUMENTS` is provided, resolve it to an absolute, normalized path (accept relative inputs, e.g. `path.resolve(process.cwd(), $ARGUMENTS)`); otherwise use the current working directory.
10
+ ## Quick start
11
11
 
12
- Call the `memory_sessions` MCP tool. From the result, pick the most recent session whose normalized `cwd` matches the project path with a directory-boundary check — equality OR `session.cwd.startsWith(projectPath + path.sep)` OR `projectPath.startsWith(session.cwd + path.sep)`. Do NOT use a raw string prefix match: it produces false positives across unrelated repos that share a path prefix (e.g. `/repo-a` vs `/repo-a-staging`). Prefer sessions with status `completed` over `abandoned`. If nothing matches, fall back to the single most recent session overall.
12
+ ```json
13
+ memory_sessions { "limit": 20 }
14
+ ```
13
15
 
14
- Once a session is selected:
15
- 1. If the session ended on an unanswered user-facing question, surface that question FIRST as the lead. Look for it in `summary` or in the last few observations (type `conversation` with `narrative` ending in `?`).
16
- 2. Then summarize the session: title/summary, key files touched, key decisions or errors. Use `memory_recall` with a query derived from the session's top concepts to fetch supporting observations, limit 10.
17
- 3. End with a short "next step?" pointer the user can act on.
16
+ Pick the most recent session whose `cwd` matches this project, then:
17
+ `memory_recall { "query": "<session top concepts>", "limit": 10 }`.
18
18
 
19
- If neither MCP tool is available, fall back to HTTP: `GET $AGENTMEMORY_URL/agentmemory/sessions` and `POST $AGENTMEMORY_URL/agentmemory/recall` with `Authorization: Bearer $AGENTMEMORY_SECRET` when set.
19
+ Expected output:
20
20
 
21
- Do not invent observations. If the most recent session has zero observations, say so and offer to start fresh.
21
+ ```text
22
+ Resuming 7f3a9c2 "Auth refresh rework".
23
+ Open question: should logout revoke all device tokens or just the current one?
24
+ Next step: decide revoke scope, then update auth/logout.ts.
25
+ ```
26
+
27
+ ## Why
28
+
29
+ Match the session by directory boundary, not raw prefix, so a sibling repo never
30
+ gets mistaken for this one. Never invent observations for an empty session.
31
+
32
+ ## Workflow
33
+
34
+ 1. Resolve the project path: if `$ARGUMENTS` is given, normalize it to absolute
35
+ (`path.resolve(process.cwd(), $ARGUMENTS)`); else use the cwd.
36
+ 2. Call `memory_sessions`. Pick the most recent session whose normalized `cwd`
37
+ matches by directory boundary: equality, OR `cwd.startsWith(projectPath + sep)`,
38
+ OR `projectPath.startsWith(cwd + sep)`. Prefer `completed` over `abandoned`.
39
+ No match: fall back to the single most recent session overall.
40
+ 3. If the session ended on an unanswered user-facing question, surface it FIRST.
41
+ Look in `summary` or recent `conversation` observations whose `narrative`
42
+ ends in `?`.
43
+ 4. Summarize: title/summary, key files, key decisions or errors, using
44
+ `memory_recall` on the top concepts, limit 10.
45
+ 5. End with one concrete "next step?" pointer.
46
+
47
+ ## Anti-patterns
48
+
49
+ WRONG: `session.cwd.startsWith(projectPath)` matches `/repo-a-staging` when the
50
+ project is `/repo-a`, resuming the wrong repo's session.
51
+
52
+ RIGHT: `session.cwd === projectPath || session.cwd.startsWith(projectPath + sep)`,
53
+ a directory-boundary check that cannot cross sibling repos.
54
+
55
+ ## Checklist
56
+
57
+ - cwd override resolved to an absolute, normalized path.
58
+ - Match used a directory-boundary check, not a raw prefix.
59
+ - Unanswered question (if any) leads the response.
60
+ - Empty session is reported plainly, with an offer to start fresh.
61
+
62
+ ## See also
63
+
64
+ - `recap`, `session-history`, `recall`: same session data, broader views.
65
+
66
+ ## Troubleshooting
67
+
68
+ See ../_shared/TROUBLESHOOTING.md if `memory_sessions` or `memory_recall` is not available.
@@ -0,0 +1,74 @@
1
+ # recall worked examples
2
+
3
+ ## 1. Hit on a past decision
4
+
5
+ User: "Did we ever decide how to cache sessions?"
6
+
7
+ Invocation:
8
+
9
+ ```json
10
+ memory_smart_search { "query": "session caching decision", "limit": 10 }
11
+ ```
12
+
13
+ Response:
14
+
15
+ ```json
16
+ {
17
+ "results": [
18
+ { "sessionId": "7f3a9c21", "type": "decision", "title": "Drop Redis for iii state store",
19
+ "narrative": "We decided to drop Redis and use the iii-engine state store for session caching.",
20
+ "importance": 8 }
21
+ ]
22
+ }
23
+ ```
24
+
25
+ Present:
26
+
27
+ > Yes. In session `7f3a9c21` you decided to drop Redis and use the iii-engine
28
+ > state store for session caching (importance 8).
29
+
30
+ ## 2. Multiple results across sessions
31
+
32
+ User: "Recall anything about the rate limiter."
33
+
34
+ Invocation:
35
+
36
+ ```json
37
+ memory_smart_search { "query": "rate limiter", "limit": 10 }
38
+ ```
39
+
40
+ Response:
41
+
42
+ ```json
43
+ {
44
+ "results": [
45
+ { "sessionId": "b21d004e", "type": "code", "title": "limit.ts counts per-IP",
46
+ "narrative": "Rate limiter counts per-IP, not per-user.", "importance": 6 },
47
+ { "sessionId": "c98f1100", "type": "conversation", "title": "Discussed sliding window",
48
+ "narrative": "Considered a sliding-window limiter, deferred.", "importance": 4 }
49
+ ]
50
+ }
51
+ ```
52
+
53
+ Present them grouped by session, leading with the per-IP code note.
54
+
55
+ ## 3. No results
56
+
57
+ User: "Recall the GraphQL schema migration."
58
+
59
+ Invocation:
60
+
61
+ ```json
62
+ memory_smart_search { "query": "graphql schema migration", "limit": 10 }
63
+ ```
64
+
65
+ Response:
66
+
67
+ ```json
68
+ { "results": [] }
69
+ ```
70
+
71
+ Present:
72
+
73
+ > No memories matched that. Try `schema change`, `graphql`, or `migration` as
74
+ > narrower terms, or `recap this week` to scan recent sessions.
@@ -1,21 +1,60 @@
1
1
  ---
2
2
  name: recall
3
- description: Search agentmemory for past observations, sessions, and learnings about a topic. Use when the user says "recall", "remember", "what did we do", or needs context from past sessions.
3
+ description: Search agentmemory for past observations, sessions, and learnings about a topic using hybrid BM25 plus vector plus graph search. Use when the user says "recall", "what did we do about", "did we ever", "have we seen", or needs context from past sessions.
4
4
  argument-hint: "[search query]"
5
5
  user-invocable: true
6
6
  ---
7
7
 
8
8
  The user wants to recall past context about: $ARGUMENTS
9
9
 
10
- Use the `memory_smart_search` MCP tool (provided by the agentmemory server that this plugin wires up automatically via `.mcp.json`) with the user's query as the `query` argument and `limit: 10`. The tool runs hybrid BM25 + vector + graph-expanded search over captured observations and returns ranked results.
10
+ ## Quick start
11
11
 
12
- Present the returned results to the user in a readable format:
13
- - Group by session
14
- - For each observation show its type, title, and narrative
15
- - Highlight the most important observations (importance >= 7)
16
- - If no results come back, suggest 2-3 alternative search terms the user could try
12
+ ```json
13
+ memory_smart_search { "query": "jwt refresh token rotation", "limit": 10 }
14
+ ```
17
15
 
18
- **Do NOT make up or hallucinate observations.** Only present what the MCP tool actually returned. If `memory_smart_search` isn't available, the stdio MCP shim didn't start — tell the user to:
19
- 1. Run `/plugin list` in Claude Code and confirm `agentmemory` shows as enabled.
20
- 2. Restart Claude Code (the plugin's `.mcp.json` is only read on startup).
21
- 3. Check `/mcp` to see whether the `agentmemory` MCP server is connected.
16
+ Expected output:
17
+
18
+ ```text
19
+ 2 results across 2 sessions.
20
+ [importance 8] decision · "Rotate refresh tokens on every use" (session 7f3a9c21)
21
+ [importance 5] code · "limit.ts counts per-IP" (session b21d004e)
22
+ ```
23
+
24
+ ## Why
25
+
26
+ Only surface what the tool returned. Never fabricate an observation, a session
27
+ id, or an importance score. If nothing comes back, say so.
28
+
29
+ ## Workflow
30
+
31
+ 1. Call `memory_smart_search` with the user's text as `query` and `limit: 10`.
32
+ Pass `project` when the user scopes to a specific repo.
33
+ 2. Group results by session.
34
+ 3. For each observation show its type, title, and narrative.
35
+ 4. Lead with the high-signal observations (importance >= 7).
36
+ 5. If zero results, suggest 2-3 alternative search terms and stop. Do not guess.
37
+
38
+ ## Anti-patterns
39
+
40
+ WRONG: results are empty, so you write "We probably discussed token expiry last
41
+ week" from assumption.
42
+
43
+ RIGHT: "No memories matched that query. Try `refresh token`, `session expiry`,
44
+ or `auth rotation`."
45
+
46
+ ## Checklist
47
+
48
+ - Every observation shown came from the tool response.
49
+ - Results grouped by session, high-importance first.
50
+ - Empty results trigger alternative-term suggestions, not invention.
51
+ - No session id or score was paraphrased or rounded.
52
+
53
+ ## See also
54
+
55
+ - `remember`: the write side; recall retrieves what it stores.
56
+ - `recap`, `handoff`, `session-history`: session-scoped views of the same data.
57
+
58
+ ## Troubleshooting
59
+
60
+ See ../_shared/TROUBLESHOOTING.md if `memory_smart_search` is not available.
@@ -0,0 +1,60 @@
1
+ # recap worked examples
2
+
3
+ ## 1. This week
4
+
5
+ User: "Recap this week."
6
+
7
+ Window: last 7 days. Invocation:
8
+
9
+ ```json
10
+ memory_sessions { "limit": 30 }
11
+ ```
12
+
13
+ Response (after filtering to cwd and the 7-day window):
14
+
15
+ ```json
16
+ {
17
+ "sessions": [
18
+ { "id": "7f3a9c21", "cwd": "/Users/dev/app", "title": "Auth refresh rework",
19
+ "startedAt": "2026-06-07T09:00:00Z", "observationCount": 14, "status": "completed",
20
+ "concepts": ["jwt-refresh-rotation", "auth-flow"] },
21
+ { "id": "b21d004e", "cwd": "/Users/dev/app", "title": "Rate limiter audit",
22
+ "startedAt": "2026-06-05T14:00:00Z", "observationCount": 9, "status": "completed",
23
+ "concepts": ["rate-limiter", "per-ip-bug"] }
24
+ ]
25
+ }
26
+ ```
27
+
28
+ Per session, pull highlights:
29
+
30
+ ```json
31
+ memory_recall { "query": "jwt-refresh-rotation auth-flow", "limit": 3 }
32
+ ```
33
+
34
+ Present:
35
+
36
+ > **2026-06-07**
37
+ > - `7f3a9c2` Auth refresh rework, 14 obs, completed
38
+ > - [8] Rotate refresh tokens on every use
39
+ >
40
+ > **2026-06-05**
41
+ > - `b21d004e` Rate limiter audit, 9 obs, completed
42
+ > - [7] limit.ts counts per-IP, not per-user
43
+ >
44
+ > 2 sessions across 2 days, 23 observations.
45
+
46
+ ## 2. Bare number
47
+
48
+ User: "recap 3"
49
+
50
+ Treat as `last 3`. Call `memory_sessions { "limit": 3 }`, group by date, same format.
51
+
52
+ ## 3. Empty window
53
+
54
+ User: "Recap today."
55
+
56
+ If `memory_sessions` returns no session whose `startedAt` is today and whose
57
+ `cwd` matches:
58
+
59
+ > No sessions today for this project. The most recent was yesterday, `7f3a9c2`
60
+ > Auth refresh rework. Want a recap of that instead?
@@ -1,25 +1,63 @@
1
1
  ---
2
2
  name: recap
3
- description: Summarize the last N agent sessions for the current project, grouped by date. Use when the user asks "recap", "what have we been doing", "this week", "today", or wants a rollup of recent work.
3
+ description: Summarize the last N agent sessions for the current project, grouped by date, with highlight observations per session. Use when the user asks "recap", "what have we been doing", "today", "this week", or wants a rollup of recent work.
4
4
  argument-hint: "[last N | today | this week]"
5
5
  user-invocable: true
6
6
  ---
7
7
 
8
8
  The user wants a recap. Time window args: $ARGUMENTS
9
9
 
10
- Parse `$ARGUMENTS` to determine the window:
11
- - `today` -> sessions started on the current local date
12
- - `this week` -> sessions started in the last 7 days
13
- - `last <n>` -> the most recent N sessions
14
- - bare numeric -> treat as `last <n>`
15
- - empty -> default to `last 10`
10
+ ## Quick start
16
11
 
17
- Call the `memory_sessions` MCP tool, then filter to the current project (match by `cwd` against the working directory). Apply the time window. Sort by `startedAt` descending.
12
+ ```json
13
+ memory_sessions { "limit": 30 }
14
+ ```
18
15
 
19
- Group the surviving sessions by their local calendar date (YYYY-MM-DD). For each date:
20
- - List each session: id (first 8 chars), title or first prompt, observation count, status
21
- - Indent two or three highlight observations per session (importance >= 7) drawn from `memory_recall` with a per-session query, limit 3
16
+ Then per surviving session: `memory_recall { "query": "<top concepts>", "limit": 3 }`.
22
17
 
23
- End with a one-line total: "N sessions across M days, K observations."
18
+ Expected output:
24
19
 
25
- If MCP tools are unavailable, fall back to HTTP: `GET $AGENTMEMORY_URL/agentmemory/sessions` and `POST $AGENTMEMORY_URL/agentmemory/recall` with `Authorization: Bearer $AGENTMEMORY_SECRET` when set. Do not invent sessions; if the window is empty, say so.
20
+ ```text
21
+ 2026-06-07
22
+ 7f3a9c2 · "Auth refresh rework" · 14 obs · completed
23
+ - [8] Rotate refresh tokens on every use
24
+ 3 sessions across 2 days, 41 observations.
25
+ ```
26
+
27
+ ## Why
28
+
29
+ Only summarize sessions and observations the tools returned. An empty window is
30
+ a real answer, not a prompt to invent activity.
31
+
32
+ ## Workflow
33
+
34
+ 1. Parse `$ARGUMENTS`: `today` = current local date; `this week` = last 7 days;
35
+ `last <n>` or bare numeric = most recent N; empty = `last 10`.
36
+ 2. Call `memory_sessions`, filter to the current project (match `cwd` against the
37
+ working directory), apply the window, sort by `startedAt` descending.
38
+ 3. Group survivors by local calendar date (YYYY-MM-DD).
39
+ 4. Per session list id (first 8), title or first prompt, observation count,
40
+ status. Indent 2-3 highlights (importance >= 7) from `memory_recall`.
41
+ 5. End with "N sessions across M days, K observations."
42
+
43
+ ## Anti-patterns
44
+
45
+ WRONG: window is empty, so you summarize "a productive week of auth work" from
46
+ memory of the conversation.
47
+
48
+ RIGHT: "No sessions in the last 7 days for this project."
49
+
50
+ ## Checklist
51
+
52
+ - Window parsed correctly from the argument.
53
+ - Sessions filtered to the current project's cwd.
54
+ - Highlights come from `memory_recall`, not paraphrase.
55
+ - Totals line reflects the actual counts shown.
56
+
57
+ ## See also
58
+
59
+ - `handoff`, `session-history`, `recall`: same session data, different lens.
60
+
61
+ ## Troubleshooting
62
+
63
+ See ../_shared/TROUBLESHOOTING.md if `memory_sessions` or `memory_recall` is not available.
@@ -0,0 +1,67 @@
1
+ # remember worked examples
2
+
3
+ ## 1. Saving a decision
4
+
5
+ User: "Remember that we decided to drop Redis and use the iii-engine state store for session caching."
6
+
7
+ Invocation:
8
+
9
+ ```json
10
+ memory_save {
11
+ "content": "We decided to drop Redis and use the iii-engine state store for session caching to remove a moving part.",
12
+ "concepts": "session-caching, iii-state-store, dropped-redis",
13
+ "files": ""
14
+ }
15
+ ```
16
+
17
+ Response:
18
+
19
+ ```json
20
+ { "id": "7f3a9c21", "concepts": ["session-caching", "iii-state-store", "dropped-redis"], "saved": true }
21
+ ```
22
+
23
+ Present:
24
+
25
+ > Saved. Tagged it `session-caching`, `iii-state-store`, `dropped-redis`, so a
26
+ > later recall on caching or Redis will surface this decision.
27
+
28
+ ## 2. Saving a code-specific gotcha
29
+
30
+ User: "Save this: the rate limiter in middleware/limit.ts counts per-IP, not per-user, so logged-in users on shared IPs collide."
31
+
32
+ Invocation:
33
+
34
+ ```json
35
+ memory_save {
36
+ "content": "The rate limiter in middleware/limit.ts counts per-IP, not per-user, so logged-in users on shared IPs collide.",
37
+ "concepts": "rate-limiter, per-ip-bug, shared-ip-collision",
38
+ "files": "src/middleware/limit.ts"
39
+ }
40
+ ```
41
+
42
+ Response:
43
+
44
+ ```json
45
+ { "id": "b21d004e", "concepts": ["rate-limiter", "per-ip-bug", "shared-ip-collision"], "saved": true }
46
+ ```
47
+
48
+ Present:
49
+
50
+ > Saved memory `b21d004e` referencing `src/middleware/limit.ts`. Concepts:
51
+ > `rate-limiter`, `per-ip-bug`, `shared-ip-collision`.
52
+
53
+ ## 3. Vague request, no files
54
+
55
+ User: "Remember this for later."
56
+
57
+ Ask once for the substance, then save:
58
+
59
+ ```json
60
+ memory_save {
61
+ "content": "Staging deploys must run the migration job before the app rollout, never after.",
62
+ "concepts": "staging-deploy, migration-ordering, rollout-sequence",
63
+ "files": ""
64
+ }
65
+ ```
66
+
67
+ Present the confirmation with the concepts echoed back.