Agent memory
The mechanisms that let an LLM agent remember things beyond the current context window — earlier steps in a task, facts about the user, or lessons across sessions. The solution to the model itself being stateless.
Types: short-term memory (the ongoing conversation/task's steps, fits in the context, often summarized when it gets too long), and long-term memory (facts saved in external storage — often a vector database — fetched in when needed, e.g. "the user prefers metric units"). Techniques: summarize old history (a running summary), save and RAG back relevant memories, or structured memory stores (mem0, Letta/MemGPT). Challenge: what should be saved, how to fetch it back relevantly, and how to avoid the memory swelling or going stale. Crucial for agents that perform long tasks or need to remember a user between sessions. Often built on the RAG machinery. Related to multi-agent system and RAG.