feat(recall): decision-store curation — importance filter + supersession - #18
Open
jessekemp1 wants to merge 2 commits into
Open
feat(recall): decision-store curation — importance filter + supersession#18jessekemp1 wants to merge 2 commits into
jessekemp1 wants to merge 2 commits into
Conversation
Research (dec_824f8f0f2bd4) found a decision store that only grows recalls worse; curation, not capacity, separates useful memory from noise. Cortex was appending every decision unconditionally and indexing every line. Write path (mcp_handlers.record_learning_decision): - score each decision 1-10 (intelligence/memory/importance.py, pure heuristic, no model call); annotate importance + low_signal — never drop, spool path and never-lose-a-decision guarantee intact. - optional supersedes=<dec_id>: append-only tombstone stamps superseded_by on the old id; original line never mutated. Threaded through cortex_record_decision (MCP) + POST /decisions/learning. Read path (hybrid_retriever): - drop superseded decisions and tombstones from recall. - multiply RRF score by importance x recency-decay (exp(-age/HALF_LIFE), default 120d), applied beside the existing outcome boosts. Un-scored legacy entries get a neutral default, so history is unaffected until backfilled. Backfill: memory_maintenance.py --backfill-importance (idempotent, .bak + atomic rewrite, skips tombstones/scored). Tests: importance (7), supersession (3), retriever curation (3), write annotation (3). Full suite 1716 pass; the 3 failures are the pre-existing test_doctor_json_reset trio (unrelated). End-to-end: superseded dropped, high-signal outranks noise ~1.9x.
…empty Fill similar_work from hybrid-retrieved related_patterns when the knowledge graph has no similar_work entries — decisions live in the retriever, not the graph.
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.
What
Curation for the decision store so recall favors signal over accumulation. Research (STORM-Opus + /deep-research, cortex dec_824f8f0f2bd4) independently concluded that a decision store which only grows recalls worse — curation, not capacity, separates useful memory from noise. Cortex was appending every decision unconditionally and indexing every line; this addresses the recall-precision limitation called out in the v1.2.0-beta.1 release notes.
Changes
Write path (
mcp_handlers.record_learning_decision)intelligence/memory/importance.py, no model call); annotateimportance+low_signal. Never drops — spool path and never-lose-a-decision guarantee intact.supersedes=<dec_id>: append-only tombstone stampssuperseded_byon the old id; original line never mutated (RDF-triple pattern). Threaded through the MCP tool +POST /decisions/learning.Read path (
hybrid_retriever)exp(-age/HALF_LIFE), default 120d), applied beside the existing outcome boosts. Un-scored legacy entries get a neutral default, so history is unaffected until backfilled.similar_workwhen the knowledge graph has no lessons/patterns for the project (_fill_similar_work_from_related) — fixessimilar_workreporting empty despite relevant prior work existing.Backfill —
scripts/memory_maintenance.py --backfill-importance(idempotent,.bak+ atomic rewrite, skips tombstones/scored).Tests
New: importance (7), supersession (3), retriever curation (3), write annotation (3), similar_work promotion. Full suite 1716 pass; the 3 failures are the pre-existing
test_doctor_json_resettrio (unrelated, fail on clean main).Verified live
Backfilled the live store (291 scored, 24 low_signal).
cortex_intelligence(project="clio")now returns ranked real decisions with a populatedsimilar_work— previously empty / confidence 0.0. Superseded decisions drop from recall; high-signal outranks low-signal ~1.9×.This pull request and its description were written by Isaac.