Lesson 04.06 · Phase 04 · Memory & Context Engineering

Episodic memory

An agent without episodes makes the same mistake every morning. Store what happened and what you learned, then recall it by relevance first, and recency and importance second.

Learning objectives

  • Explain the difference between episodic memory (what happened) and the semantic and procedural memory of Lesson 7.
  • Implement an episode store that records task, actions, outcome and a one-line lesson after every run.
  • Implement retrieval scored by relevance, recency and importance, and explain why relevance must also be a floor.
  • Show, with a test, that an agent with episodic memory avoids a mistake it made on an earlier run.

Your operations agent exports the sales report every day. The export API's v1 was retired last month. Every morning the agent calls v1, gets 410 Gone, reads the error, calls v2, and succeeds. Every run wastes a step, and a slower or less careful model might give up instead.

Loading the full lesson…