feat(#769): Ebbinghaus forgetting curve — decay scoring surfaces recent knowledge first#775
Merged
Merged
Conversation
There was a problem hiding this comment.
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. |
e10a460 to
cfc1c62
Compare
- 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>
cfc1c62 to
b0a98fd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #769: time-aware knowledge scoring using exponential decay.
Changes
last_accessed_at TEXT+access_count INTEGERonknowledge_entries_decay_weight(last_accessed_at, half_life_days=90)—exp(-ln2 * days/half_life); applied to entry scores; updateslast_accessed_atwhen entries are surfaced_memory_health_section()— flags entries with decay < 0.3 as staleTesting
python3 test_security.py: 13 passed ✅python3 test_fixes.py: all passed ✅ruff check: clean ✅Closes #769