Memory & Search
Memory & Search
A searchable Memory surface plus a real, reviewable facts store — nothing activates without an explicit confirm.
Situation
The classifier types a turn as recall, searchCorpus runs, and a ## Recall block is injected — but there's no direct search, no browsable history, and no facts store; "what Mallory knows" today is just the FTS corpus. Phase 2 adds a first-class Memory surface: search/browse past conversations and vault notes directly, and a real facts memory Mallory applies in conversation.
Capture is deliberately conservative: explicit ("remember that …", instant) plus reviewed-auto (extraction proposes facts; nothing activates without a one-tap confirm) — no silent writes, ever.
Key decisions
Search surface and facts store, one spec
Designed together but built as two independently-shippable layers.
Capture: explicit + reviewed-auto
"Remember that X" writes instantly; a periodic extraction cron proposes candidate facts that require a one-tap confirm before they ever activate.
Storage: D1 canonical + vault backup
D1 is the fast, app-managed source of truth; a periodic Hub job exports active facts to a human-readable Memory/about-alex.md — one-way, edge to vault.
Usage: pinned core + retrieval
A small always-on ## About Alex block carries pinned facts on every turn; the rest join the normal FTS retrieval path and surface only when relevant.
Forget is real
A per-fact forget soft-deletes (forgotten_at) and drops from search/pinned/vault-export; a clear-all hard-deletes everything.
Architecture
Reuses the existing FTS engine and recall path; adds one new table and one new web surface.
proposed/active, explicit/extracted, pinned, soft-delete) mirroring the messages_fts contentless pattern.k for the web view; the in-turn recall path keeps its own smaller k.POST /memory for explicit writes; a Worker extraction cron over recent conversations proposing deduped candidate facts via a cheap model.selectPinnedCore(facts, cap=10) — a pure, capped, always-on ## About Alex block injected into chat.ts's context assembly.GET /memory/export (Access-gated) feeds a periodic cron job that writes the grouped, human-readable vault note.Risks & guardrails
One-way vault export
Obsidian edits to the exported note aren't re-imported this phase — noted explicitly as a future option, not solved now.
Extraction cron cost/quality
Proposals depend on a cheap model over recent conversations; dedup against existing active/proposed facts must hold or the review queue floods.
No cross-device read-state
The review queue's read/seen state isn't synced across devices in this phase.
Delivery
Layer 1 — Search surface
GET /search (reuse searchCorpusWith) + MemoryView search/browse/jump. Ships first, mostly assembly.
Layer 2 — Facts store
Migration (memories + FTS), POST/GET /memory, explicit-capture intent, extraction cron, pinned-core injection, facts/review UI, Hub vault-backup export.
Out of scope
docs/superpowers/specs/2026-06-20-memory-and-search-design.mdplan ·
docs/superpowers/plans/2026-06-20-memory-and-search.md