You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**topic_key**: optional canonical topic id (e.g. `architecture/auth-model`) used to upsert evolving memories
608
+
-**capture_prompt**: optional boolean, default `true`; when current prompt context is available for the same project/session, Engram records it alongside the observation. Automated pipeline saves such as SDD artifacts should pass `false`.
608
609
-**content**: Structured with `**What**`, `**Why**`, `**Where**`, `**Learned**`
609
610
610
611
Exact duplicate saves are deduplicated in a rolling time window using a normalized content hash + project + scope + type + title.
@@ -625,6 +626,7 @@ Delete an observation by ID. Uses soft-delete by default (`deleted_at`); optiona
625
626
### mem_save_prompt
626
627
627
628
Save user prompts — records what the user asked so future sessions have context about user goals.
629
+
When called in the same MCP process, this also feeds the current prompt context used by later `mem_save` calls with `capture_prompt=true`.
Copy file name to clipboardExpand all lines: docs/ARCHITECTURE.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ Next session starts → Previous session context is injected automatically
53
53
54
54
| Tool | Purpose |
55
55
|------|---------|
56
-
|`mem_save`| Save a structured observation (decision, bugfix, pattern, etc.) |
56
+
|`mem_save`| Save a structured observation (decision, bugfix, pattern, etc.); automatically captures the current prompt when one is available unless `capture_prompt=false`|
57
57
|`mem_update`| Update an existing observation by ID |
58
58
|`mem_delete`| Delete an observation (soft-delete by default, hard-delete optional) |
59
59
|`mem_suggest_topic_key`| Suggest a stable `topic_key` for evolving topics before saving |
-`mem_save` now supports `scope` (`project` default, `personal` optional)
90
90
-`mem_save` also supports `topic_key`; with a topic key, saves become upserts (same project+scope+topic updates the existing memory)
91
+
-`mem_save` supports `capture_prompt` (`true` by default). When the MCP process has current prompt context for the same project and session, it records that prompt alongside the observation. Automated saves such as SDD artifacts should pass `capture_prompt=false`.
91
92
- Exact dedupe prevents repeated inserts in a rolling window (hash + project + scope + type + title)
92
93
- Duplicates update metadata (`duplicate_count`, `last_seen_at`, `updated_at`) instead of creating new rows
93
94
- Topic upserts increment `revision_count` so evolving decisions stay in one memory
Copy file name to clipboardExpand all lines: docs/PLUGINS.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -256,6 +256,12 @@ When `mem_save` detects candidates, the JSON response includes:
256
256
257
257
Old clients that read only the `result` string continue to work — these fields are additive.
258
258
259
+
### mem_save prompt capture
260
+
261
+
`mem_save` accepts `capture_prompt` as an optional boolean. The default is `true`: if the MCP process already has the current user prompt for the same project and session, Engram stores it in `user_prompts` using exact project + session + content dedupe. Passing `capture_prompt=false` skips that prompt capture path and is intended for automated artifacts such as SDD progress saves.
262
+
263
+
If no current prompt is available to the MCP process, `mem_save` still succeeds and no prompt is invented from the observation content. Plugins/protocol hooks that can observe user prompts must feed that prompt context before relying on automatic capture. Calling `mem_save_prompt` in the same MCP process records the prompt and makes it available to later `mem_save` calls for the same project/session.
Copy file name to clipboardExpand all lines: internal/mcp/mcp.go
+22-2Lines changed: 22 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -335,6 +335,9 @@ Examples:
335
335
mcp.WithString("project_choice_reason",
336
336
mcp.Description("Must be user_selected_after_ambiguous_project, and only after the user explicitly chose one of available_projects from an ambiguous_project error."),
337
337
),
338
+
mcp.WithBoolean("capture_prompt",
339
+
mcp.Description("Automatically capture the current user prompt when available (default: true). Set false for SDD artifacts or automated saves."),
mcp.Description("Must be user_selected_after_ambiguous_project, and only after the user explicitly chose one of available_projects from an ambiguous_project error."),
0 commit comments