Agent memory
Memory is what makes an agent stateful (see the design principlesAgent design principlesFour properties that make a loop an agent: goal-directed, reactive, stateful, autonomous.Opens in a new tab). It comes at two scales: short-term, which lasts for one conversation, and long-term, which outlives it.
Short-term
Short-term memory is thread-scoped: the message history of the conversation in progress. It lives in the context window, so it is finite and has to be trimmed or summarized when it grows (see overflow managementContext overflowWhen the history outgrows the window: cut the oldest, or summarize them.Opens in a new tab). A new thread starts empty. In LangGraph a checkpointer keeps it, addressed by a thread id.
Long-term
Long-term memory is stored across sessions and shared across threads. The LangChain docs split it into three kinds.
| Kind | Holds | Example |
|---|---|---|
| Semantic | Facts and concepts | The user prefers dark mode |
| Episodic | Past events and actions | A past run kept as a few-shot example |
| Procedural | Rules for performing tasks | The agent's prompt and instructions |
In LangGraph this is a store, kept apart from the thread. What gets pulled into the prompt on each step is the job of the context assemblerThe context assemblerThe step that builds the prompt from scratch on every loop.Opens in a new tab.
Sources
- Memory overview, LangChain docs · accessed October 5, 2026
- LLM Powered Autonomous Agents, Lil'Log · accessed October 5, 2026