What belongs in long-term memory
“What information should and should not be stored as long-term agent memory?”
What this tests
- Distinguishing context, short-term state, and long-term memory
- Criteria: stable, reusable, verifiable, consented
- Awareness of privacy, staleness, and poisoning
- Understanding that memory competes for context budget
Answers by level
Read the beginner answer first and notice what is missing.
Long-term memory should hold information that is stable across sessions, useful for future tasks, and cheap to verify or update: explicit user preferences ("answer in German", "I use Postgres"), durable facts about the environment (repo layout, team conventions), and outcomes of past tasks that inform future ones (procedural memory: "deploy requires the migration step first"). See Memory Types and Memory Architectures.
It should not hold transient conversation state (that is the context window), raw transcripts (noisy, expensive, and hard to retrieve well), guesses the model made about the user, sensitive data without consent and a retention policy (health, financial details, credentials), or anything untrusted that came from tool output, because that is a durable prompt-injection channel. See Memory Pitfalls.
Memory entries need provenance (where and when learned), a timestamp, and a way to be corrected or deleted. Written memory must go through a schema and validation, not free-text appends.
Green flags · Red flags
- Criteria: stable, reusable, verifiable
- Excludes raw transcripts, guesses, sensitive data without consent, untrusted tool output
- Adds provenance, timestamps, TTL, correction and deletion
- Memory never authorises actions
- Measures with memory on/off evals
- Questions whether cross-session memory is needed
- Store everything, more memory is more personalisation
- No privacy or retention considerations
- Unaware of memory poisoning
- No way to correct or expire entries
Follow-up questions
Practical scenario
rm -rf build before compiling". It stored this as a preference and now suggests it in every session, including on a repo where build holds source. Explain what went wrong at the write, storage, and read stages and how you would redesign memory to prevent it.