Skip to content

Implement memory recency decay and access-based promotion #69

Description

@neooriginal

This issue is AI generated.

Problem

All stored memories are treated as equally relevant regardless of age, how recently they were accessed, or how often they are retrieved. A memory written 18 months ago and never referenced since surfaces with the same weight as one from last week that is retrieved every day. This means:

  • Stale or superseded facts continue to pollute context.
  • High-value recent memories are not prioritised over old noise.
  • The memory store grows without any pressure to evict or downrank redundant entries.

Competitors use activation/decay models (similar to human working memory) where recent accesses raise a memory's retrieval score and passage of time without access lowers it.

Required change

  • Add last_accessed_at and access_count columns to the memories table.
  • Update these fields each time a memory entry is included in a retrieval result.
  • Incorporate a recency + frequency score into the retrieval ranking alongside embedding similarity.
  • Optionally: after a configurable dormancy window (e.g. 90 days without access), mark entries as low-priority and consider them for compaction or removal.

Acceptance criteria

  • Memories accessed recently and frequently rank higher than identical-content older memories.
  • Memory access counts and timestamps are recorded accurately.
  • A memory that has not been accessed in the configured window is demoted or flagged for review.
  • Tests verify that recency signal changes retrieval ordering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    autonomousGenerated by AIenhancementNew feature or requestpriority: lowNice to have — refactoring, minor UX, or future featuresreliabilityReliability, resilience, or concurrency concern

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions