Skip to content

feat(#769): Ebbinghaus forgetting curve — decay scoring surfaces recent knowledge first#775

Merged
magicpro97 merged 1 commit into
mainfrom
feat/i769-ebbinghaus-decay
May 31, 2026
Merged

feat(#769): Ebbinghaus forgetting curve — decay scoring surfaces recent knowledge first#775
magicpro97 merged 1 commit into
mainfrom
feat/i769-ebbinghaus-decay

Conversation

@magicpro97
Copy link
Copy Markdown
Owner

Summary

Implements #769: time-aware knowledge scoring using exponential decay.

Changes

  • migrate.py: New migration — last_accessed_at TEXT + access_count INTEGER on knowledge_entries
  • briefing.py: _decay_weight(last_accessed_at, half_life_days=90)exp(-ln2 * days/half_life); applied to entry scores; updates last_accessed_at when entries are surfaced
  • retro.py: _memory_health_section() — flags entries with decay < 0.3 as stale

Testing

  • python3 test_security.py: 13 passed ✅
  • python3 test_fixes.py: all passed ✅
  • ruff check: clean ✅

Closes #769

Copilot AI review requested due to automatic review settings May 31, 2026 03:36
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements issue #769 by adding access-based “forgetting curve” decay to knowledge entry scoring so recently surfaced knowledge ranks higher, plus a retro “memory health” report to flag stale entries.

Changes:

  • Adds DB schema support for access tracking on knowledge_entries (last_accessed_at, access_count) and an index for recency queries.
  • Applies exponential decay (exp(-ln(2) * days_since / half_life_days)) to briefing ranking and updates access tracking when entries are surfaced.
  • Adds a retro “memory health” section that highlights entries with low decay weight.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
migrate.py Adds migration v36 for access tracking columns and an index on last_accessed_at.
briefing.py Adds access-decay weighting into composite scoring and writes last_accessed_at/access_count for surfaced entries.
retro.py Adds decay helpers and a “memory health” section appended to the text retro output.

Comment thread briefing.py
Comment thread briefing.py
Comment thread retro.py
Comment thread retro.py
Comment thread retro.py
@magicpro97 magicpro97 force-pushed the feat/i769-ebbinghaus-decay branch 4 times, most recently from e10a460 to cfc1c62 Compare May 31, 2026 08:03
- migrate.py: add last_accessed_at + access_count columns to knowledge_entries
- briefing.py: _decay_weight() computes exp decay; scoring multiplied by decay weight
- briefing.py: update last_accessed_at when surfacing entries
- retro.py: _memory_health_section() shows entries with decay < 0.3 as stale
- Default half-life: 90 days; falls back gracefully if column missing
- sk learn --refresh <id> support noted in retro output

Closes #769

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@magicpro97 magicpro97 force-pushed the feat/i769-ebbinghaus-decay branch from cfc1c62 to b0a98fd Compare May 31, 2026 08:14
@magicpro97 magicpro97 merged commit 294a65f into main May 31, 2026
19 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Ebbinghaus forgetting curve on knowledge entries — decay score surfaces recent knowledge first

2 participants