CSE Roadmap

Core tier · about 8 hours · 15 parts

Part 11 of 15 · 2 min read

Answering memory-across-sessions questions in an interview

How would you give an agent memory across sessions?

"I keep three stores: facts, with one current value per key; episodes, written once per session; and procedures, versioned so the newest is current. Only the user or the system can write; anything from a tool or a web page goes to quarantine, because a poisoned memory persists across every future session, long after the page that planted it is gone. Recall puts the facts and whatever episodes and procedures match the question into the window under a token budget." Follow-up: "What's the weak point?" Extraction -- a rigid pattern-matcher misses paraphrases and silently keeps the stale value current, so I measure its recall separately and keep a searchable transcript as a backup for exactly what it misses.

Why not just keep the whole conversation and replay it?

"Three reasons I can show in a toy experiment: the cost grows with every session with no ceiling; a replay cannot replace or remove anything, so a corrected fact sits beside its old version and a deleted fact is still there; and a replay has no rule for choosing between sessions that mattered in different ways." Follow-up: "So when is a transcript useful?" As the fallback for whatever a stricter extractor missed, searched on demand rather than replayed on every turn.

How do you make sure forgetting actually works?

"A hard delete has to do three things: remove every version of the record, scrub any copy of the value quoted elsewhere, and make the underlying delete real by overwriting the disk space, because an ordinary delete can leave the old bytes in the file. I check all three by scanning the raw file's bytes after the delete, not just by querying the table." Follow-up: "Does that cover everything?" No -- it only reaches the store I built. Backups, provider-side retention, and anything baked into a model fine-tuned on the logs are separate promises that need their own answer.