9.4 Memory
Your agent remembers what matters and forgets what does not.
Before:08. Large Language Models
Agent memory splits into two problems: managing the context window now — compaction, summarisation — and persisting knowledge across sessions in retrieval-backed stores. What to forget matters as much as what to keep. It sits mid-module because loops and tools generate the history that memory must manage. The failure is naive accumulation: append everything and retrieval degrades as stale and poisoned facts pile up, remembered precisely because nothing was ever judged worth forgetting.
Work through these
Short-term context management and compaction
What stays in the working context, and what happens when it fills up. Compaction decides what the agent still knows after a long task, and doing it badly loses the thread.
Model Context Protocol — Introduction · DocsLong-term memory stores and retrieval
Storing facts outside the context and retrieving them when relevant, which is retrieval applied to the agent's own history. It is what makes memory survive a restart.
Episodic vs. semantic memory
Remembering what happened against remembering what is true are different kinds of memory with different retrieval needs. Mixing them produces an agent that recalls events as facts.
Memory poisoning and stale facts
Bad information written into memory persists and gets retrieved repeatedly, and facts that were true when stored may not be now. Both need an expiry or a verification story.
Sign in to keep your progress.
Free resources
We haven't checked most of these for screen reader use yet.
Links last checked 29 Aug 2026.
Stuck here?
Ask a mentor. A real person answers, and they can see exactly which topic you're on. Usually within a couple of working days.
Checking your session…
Topics shown in module order.