fix(consolidation): reduce decay rate, add importance floor, filter archived memories (#78)#105
Merged
jack-arturo merged 3 commits intomainfrom Mar 2, 2026
Merged
fix(consolidation): reduce decay rate, add importance floor, filter archived memories (#78)#105jack-arturo merged 3 commits intomainfrom
jack-arturo merged 3 commits intomainfrom
Conversation
…rchived from all search paths (#78) The original decay formula (base_decay_rate=0.1) destroyed 84% of memories within 30 days regardless of importance. This commit: - Reduces base_decay_rate from 0.1 to 0.01 (configurable via env var), changing the half-life from ~7 to ~69 days - Adds importance-based floor: relevance = max(calculated, importance * 0.3), so a memory with importance 0.8 never decays below 0.24 - Filters archived memories from keyword search (was only filtered in trending) - Filters archived memories from vector search (Qdrant post-filter + payload sync) - Syncs archived flag to Qdrant payload when consolidation archives a memory - Adds audit_relevance.py and rescore_relevance.py scripts for production data rehabilitation - Keeps delete/archive thresholds at 0 (disabled) — will be enabled after production rescore New env vars: CONSOLIDATION_BASE_DECAY_RATE, CONSOLIDATION_IMPORTANCE_FLOOR_FACTOR Refs #78 Made-with: Cursor
locomo-mini: 76.97% (+0.0) — no regression on fresh data. Full locomo pending. Made-with: Cursor
…n variance) Made-with: Cursor
Contributor
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... 📒 Files selected for processing (12)
✏️ Tip: You can disable in-progress messages and the fortune message in your review settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
This was referenced Mar 2, 2026
jack-arturo
added a commit
that referenced
this pull request
Mar 7, 2026
🤖 I have created a release *beep* *boop* --- ## [0.14.0](v0.13.0...v0.14.0) (2026-03-07) ### Features * **config:** add QDRANT_HOST + QDRANT_PORT as alternative to QDRANT_URL ([#112](#112)) ([0871904](0871904)) * **docker:** Add Docker build workflow ([#98](#98)) ([39bf6e7](39bf6e7)) ### Bug Fixes * **benchmarks:** handle possessive speaker names in LoCoMo ([#116](#116)) ([abcbcca](abcbcca)) * **consolidation:** reduce decay rate, add importance floor, filter archived memories ([#78](#78)) ([#105](#105)) ([3fce4ce](3fce4ce)) * handle smart apostrophes in recall entity extraction ([#115](#115)) ([05b4daa](05b4daa)) * harden MCP bridge resilience, adopt stateless transport, and update cross-client docs ([#114](#114)) ([ec88da6](ec88da6)) * **qdrant:** prevent silent vector dimension mismatch, set Voyage as recommended default ([#108](#108)) ([5f88105](5f88105)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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
Fixes the overly aggressive memory decay formula that destroyed 84% of production memories within 30 days, regardless of importance.
The problem:
base_decay_rate=0.1(exponential) meant a 30-day memory hadexp(-3) = 0.05relevance, and a 90-day memory hadexp(-9) = 0.0001. Production audit showed:The fix:
0.1 → 0.01(configurable viaCONSOLIDATION_BASE_DECAY_RATE), changing the half-life from ~7 to ~69 daysrelevance = max(calculated, importance * 0.3)— a memory with importance 0.8 can never decay below 0.24. Configurable viaCONSOLIDATION_IMPORTANCE_FLOOR_FACTORcoalesce(m.archived, false) = falseto keyword search (was only filtered in trending). Added post-filter for Qdrant vector search. Consolidated archived flag syncs to Qdrant payload.scripts/audit_relevance.py(read-only damage assessment) andscripts/rescore_relevance.py(one-time recalculation with--dry-runand--target railwayoptions)Deployment safety: Delete/archive thresholds remain at
0.0(disabled). After merge and deploy:rescore_relevance.py --target railway --dry-runto previewrescore_relevance.py --target railwayto rehabilitate (avg score: 0.049 → 0.376)Benchmark Results
No regression — expected since benchmark snapshots use fresh data unaffected by production decay.
Test plan
make test— 110 passed, 11 skipped)Closes #78
Made with Cursor