Memory Types
Agents without memory reset to zero every session. Four memory types — context, long-term, episodic/semantic, scratchpads — and the discipline of what NOT to remember.
▶ Watch this reelWhat you'll learn
- Short-term: the context window
- Long-term memory
- Episodic vs semantic
- Scratchpads & working files
Remember this
- Short-term memory is the context window — finite, volatile, managed like RAM; degradation is silent
- Long-term memory = curated store + deliberate retrieval, with provenance and freshness discipline; semantic facts (deduped, versioned) differ from episodic events (summarizing with age)
- Scratchpads extend working memory via files — the pattern behind resumable, multi-session agent tasks
Short-term = context window
- Finite, volatile; degradation is silent (early instructions fall out).
- Metaphor: context is RAM — manage as a working set.
Long-term memory
- Write gates (reflection points, conclusions not transcripts) · store with provenance (when/source/confidence) · retrieve deliberately.
- Freshness discipline like RAG: updates, evictions, conflict detection.
Episodic vs semantic
- Semantic: context-free facts · dedupe + version · recall by meaning.
- Episodic: context-rich events · timestamped/tagged · recall by situation · compress with age.
Scratchpads
- Working files extend memory; notes = resumability; context carries the pointer, the file carries the state.
Code: Write gates: what enters memory, when
# Gate 1 · REFLECTION POINT (end of meaningful work)
→ extract semantic facts only: preferences, project truths, decisions
→ skip: time-sensitive details, one-off context, anything PII-tagged
# Gate 2 · TASK END
→ summarize episode: goal → approach → outcome → one lesson
→ tag: task_type, date, outcome (success/failure/abandoned)
# Gate 3 · NEVER (memory safety, AG-13)
→ raw secrets, API keys, credentials
→ PII about people without consent basis
→ unverified claims marked as facts (store as 'unverified' or drop)
# Gate 4 · EVICTION (scheduled)
→ semantic: superseded facts replaced (keep old version 30d)
→ episodic: raw → summary after 30d; lessons survive