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
feat: inject fact-store memory into Codex and Cursor hook context (#229)
Implements the top-ranked design (A+B) from the agent-memory
interception audit, plus the proactive storage wording change (C):
- New hooks::memory_inject module: trust-filtered, char-budgeted,
secret-scanned digest rendering (session digests <= 2000 chars,
per-prompt recall <= 800 chars, one sanitized line per fact).
- Codex: SessionStart/SubagentStart inject a durable-project-memory
digest; UserPromptSubmit injects prompt-relevance-gated recall
(in-process FactRetriever search, lexical + score gate), deduped per
session via .tracedecay/memory_inject_seen.json.
- Cursor: sessionStart additional_context carries the same digest, and
an always-applied rules/tracedecay-memory.mdc is materialized from
the fact store (content-hash gated, regenerated on sessionStart /
workspaceOpen / post-install; embedded placeholder keeps the file
managed for uninstall).
- Recall runs through TraceDecay's own store at injection time; no
writes to host-native memory stores. Codex doctor now suggests
memories.use_memories=false (advisory only).
- Config gate: user_config memory_injection_enabled (default on) with
TRACEDECAY_MEMORY_INJECTION env override.
- Rule/skill text now instructs proactive fact storage with an explicit
do-NOT-capture list instead of "only when the user asks".
Co-authored-by: ScriptedAlchemy <zack@module-federation.io>
Copy file name to clipboardExpand all lines: codex-plugin/skills/recalling-project-memory/SKILL.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,11 +16,12 @@ Recall memory **before** reaching for external or web search — prior sessions
16
16
2.**Durable facts → `tracedecay_fact_store`** with `action: "search"` (or `"probe"` / `"reason"`), plus `query` and `min_trust`.
17
17
3.**If the user asks to inspect or repair memory health → `tracedecay_memory_status`** (repairs derived vectors/banks; returns fact/entity counts + trust distribution).
18
18
4.**If the user rates a recalled fact → `tracedecay_fact_feedback`** (`helpful` / `unhelpful`) to tune its trust score.
19
-
5.**Persist a new durable decision → `tracedecay_fact_store`**`action: "add"` (`content`, `category`, `tags`, `trust`) only when the user asks to remember it.
19
+
5.**Persist a new durable decision → `tracedecay_fact_store`**`action: "add"` (`content`, `category`, `tags`, `trust`) proactively whenever a durable decision, user preference, correction, or pitfall surfaces — do not wait for the user to ask. The add path already rejects secrets and reports near-duplicates/conflicts.
20
20
21
21
## Guardrails
22
22
23
-
-`tracedecay_message_search` and `fact_store` searches are read-only. `fact_store` adds, `fact_feedback`, and `memory_status` mutate memory state; use them only for explicit user requests or ratings.
23
+
-`tracedecay_message_search` and `fact_store` searches are read-only. `fact_feedback` and `memory_status` mutate memory state; use them for explicit user ratings or health checks.
24
+
- Do NOT capture: secrets/credentials, transient errors, environment-specific failures, one-off narratives, task progress, or soon-stale session outcomes — recover those from transcripts instead.
description: Durable project memory from the tracedecay fact store
3
+
alwaysApply: true
4
+
---
5
+
6
+
<!-- generated by tracedecay from the project fact store; do not edit by hand -->
7
+
8
+
# Project memory (tracedecay)
9
+
10
+
No durable facts stored yet. As decisions, preferences, and corrections surface, store them with `tracedecay_fact_store` (action "add") and they will appear here.
11
+
12
+
Curate via `tracedecay_fact_store` (update/remove), `tracedecay_fact_feedback`, or the tracedecay dashboard.
Copy file name to clipboardExpand all lines: cursor-plugin/rules/tracedecay.mdc
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ alwaysApply: true
11
11
- **Write:** before adding a new helper/util, run the `tracedecay:finding-duplicate-logic` pre-write probe — it may already exist.
12
12
- **Edit:** for anchored or structural source edits, follow the `tracedecay:atomic-code-edits` skill (`tracedecay_str_replace`, `tracedecay_replace_symbol`, `tracedecay_ast_grep_rewrite`, …) — the graph re-indexes itself after each write.
13
13
- **Recall:** for prior decisions or past conversations, use `tracedecay_message_search` / `tracedecay_fact_store` search (skills: `tracedecay:recalling-project-memory`, `tracedecay:recalling-session-context`); for updating, deleting, or curating stored facts, use `tracedecay:curating-project-memory`.
14
+
- **Memory:** when a durable decision, user preference, correction, or pitfall surfaces, store it proactively with `tracedecay_fact_store` (action "add") with calibrated trust — do not wait to be asked. Do NOT store secrets/credentials, transient errors, environment-specific failures, one-off narratives, or task progress.
14
15
- **Truncated MCP responses:** if a tracedecay response has `truncated: true` plus `handle`, narrow the query first when that answers the task; if the omitted details are needed, call `tracedecay_retrieve` with the `handle` instead of guessing or re-running a broad query.
15
16
- **MCP errors/timeouts:** if a tracedecay MCP call errors, times out, or the server is disconnected, every tool is also available as a shell command — `tracedecay tool <name> --key value` (`tracedecay tool` lists all tools, `tracedecay tool <name> --help` shows parameters; see `tracedecay:using-the-cli`). Do not query `.tracedecay` databases directly and do not abandon tracedecay because the MCP transport failed.
16
17
- Every common workflow has a `tracedecay:*` skill (searching-for-code, tracing-functions, finding-impacted-areas, running-impacted-tests, reviewing-a-diff, code-health-report, …) — reach for the matching skill before improvising.
Copy file name to clipboardExpand all lines: cursor-plugin/skills/recalling-project-memory/SKILL.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,11 +16,12 @@ Recall memory **before** reaching for external or web search — prior sessions
16
16
2.**Durable facts → `tracedecay_fact_store`** with `action: "search"` (or `"probe"` / `"reason"`), plus `query` and `min_trust`.
17
17
3.**If the user asks to inspect or repair memory health → `tracedecay_memory_status`** (repairs derived vectors/banks; returns fact/entity counts + trust distribution).
18
18
4.**If the user rates a recalled fact → `tracedecay_fact_feedback`** (`helpful` / `unhelpful`) to tune its trust score.
19
-
5.**Persist a new durable decision → `tracedecay_fact_store`**`action: "add"` (`content`, `category`, `tags`, `trust`) only when the user asks to remember it.
19
+
5.**Persist a new durable decision → `tracedecay_fact_store`**`action: "add"` (`content`, `category`, `tags`, `trust`) proactively whenever a durable decision, user preference, correction, or pitfall surfaces — do not wait for the user to ask. The add path already rejects secrets and reports near-duplicates/conflicts.
20
20
21
21
## Guardrails
22
22
23
-
-`tracedecay_message_search` and `fact_store` searches are read-only. `fact_store` adds, `fact_feedback`, and `memory_status` mutate memory state; use them only for explicit user requests or ratings.
23
+
-`tracedecay_message_search` and `fact_store` searches are read-only. `fact_feedback` and `memory_status` mutate memory state; use them for explicit user ratings or health checks.
24
+
- Do NOT capture: secrets/credentials, transient errors, environment-specific failures, one-off narratives, task progress, or soon-stale session outcomes — recover those from transcripts instead.
0 commit comments