Agent Memory

13 min read

An AI model does not remember anything by itself. An agent needs memory to finish long tasks and to know you next week. This lesson shows how short-term and long-term memory work, and what to save and what to forget.

New words

Short-term memory
The chat so far, kept inside the context window for this task.
Long-term memory
Facts saved outside the model, so they last after the chat ends.
Summary
A short text that keeps the main points of a long chat.
Memory store
The place where notes are saved, such as a file or a database.
Retrieval
Finding the right saved note and adding it to the prompt.
Stale memory
A saved fact that was true once but is not true now.

What you will learn

  1. The tutor that forgot your exam date
  2. A model starts fresh every time
  3. Short-term memory: the chat in the window
  4. Long-term memory: notes outside the model
  5. Try it: a tutor bot with a small window
  6. What to save, and what not to save
  7. Trade-offs
  8. In a real system
  9. Interview tip
  10. Key takeaways

10 quiz questions at the end.

Start this lesson

The full lesson, with interactive demos and the quiz, opens after you sign in with Google. It is free.

All lessons · Back to the roadmap