Log inStart free
LESSON 23.07 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Memory types for agents

See where an agent keeps what it knows, and how a message finds it.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 23.07 · AGENT MEMORYWINDOW 24 · 4 OF 5 TURNS · 22 TOKENS
01
Stage 1 of 6 · Conversation
Conversation memory keeps the turns of this session. A 24-token window keeps the newest 4 turns, so t1 drops out.
Explain it simply

Each chip is one turn of the chat, with its token count. The model can read only so many tokens at once. So the window keeps the newest turns that fit, and the oldest ones fall out.

Five turn chips. The window keeps 4 turns, 22 of 24 tokens. Turn t1 is outside the window.

turns and memorieswindow, top kdropped, missscores, retrieved
short-term memory · conversation, day 12long-term memory · kept across sessionswindow 24 tokens · 22 useddroppedt1 user 6I eat onlyvegan food now.t2 agent 5Noted. Whereare yougoing?t3 user 6Rome in May,for fournights.t4 agent 5I foundhotels nearTermini.t5 user 6Find vegan foodnear my hotel.short-term memory · conversation, day 12long-term memory · kept across sessionswindow 24 tokens · 22 useddroppedt1 user 6I eat onlyvegan food now.t2 agent 5Noted. Whereare yougoing?t3 user 6Rome in May,for fournights.t4 agent 5I foundhotels nearTermini.t5 user 6Find vegan foodnear my hotel.
Toy: a trip agent, 5 turns, 4 episodes, 3 facts; 1 token per word
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
∑t ∈ windownt≤W\sum_{t\,\in\,\text{window}} \sy{n}{data}{n_t} \le \sy{W}{param}{W}
5+6+5+6=22≤245 + 6 + 5 + 6 = 22 \le 24

The window keeps the newest turns whose tokens fit in W.

Common mix-ups

MYTHThe chat window remembers everything the user said.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01For the Vegan food query, if the window shrinks to 16 tokens, is the vegan fact still in working memory?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.