[GH-1160] Fix consolidation pipeline silently destroying user-defined tags by o-love · Pull Request #1164 · MemMachine/MemMachine

Skip to content

Navigation Menu

Sign in

Appearance settings

Conversation

@o-love o-love changed the title Fix consolidation pipeline silently destroying user-defined tags [GH-1160] Fix consolidation pipeline silently destroying user-defined tags

Mar 3, 2026

sscargal

Comment on lines +376 to +377

Comment on lines +819 to +839

Three compounding bugs caused the consolidation LLM to replace
user-defined tags (e.g. 'bugfix', 'progress') with invented names
(e.g. 'Productivity Style'):

1. build_consolidation_prompt() never received valid tag names, so the
   LLM had no knowledge of which tags were allowed.
2. _features_to_llm_format() stripped metadata IDs before sending
   features to the consolidation LLM, making keep_memories unreliable.
3. _deduplicate_features() wrote LLM-returned tags directly to storage
   with no validation, allowing silent tag renaming.

Fixes: pass tags to consolidation prompt, add ID-preserving serializer
for consolidation, and enforce original tag on consolidated features.