// no memory between calls
Each API call is independent. The only thing the model "knows" is what's in the context window right now, and that window is finite. Chat feels like it remembers only because the app re-sends the whole history every turn — that's client-side state, not the model's.
So an agent running a multi-step loop forgets everything between steps unless you carry the state forward yourself.
The scratchpad = working memory
Each loop, the agent writes a thought, takes an action, records what it observed — and that running trace is fed back into the next step. That's the ReAct loop, and the trace is the agent's working memory.
Two kinds of memory
working memory
The scratchpad. Lives inside the context window. Scoped to this one task; gone when the task ends.
external store
A file, DB, or vector store the agent writes to and reads back — persists across sessions (semantic, episodic, procedural memory).
Because the window is finite (and gets worse as it fills — "context rot"), you can't just keep appending. The pattern is write notes outside the window, pull the relevant ones back in — Anthropic calls it structured note-taking; MemGPT (now Letta) frames it as paging memory in and out like an operating system.
Sources: Anthropic — context engineering & note-taking · ReAct (Yao et al.) · LangChain — memory (short vs long-term) · MemGPT / Letta
One concept a week. Free.
The deeper, copy-paste version of each ToolCall short — in your inbox.
// total: 0.00 · spam: void · unsubscribe: one click
