Skip to content

Memory ranking: access-driven decay never lets popular-but-stale entries age out #311

Closed

Description

@currentbits

Code audit finding: rank_decay anchors on last_accessed_at (src/memory.js:161-164), so every time an entry is served its decay resets — old-but-popular entries live forever, and there is no validity interval or as-of semantics for facts that change. Meanwhile the janitor independently decays access_count x0.98 per 6h pass (src/janitor.js:117-124), a second uncoordinated decay mechanism whose boot re-run would double-decay (index.js:564 comment).

Research guidance: prefer a step-function model (flat until contradicted/stale-flagged) over continuous decay for fact memory, and small multiplicative recency boosts (plus/minus 10%) instead of recency as a decay anchor. Concrete fixes: anchor decay on created/updated time, not access; unify the two decay mechanisms into one; give entries an optional stale-after horizon that feeds the drift-detection issue (#300).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugplan:doing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions