Most AI memory systems treat storage and retrieval as the whole problem, but this leads to stale, contradictory, and noisy memories over time. A more robust approach adds lifecycle management: exponential decay scoring to fade unused memories, contradiction detection to mark superseded facts, confidence scoring to distinguish explicit statements from inferences, compression to merge redundant memories into cleaner entries, and expiry for time-bound context. All implemented with SQLite and LLM calls (gpt-4o-mini for cheap passes, gpt-4o for synthesis), with a background scheduler running daily decay/expiry and weekly compression. The composite retrieval score (importance × confidence × decay_score) surfaces the healthiest memories rather than just the most important ones.
Table of contents
The Problem With “Store and Retrieve”The Foundation (Brief, I Promise)Memory DecayContradiction DetectionConfidence ScoringCompression and ElevationExpiring MemoriesWiring It TogetherWhat Retrieval Looks Like NowIs This Overkill?Where This Actually Leaves YouBefore you go!Sort: