Rolling Memory Graph — Design Spec

On this page:

Date: 2026-03-31

Status: Design complete, stress-tested, ready for MVP implementation

Thread: Discord 1488375373581516941 (design interview), 1488393140992999614 (stress test)

Problem Statement

The current memory infrastructure (Memory Catcher, Memory Lane, injection hooks) is entirely post-hoc — it extracts after sessions end and retrieves via flat semantic search. There's no live tracking of understanding within a session, no topology between memories, and no mechanism to tune resolution based on relevance.

Three specific pain points:

Design Decisions (12 from interview + stress test refinements)

1. Structure: Graph

Nodes (concepts/entities) + weighted edges (relationships between them). Graph provides machine-navigable topology while remaining renderable as human-readable narrative.

2. Updates: Heuristic-Gated Differential Probe

~~Each turn~~ Not every turn. A lightweight heuristic gate runs per turn. The full LLM probe only fires when the gate triggers.

Four heuristic triggers (any one fires the probe):

Dead man's switch: Force probe after 8 turns of silence.

Probe output: JSON patches — nodes added/strengthened/weakened, edges created/modified. Patch model, not snapshot.

Cost impact: ~10-15 probes per 60-turn session instead of 60. 60-80% cost reduction.

3. Node Schema (Minimal)

Nodes (5 fields):

Edges (3 fields):

4. Contradictions: Contradiction Edges

When a decision changes (e.g., "use Resend" -> "use Bento"), both nodes stay. A supersedes edge connects the new to the old. Retrieval layer prefers the newer one but can surface the old decision if asked. Preserves decision history.

5. Retrieval: Two Modes

Different thresholds prevent noise while maintaining useful proactive surfacing.

6. Lifecycle: Layered (Hot/Warm)

7. Reconciliation: Three Triggers (Event-Driven)

Not boundary-driven. Three specific triggers:

Crashed sessions: Post-session Memory Catcher hook does best-effort reconciliation from transcript.

Merge logic:

8. Decay: Distance-From-Focus with Time Floor

Model: new_weight = weight (1 - decay_rate distance_factor) * time_factor

Key property: Distance-from-focus sets the rate of decay. Recently activated nodes resist distance decay because their time factor hasn't eroded yet.

Anchor node floor: Nodes seeded from flat memories never decay below 0.2. They lose resolution but never disappear.

Why not pure activation decay: The whole point of building a graph is that structure matters. Distance-from-focus is the only decay model that actually uses the graph as a graph. Pure activation treats it as a list.

9. Context Injection: Layered LOD + Progressive Disclosure

Automatic Level-of-Detail (LOD) rendering:

Progressive disclosure escape hatch: LLM can request expansion of any compressed layer. Requesting expansion of a cluster is itself a signal to increase its weight.

Not progressive disclosure alone — system actively recalculates LOD every probe cycle based on where focus is. The LLM expansion request is the fallback, not the primary mechanism.

Token budget: ~500-800 tokens for layered injection vs. 2-3K for full graph dump.

10. Integration: Bidirectional with Flat Memory

Graph -> Flat (Graduation): Three criteria, ALL must be met:

When met, reconciliation flags for graduation. LLM drafts flat memory content. Human review required before promotion (one-way door).

Flat -> Graph (Seeding): Existing flat memories seed warm graph as pre-weighted anchor nodes with decay floor of 0.2. Corrections become high-weight anchors. Stale insights fade faster.

Reverse flagging: When anchor node drops below 0.2 despite floor for 6+ weeks, flag for archive review.

11. Nesting: Domain Only for MVP

MVP: Four domain subgraphs (relationship, project, technical, personal) with cross-domain edges. This directly solves cross-domain blindness (pain point #2).

v2 — Scope nesting: Turn -> conversation -> project -> system levels. Partially approximated by hot/warm lifecycle in MVP.

v3 — Temporal nesting: Today (high-res) -> this week (compressed) -> this month (landmarks). Partially approximated by decay function in MVP.

Rationale: Domain nesting is the only dimension not already approximated by other design decisions. Scope and temporal are refinements that make a working system better, not things that make it work.

12. Reconciliation Engine: Hybrid (LLM + Algorithm)

Validation Signals

Three metrics, self-reported (no dashboard needed):

MVP Scope (4 Components)

In MVP:

NOT in MVP:

MVP validates:

Existing Infrastructure (composes with)

Key Insight: Why Session State Vectors Failed

Session state vectors were the closest prior attempt. They died because they were:

The rolling graph avoids all of these failure modes by design.

Next Steps