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
`mem_save`, `mem_save_prompt`, `mem_session_start`, `mem_session_end`, `mem_session_summary`, `mem_capture_passive`, `mem_update` — project is auto-detected from cwd. Any `project` argument the LLM sends is silently discarded.
552
+
`mem_session_start`, `mem_session_end`, `mem_session_summary`, `mem_capture_passive`, and `mem_update` auto-detect project from cwd. Any `project` argument the LLM sends is ignored.
553
+
554
+
`mem_save` and `mem_save_prompt` also auto-detect project from cwd by default, but they accept one narrow recovery override: after a previous `ambiguous_project` error, the agent may retry with `project=<one of available_projects>` and `project_choice_reason=user_selected_after_ambiguous_project`. Without that exact reason, LLM-supplied `project` is ignored so routine writes cannot drift across project names.
553
555
554
556
### Read tools (optional project override)
555
557
@@ -605,7 +607,7 @@ Save structured observations. The tool description teaches agents the format:
-**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`.
610
+
-**capture_prompt**: optional boolean, default `true`; when current prompt context is available in the same MCP process for the same project/session, Engram best-effort records it alongside the observation. If that process-local context is unavailable or prompt capture fails, `mem_save` still succeeds. Automated pipeline saves such as SDD artifacts should pass `false`.
609
611
-**content**: Structured with `**What**`, `**Why**`, `**Where**`, `**Learned**`
610
612
611
613
Exact duplicate saves are deduplicated in a rolling time window using a normalized content hash + project + scope + type + title.
@@ -626,7 +628,7 @@ Delete an observation by ID. Uses soft-delete by default (`deleted_at`); optiona
626
628
### mem_save_prompt
627
629
628
630
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`.
631
+
When called in the same MCP process, this also feeds process-local current prompt context used by later `mem_save` calls with `capture_prompt=true`. The same MCP process lifecycle must receive the prompt context before the later save; prompt capture is best-effort and `mem_save` still succeeds when no context is available.
630
632
631
633
### mem_context
632
634
@@ -909,9 +911,11 @@ Instead of a separate LLM service, the agent itself compresses observations. The
Engram does not record a firehose of raw tool calls. Raw tool calls (`edit: {file: "foo.go"}`, `bash: {command: "go build"}`) are noisy and pollute FTS5 search. The agent's curated summaries are higher signal, more searchable, and don't bloat the database. Shell history and git provide the raw audit trail.
913
917
914
-
All memory comes from the agent itself — no firehose of raw tool calls. Why? Raw tool calls (`edit: {file: "foo.go"}`, `bash: {command: "go build"}`) are noisy and pollute FTS5 search. The agent's curated summaries are higher signal, more searchable, and don't bloat the database. Shell history and git provide the raw audit trail.
918
+
Since v1.15.3, `mem_save` can also best-effort attach the current user prompt when prompt context was already provided to the same MCP process for the same project/session (typically by `mem_save_prompt`) and `capture_prompt` is not disabled. That is not raw event capture: it stores user intent tied to a curated save, and the save still succeeds if prompt context is missing.
915
919
916
920
---
917
921
@@ -988,7 +992,7 @@ WantedBy=default.target
988
992
4.**Agent-driven compression** — The agent already has an LLM. No separate compression service.
989
993
5.**Privacy at two layers** — Strip in plugin AND store. Defense in depth.
990
994
6.**Pure Go SQLite (modernc.org/sqlite)** — No CGO means true cross-platform binary distribution.
991
-
7.**No raw auto-capture** — The agent saves curated summaries. Shell history and git provide the raw audit trail.
995
+
7.**No raw tool-call auto-capture** — The agent saves curated summaries; `mem_save` may best-effort capture process-local prompt context tied to that save, but Engram does not ingest raw tool-call firehoses. Shell history and git provide the raw audit trail.
992
996
8.**TUI with Bubbletea** — Interactive terminal UI following Gentleman Bubbletea patterns.
Copy file name to clipboardExpand all lines: docs/ARCHITECTURE.md
+2-2Lines changed: 2 additions & 2 deletions
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.); automatically captures the current prompt when one is available unless `capture_prompt=false`|
56
+
|`mem_save`| Save a structured observation (decision, bugfix, pattern, etc.); best-effort captures process-local current prompt context when 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
+
-`mem_save` supports `capture_prompt` (`true` by default). When the same MCP process lifecycle has current prompt context for the same project and session, it best-effort records that prompt alongside the observation. The prompt context must be fed before the later `mem_save` (typically via `mem_save_prompt`); `mem_save` still succeeds if context is unavailable or prompt capture fails. Automated saves such as SDD artifacts should pass `capture_prompt=false`.
92
92
- Exact dedupe prevents repeated inserts in a rolling window (hash + project + scope + type + title)
93
93
- Duplicates update metadata (`duplicate_count`, `last_seen_at`, `updated_at`) instead of creating new rows
94
94
- Topic upserts increment `revision_count` so evolving decisions stay in one memory
Copy file name to clipboardExpand all lines: docs/PLUGINS.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ The plugin:
39
39
-**Strips `<private>` tags** before sending data
40
40
-**Enables**`opencode-subagent-statusline` in `tui.json` or `tui.jsonc` during `engram setup opencode`, adding a live sub-agent monitor to OpenCode's sidebar/home footer. To disable it later, remove `"opencode-subagent-statusline"` from the `"plugin"` array in your TUI config and restart OpenCode.
41
41
42
-
**No raw tool call recording** — the agent handles all memory via `mem_save` and `mem_session_summary`.
42
+
**No raw tool call recording** — the agent handles memory through curated saves such as `mem_save` and `mem_session_summary`. `mem_save` may best-effort attach prompt context, but only when that prompt was already fed to the same MCP process lifecycle.
43
43
44
44
### Memory Protocol (injected via system prompt)
45
45
@@ -258,9 +258,9 @@ Old clients that read only the `result` string continue to work — these fields
258
258
259
259
### mem_save prompt capture
260
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.
261
+
`mem_save` accepts `capture_prompt` as an optional boolean. The default is `true`: if the same MCP process lifecycle already has the current user prompt for the same project and session, Engram best-effort 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
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.
263
+
If no current prompt is available to the MCP process, or if best-effort prompt capture fails, `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; a different MCP process lifecycle does not inherit that in-memory prompt context.
0 commit comments