Highlights
memory_search (and all retrieval paths) now expose the full contradiction chain on demand, and the consolidator automatically marks superseded memories when it detects high-confidence contradictions — no more manual cleanup of stale, contradicted knowledge.
Partial implementation of RFC #732. Read-side counterpart to #742 (write-side memory_update(versioned=True), still in flight).
Added
-
[#732]
include_supersededretrieval filter — opt in to see the full contradiction chain (PR #814)
All retrieval paths (memory_search,retrieve,retrieve_with_quality_boost,retrieve_hybrid) and all storage backends (sqlite_vec,cloudflare,hybrid,milvus,http_client) now accept aninclude_superseded: bool = Falseparameter. Default behavior is unchanged — superseded memories stay filtered out — but callers can passinclude_superseded=Trueto retrieve the complete contradiction chain. -
[#732] Auto-mark
superseded_byon high-confidence contradiction (PR #814)
The consolidator now automatically marks the older memory withsuperseded_bypointing to the newer one whenever acontradictsrelationship is detected with confidence ≥ 0.75. Executed in a single batched transaction via the newmark_superseded_batch()storage method (thread-safe via_conn_lock/_execute_with_retry). No DB migration needed — uses the existingsuperseded_bycolumn from migration 011. 5 new tests intests/storage/test_superseded_filter.py.
Compatibility
- Backward-compatible: default
include_superseded=Falsematches prior behavior. Existing clients see no change. - No DB migration: reuses the existing
superseded_bycolumn from migration 011. - Test count: ~1,785 tests (+5).
Special Thanks
Thanks to @filhocf for the implementation and the multi-iteration refinement against Gemini Code Assist's review feedback (encapsulation, batched transactions, async-safety, end-to-end propagation across all storage backends).
Full Changelog: v10.47.2...v10.48.0