Stage 3 · Teens · Agents

Memory: Short-Term vs Long-Term

How agents retain context within and across sessions.

Short-term memory is just the current context window — the conversation history and tool results included in the prompt for this session. It disappears once the session ends, and even within a session it's bounded: once a conversation grows past the context window, the oldest messages fall out entirely, whether or not they still matter.

Long-term memory persists information across sessions (and across that window limit): user preferences, facts learned earlier, prior decisions. This usually requires an external store — a database, a file, a vector store — that the agent explicitly reads from and writes to, rather than relying on the message history alone.

What Happens to a Preference Stated 50 Messages Ago?
Message 1: "I always want window seats and vegetarian meals." ... 50 messages pass ...
Context window (last 10 slots)
Msg 51
Msg 52
Msg 53
Msg 54
Msg 55
Msg 56
Msg 57
Msg 58
Msg 59
Msg 60
User (message 101): "Book my usual seat and meal."
✗ Agent: "What seat and meal do you usually prefer?" — the preference scrolled out of the window and was never persisted.
Short-term memory only holds what's still in the window — anything worth keeping past that must be written to long-term storage.

Compare what survives in the context window with and without persisting the stated preference.

All lessons in Stage 3: Agents and safety