Persistent memory is the canonical record; summaries, embeddings, and cached context are derived representations. Link each derived artifact to its source version and choose how it is rebuilt, expired, or retained when the source changes.
Why mixing source-of-truth with retrieval optimizations is how AI agent memory systems start lying to you
Companion notebook: Two Layer Pattern walk-through
Key takeaways
Persistent memory is the source of truth. Embeddings, summaries, caches, and pre-joined views are derived from it.
Every derived artifact points back to the exact canonical row and version it came from.
When canonical memory changes, derived context gets regenerated, expired, or annotated as a pinned snapshot. That call is a policy decision, made per memory type.
Match the sync strategy to what a stale read costs. Transactional for critical facts, scheduled for summaries and projections, lazy for cheap rollups.
Delete the derived layer and rebuild it from canonical alone.…