What is Memory?
In AI agents, memory refers to the component that stores and retrieves information from past interactions or experiences, enabling the agent to maintain context and make better decisions over time.
Memory works by saving key details such as conversation history, user preferences, or task outcomes in a structured way. The agent can then query this stored information during future steps to avoid repeating mistakes or forgetting important context.
Common approaches include short-term memory (limited to the current session, often using buffers) and long-term memory (persisted across sessions via databases or vector stores for retrieval).
This allows agents to simulate human-like recall without relying solely on the model's built-in context window.
Example
A personal assistant agent remembers that a user prefers morning meetings and avoids scheduling them after 5 PM based on past conversations stored in its memory module.
Why it matters
Memory turns stateless language models into coherent, adaptive agents capable of handling multi-turn tasks and learning from experience, which is essential for real-world applications like chatbots and autonomous systems.
Frequently asked questions
The context window is the model's temporary input limit, while memory is an external system that can persist and selectively retrieve information beyond that limit.
Related terms
A context window is the maximum number of tokens an LLM can process together in one pass, including the user's input and any conversation history.
Retrieval-Augmented Generation (RAG) is a technique that improves large language models by retrieving relevant external information before generating a response.
A vector store is a specialized database that stores high-dimensional vectors (embeddings) and supports fast similarity searches to find the most relevant items.
Agentic AI refers to AI systems that function as autonomous agents, capable of setting goals, making decisions, and taking actions to complete tasks with limited human input.
Agent memory is the component in AI agents that stores and retrieves information from past interactions, enabling recall of context, facts, or experiences to inform future actions.
An AI Agent (or Agent) is a software system that perceives its environment, reasons about goals, and takes actions autonomously to complete tasks.