What's Changed
Six targeted bug fixes across consolidation, embedding cache, and memory type handling.
Fixed
- [#603] Fix invalid memory_type "learning_note" in learning_session prompt: The
create_learning_sessionprompt handler was emittingmemory_type: "learning_note", which is not a valid type in the memory schema. Changed to"learning"so sessions are correctly classified and retrievable by type filter. - [#604] Remove memory.touch() call from update_memory_relevance_metadata:
update_memory_relevance_metadatawas callingmemory.touch()as a side-effect, silently overwritingupdated_aton every relevance update. Relevance metadata updates no longer corrupt theupdated_attimestamp. - [#605] Add preserve_timestamps option to update_memories_batch; consolidation callers opt in:
update_memories_batchnow accepts apreserve_timestampsflag (defaultFalse). The consolidation pipeline passespreserve_timestamps=Trueso merging and compressing memories does not reset their original creation/update times. - [#606] Use max(created_at, updated_at) for memory age in _get_memory_age_days: The age calculation previously used only
created_at, causing updated memories to decay as if never touched. Now usesmax(created_at, updated_at)so a substantive update resets effective age and prevents premature forgetting. - [#607] Add dimension fallback when _DIMENSION_CACHE misses on _MODEL_CACHE hit: If the embedding model was cached but the dimension entry was absent, the encoder raised a
KeyError. The fix re-derives and caches the dimension from the loaded model without reloading it. - [#608] Detect existing DB schema dimension for _HashEmbeddingModel fallback: When the real embedding model cannot load and the
_HashEmbeddingModelfallback is used, the code now inspects the existing database schema to determine the vector dimension in use rather than defaulting to a hard-coded value. This prevents dimension mismatch errors when reopening an existing database with the fallback encoder.
Test Coverage
1,340 tests (1,323 existing + 17 new tests covering these fixes).
Full Changelog: https://github.com/doobidoo/mcp-memory-service/blob/main/CHANGELOG.md