Agent memory is the information an AI agent keeps so it can keep working across turns, and it usually means two different things: short-term memory for the current task context, and long-term memory for stored facts or past interactions it can retrieve later.
Without memory, an agent is basically reset every time you ask it something new. That makes it bad at multi-step tasks, personalization, follow-up questions, and anything that needs continuity.
In practice, memory helps an agent:
Most teams start with short-term memory because it is simpler and safer, then add long-term memory only when they need persistence across sessions.
Short-term memory is the agent’s working context for the current interaction. In LLM systems, this is usually the conversation history, tool outputs, system instructions, and any task state that is still relevant.
It is limited by the model’s context window and by practical prompt design. When the context gets too large, older or less relevant information may be truncated, summarized, or retrieved selectively.
Long-term memory is information the agent stores outside the model so it can use it later. This is often implemented with a database, document store, vector store, or key-value memory system.
Typical long-term memory content includes:
The agent does not “remember” this on its own; it must retrieve the stored item and feed it back into the model at the right time.
Short-term memory is for working on the current task. Long-term memory is for persisting useful information beyond the current context.
A common architecture is:
That selective retrieval matters, because dumping everything into the prompt usually hurts quality more than it helps.
User: “Plan a 3-day trip to Tokyo. I like sushi and walking tours.”
A week later:
User: “Plan my next trip.”
The agent can retrieve the stored preference and say:
Assistant: “You previously said you like sushi and walking tours, so I’ll bias the itinerary toward those.”
For most applications, start with a clean short-term context strategy, then add long-term memory only for clearly valuable, user-visible continuity.