Repository navigation
Improve memory storage — needs proper scoping/grooming before implementation #136
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
area:sessionThe engine — turns, tasks, the toolbelt, checkpointsThe engine — turns, tasks, the toolbelt, checkpointsfeatureWork that adds a capability; developers break it into tasksWork that adds a capability; developers break it into tasksneeds a rulingAn owner decision comes before any code — do not startAn owner decision comes before any code — do not startsev:papercutA wording, a hint, a small wrongness that costs a momentA wording, a hint, a small wrongness that costs a moment
Milestone
Description
What this is
A scoping/grooming ticket, not an implementation ticket. Memory storage has accreted — store, reflex, consolidation, snapshot, TUI surface — and nobody has groomed it as one feature. Before any code changes, this issue needs to be scoped: what memory storage is supposed to be, what is in and out, and which of the known gaps below are real problems vs. acceptable tradeoffs.
Do not start implementing from this issue. The first deliverable is a groomed scope written back here (or in a linked doc), broken into engineering tasks.
Current shape (what exists today)
internal/store/memory.go(~1.2k lines) — event-sourced SQLite brain:memoriestable +memories_fts, five event kinds (add/update/supersede/forget/restore), five memory types (fact/preference/decision/correction/project_state), three scopes (user/project/env), tombstones instead of deletes, ranking counters (use_count/miss_count) journaled as periodic snapshots.internal/store/memory_snapshot.go— census/snapshot reads.internal/reflex/— the per-turn router: shortlist of 8 candidates via RRF (lexical bm25 + importance + recency), model rejects rather than searches; post-turn extractor + decider (add/refine/replace/skip).internal/session/memory.go(~1.1k lines) — the four-moment arrangement (pre-turn block, post-turn extraction, consolidation gate,rememberverb), fails-open on every reflex error.internal/session/memory_consolidate.go(~680 lines) — idle "dreaming" pass over the 50 most recently touched lines; merges duplicates, retires superseded lines, never deletes, never decays by age.internal/tui3/memory.go+memoryplace.go— the/memories,/memory <query>,/remember,/forgetsurface.
Known gaps / open questions to groom
- Scope semantics are thin.
user/project/envexist as a column and a filter, but nothing governs which scope a write lands in, whether project-scoped memories follow a repo across machines, or how env-scoped truth is validated. Is scope a real blast-radius boundary or just a label? - Consolidation coverage. The dreaming pass touches only the 50 most recently touched lines. What happens to lines 51+? No answer on whether that cap is principled or accidental.
- Ranking counters have no lifecycle.
use_count/miss_countgrow forever; snapshots preserve them across rebuilds but nothing ages or normalizes them. Is that fine, or does importance need a horizon? - No cross-machine story. The store is one SQLite file per machine. Sync, merge, and conflict resolution across machines are unaddressed.
- Text cap is 512 runes. One line of substance per memory. Is that the right unit, or do we need longer structured entries (e.g. typed claims with evidence, per LatticeMind-style conflict-aware memory)?
- Retrieval is lexical-only. bm25 + recency + use counters; no embeddings, no semantic recall. Decide whether that's a gap or a deliberate bound.
- Provenance is partial.
source_session/source_seqexist but old rows carry unknown provenance; no story for auditing what a memory was before it was replaced beyondMemoryRecord.
Acceptance for the grooming itself
- A written scope: in/out list, prioritized gaps, and at least one measurable acceptance criterion per in-scope item.
- Gaps ruled out are ruled out with a reason, not silently dropped.
- Follow-up engineering tasks filed (or one umbrella task) with owners.
/assign @santoshkumarradha
Drafted with CodeAF · reviewed and owned by the author
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:sessionThe engine — turns, tasks, the toolbelt, checkpointsThe engine — turns, tasks, the toolbelt, checkpointsfeatureWork that adds a capability; developers break it into tasksWork that adds a capability; developers break it into tasksneeds a rulingAn owner decision comes before any code — do not startAn owner decision comes before any code — do not startsev:papercutA wording, a hint, a small wrongness that costs a momentA wording, a hint, a small wrongness that costs a moment
Activity
AbirAbbas commentedon Sep 16, 2026
Closing as not planned. This was a grooming ticket with no concrete defect, and memory has moved on since it was filed: consolidation of the newest rows ships in
internal/session/memory_consolidate.go, and supersession notices are pinned (#952). If a specific gap shows up, file it as a defect with a replication; a scoping ticket cannot be closed by a pull request.