Added an embedText projection for remember() so stored transcripts can remain readable while embeddings, FTS indexing, and embedding-model rebuilds use marker-free text. Updated coding-agent retention to pass the marker-free projection and strip retained protocol markers from recall display.
Fixes#4395
- Added an extractText override to pi-mnemopi remember paths so stored content and mined facts can use different text.
- Routed coding-agent mnemopi retention to store the full transcript while extracting only user-authored turns.
- Tightened deterministic Instruction extraction to require an explicit I/you subject.
Fixes#3372
prepareRetentionTranscript only skipped messages whose stripped content
trimmed to the empty string, so single-character assistant turns like
".", "...", or pure whitespace survived as
`[role: assistant]\n.\n[assistant:end]` blocks. Repeated across a
session (each tool-call-only or thinking-only turn produces one) these
polluted the Hindsight bank, wasted retain tokens, and degraded recall
relevance. extractMessages and flattenMessagesForRecall had the same
gap, only checking length/trim truthiness.
Add hasSubstantiveContent in hindsight/content.ts (a single
\p{L}/\p{N} test) and apply it from all three call sites so retain,
recall, and pre-compaction inputs require at least one letter or digit
per message. Single-char real replies ("y", "4", "ok") still pass.
Fixes#1806
- Added mental-model settings and config defaults for enablement, auto-seed, refresh interval, and render budget.
- Added built-in mental-model seeds and scope-aware rendering with `<mental_models>` extraction, truncation, and tag handling.
- Added `/memory mm` aliases and handlers for list, show, refresh, history, seed, reload, and delete commands.
- Added client APIs and bootstrap/cache wiring so snippets refresh and inject into prompts on startup.
- Added tests covering seed scope behavior, rendering caps, diffs, and backend/session reload behavior.
- Added `hindsight.scoping` and `HINDSIGHT_SCOPING` with global, per-project, and per-project-tagged modes.
- Migrated legacy `raw.hindsight` handling to scoping-based behavior and removed deprecated `dynamicBankId`/`agentName` keys.
- Replaced `deriveBankId` with `computeBankScope`, returning `bankId` plus optional retain/recall tags by mode.
- Forwarded scoped tags through memory ops so recall and retain/reflect calls use `tags`, `tagsMatch`, and `recallTags`.
- Validated `scoping` values from env/settings, warning and defaulting to `per-project-tagged` when invalid.
- Standardized Hindsight context output to emit `<memories>` blocks and updated retention stripping to remove both `<memories>` and legacy `<hindsight_memories>`/`<relevant_memories>` tags.
- Renamed built-in Hindsight tool entry points and labels from `hindsight_retain`/`hindsight_recall`/`hindsight_reflect` to `retain`, `recall`, and `reflect`, including tool availability checks.
- Added a new optional `beforeAgentStartPrompt` hook to `MemoryBackend` and implemented it in the Hindsight backend to recall long-term context for the first turn.
- Updated `AgentSession` startup flow to inject the recalled context into the turn-specific system prompt before the first response is generated.
- Preserved `<hindsight_memories>` tags in Hindsight developer instructions and added tests for first-turn injection and state caching.
- Added `memory.backend` and `hindsight.*` settings schema with migration from `memories.enabled` legacy mode.
- Added Hindsight memory backend runtime modules for resolved config, client creation, bank ID derivation, and state lifecycle.
- Added off/local/hindsight backends and resolver wiring across SDK, commands, and compaction context.
- Added `hindsight_recall`, `hindsight_reflect`, and `hindsight_retain` tools with schema validation and backend gating.
- Added Memory tab metadata and symbols to expose backend selection in the settings UI.
- Added package export barrels and tests for bank ID, content formatting, and hindsight config env precedence.