feat(search): recency decay weighting + mempalace prune --stale-days CLI (#158) - #254
Merged
Conversation
…CLI (#158) Recency is an opt-in, recall-preserving ranking signal: a bounded exponential-decay distance shift on drawer age (mempalace.recency), gated off by default via PALACE_RECENCY_BOOST, half-life tunable via PALACE_RECENCY_HALFLIFE_DAYS. The shift can reorder neighbours but is capped so it never displaces a relevant drawer out of the result set. `mempalace prune --stale-days N` removes drawers older than N days from an optional wing/room scope. Dry-run by default; deletion requires --confirm. Drawers with no parseable filed_at are treated as ageless and are never pruned. Fully local — no network, no external API. Upstream tracks Weibull decay in MemPalace#1032 (informational). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add fork-changes.yaml entry; regenerate FORK_CHANGELOG, README, llms-full, and python-api docs. Bump README test count 3404 -> 3424. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Collaborator
Author
|
/gemini review |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
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 issue #158 — two derivative-store extensions that sit next to the verbatim record, neither of which mutates stored content.
1. Recency weighting in search (
mempalace/recency.py)search_memoriesapplies a small, bounded distance shift based on a drawer's age: exponential decay (half-life based), so a fresh drawer is nudged up and the boost fades to half after one half-life.filed_atis treated as ageless (zero adjustment), never penalized.PALACE_RECENCY_BOOST(default off,=1enables) so we A/B it on our own corpus before trusting it. Half-life tunable viaPALACE_RECENCY_HALFLIFE_DAYS. Read live, daemon picks up the toggle without a restart.2.
mempalace prune --stale-days NCLI--wing/--roomscope.--confirmis passed.where=can't range-compare the ISO-timestamp string), then deletion by explicit id list — same probe-then-delete shape aspurge.Upstream tracking
Upstream tracks Weibull decay + a Tier-0 LLM rerank in MemPalace/mempalace#1032 (informational). The fork-side contribution is the independent prune CLI and the off-by-default recency knob.
Local-first
Fully on-device: no network, no external API, no telemetry.
Tests
20 new tests in
tests/test_recency_prune.py(age parsing, recency adjustment math + recall preservation, searcher integration, prune CLI dry-run/confirm/undated/scope). README count 3404 → 3424.scripts/check-docs.shexits 0.🤖 Generated with Claude Code