Short-Term Memory
The conversation history kept in the LLM's context window during a single session.
Last updated: April 26, 2026
Definition
Short-term memory in agent terminology = the messages array you send back to the LLM on each turn. It includes the user's current question, recent assistant responses, and tool call results. It survives the session but vanishes between sessions unless you persist it. The challenge: it grows unbounded with conversation length, eventually eating your context window. Production solutions include sliding window (keep last N messages), summarization (compress old turns into a summary), or hybrid (recent verbatim + older summarized).
When To Use
Default for any multi-turn agent. The truncation strategy matters more than the storage. Pick one before you hit the wall in production.
Building with Short-Term Memory?
I've shipped this pattern in real production systems. If you want a second pair of eyes on your architecture, that's what I do.