Background memory consolidation tied to compaction, with 3.5k-char budget and prompt-injection safeguards
uriwa · reddit · 2026-11-22
Reddit user uriwa details the full architecture behind replacing explicit savememory tools with silent background consolidation:
- Separate storage: the static base prompt is never mutated; learned memory lives in its own bounded field (3.5k chars) injected seamlessly at runtime.
- Trigger on compaction, not every turn: when a settled segment compacts into a summary, a lightweight structured JSON pass (Flash-lite tier) receives the base prompt, existing learned memory, and the new summary—deciding whether durable facts changed, merging updates, pruning stale entries, and avoiding duplication.
- The agent never sees the mechanism: no memory tool in the schema, no prompt explanation.
- Two hard security boundaries: only shared-context agents dream (isolated customer-facing bots never do); dreaming runs only on verified 1:1 owner conversations so an untrusted stranger can't prompt-inject rules into persistent memory.
- Human transparency: the dashboard renders Learned Memory as its own editable, clearable block.
The author asks for pruning heuristics and character budgets that have held up over months.
More from coding & agent
- Dev shows ASC CLI maintained daily by Opus 5.5 in 'For Agents, By Agents' talk — rudrank · 2026-11-22
- Gemini subscriptions may work in third-party agent harnesses starting December 2 — testingcatalog · 2026-11-22
- Agno's AgentOS guide: build a team agent platform from zero to production — pritisinghhhh · 2026-11-22
- Agents shouldn't know they have memory: background 'dreaming' beats save_memory tools — uriwa · 2026-11-22
- Proactive Grok Bot setup: 28 of 34 weekly stops produce zero notifications — marcelmarais · 2026-11-22
- Anthropic engineer: 90% of staff built self-prompting agent systems around Opus — joemeno · 2026-11-22