Giving agents memory
What you’ll learn
Section titled “What you’ll learn”This is lesson 5 of Track 20, in Phase 2 (The design patterns that make agents work). Up to now every agent started fresh each run; this lesson is about how an agent holds on to information. It draws the line that organizes everything: short-term context, which lasts a single run, versus persistent memory, which survives across runs and is what makes an assistant feel like it knows you. Then it turns to the question that actually matters in practice, which is not where to store memory but what is worth remembering, including why “remember everything” is a trap and which kinds of facts earn their keep.
The track structurally mirrors Microsoft’s “AI Agents for Beginners” (MIT-licensed); this lesson follows its agent-memory material. Full attribution is in this lesson’s references.
Where this fits
Section titled “Where this fits”This lesson stays at the conceptual level: what to remember and why. The very next lesson, agentic RAG, takes up where that memory lives and how the agent fetches the right piece at the right moment, which is a retrieval problem. So this lesson and the next are two halves of the same information flow: deciding what to keep, then reaching for it when needed.
Before you start
Section titled “Before you start”Prerequisite: Lesson 1, What makes an AI an “agent”. You need the perceive-decide-act loop, because short-term context is exactly the working state of one trip through that loop, and persistent memory is what survives after it ends. No coding or math required.
By the end, you’ll be able to
Section titled “By the end, you’ll be able to”- Distinguish short-term context (one run) from persistent memory (across runs)
- Explain why an agent is amnesiac by default and memory must be designed in
- Decide what an agent should retain, by future usefulness rather than availability
- Name the costs of over-remembering (context, staleness, privacy)
- Describe how the two kinds of memory hand off within a single run
Time and difficulty
Section titled “Time and difficulty”- Read time: about 11 minutes
- Practice time: about 15 minutes (short-term-vs-persistent and retention-triage exercises plus flashcards)
- Difficulty: standard