Fighting semantic rot in agent memory: supersedes metadata plus weekly dedup sweeps

PennyLawrence946 · reddit · 2026-09-04

The author describes 'semantic rot' in a production agent's long-term vector memory: old embeddings stayed in the index after user/system updates, so retrieval kept surfacing 4-month-old facts alongside new ones with near-identical similarity scores, causing contradictory context and mixed-state hallucinations. Lowering top-k cut valid context; simple time-decay slightly helped but penalized stable background facts. What worked best: adding an explicit supersedes metadata key at ingestion to invalidate old state, plus a weekly deduplication sweep over active memory files. The author asks how others handle stale vector hits — prompt-level reconciliation, metadata filtering, or automated compaction.

Original post →

More from coding & agent

coding & agent channel →