StudyAIStudyAI
Pro
AI AgentsLesson 3
Lesson 38 min

Memory

How agents remember within a task and across sessions.

What you will learn
  • Short-term vs long-term memory
  • Why context windows fill up
  • Using a vector store for recall

Explanation

Short-term memory is the conversation kept in the model's context window — but that window is limited, so long chats eventually drop older details.

Long-term memory stores information outside the model, usually in a vector store, and retrieves the relevant bits when needed (the same idea as RAG).

Good agents summarise old turns and pull back only what's relevant, instead of stuffing everything into the prompt.

Real-world use

An assistant that 'remembers' your preferences across days is using long-term memory, not just the current chat.

Common mistakes
  • Cramming the entire history into every prompt, blowing the context limit and the cost.
Practice

Decide which facts in a long support chat belong in short-term vs long-term memory.

Knowledge check
0/1 answered

1. Long-term agent memory usually lives in...

Answer all questions to check.