In this lecture we cover why agents need explicit memory outside the message history, how to design the
session state layer (short‑lived conversation progress) and the
persistent state layer (long‑term user data), and how to use
checkpoints for recovery, debugging, and audit. Using GiftGenius as an example, we’ll show TypeScript types, wiring the run cycle with tools, and the practice of “memory hygiene” (context, token cost, privacy, PII, and TTL).