Memory Evolution — P1 + P2 + P3
This release introduces a complete Memory Evolution system: memories can now be updated without destroying history, grow stale over time with configurable decay, and automatically detect contradictions with each other.
Added
P1: Non-destructive Versioned Updates
update_memory_versioned()creates a child node from an existing memory via SAVEPOINT-atomic operation, marking the parent assuperseded_bythe new version- Schema migration
011_memory_evolution_p1.sqladdsparent_id,version,confidence,last_accessed, andsuperseded_bycolumns - Active memories filtered with
WHERE superseded_by IS NULL— superseded versions are invisible to normal retrieval but preserved for lineage queries
P2: Staleness Scoring with Time-Decayed Confidence
_effective_confidence(): computesconfidence × max(0, 1 − staleness × decay_rate)retrieve_with_staleness(): overfetch strategy (n_results × 3) with confidence filteringmin_confidenceparameter added to the baseretrieve()interface (all backends: SQLite-Vec, Cloudflare, Hybrid)- Configurable via
MEMORY_DECAY_WINDOW_DAYSenv var (default: 30 days)
P3: Automatic Conflict Detection and Resolution
- Conflict detection runs on every
memory_store()call — cosine similarity > 0.95 + Levenshtein divergence > 20% flags a contradiction - Contradictions linked as
contradictsgraph edges for easy querying - New MCP tools:
memory_conflicts(list unresolved contradictions),memory_resolve(supersede loser, boost winner confidence to 1.0) - New REST endpoints:
GET /api/conflicts,POST /api/conflicts/resolve - No new dependencies — uses stdlib
difflib.SequenceMatcher
30 new tests: 21 for P1/P2, 9 for P3 (1,514 tests total)
Fixed
- Storage interface consistency:
min_confidenceparameter added tobase.py,cloudflare.py, andhybrid.pyretrieve()signatures
Related Issues
- Closes #635 (Memory Evolution design doc)
- Closes #636 (Memory Evolution feature request)
- Related: #637 (sync-in-async tech debt, tracked separately)
Full changelog: https://github.com/doobidoo/mcp-memory-service/blob/main/CHANGELOG.md