What is agent memory?
Agent memory is the set of mechanisms that let an AI agent carry information beyond a single model call, from short-term session state within one task to long-term knowledge stored outside the context window and recalled later.
A model remembers nothing between calls. Anything an agent appears to remember was put back into its context by the harness: the conversation so far, a summary of earlier work, a note it wrote to a file, or facts retrieved from a store.
Agent memory is the design of that process. It decides what is kept, in what form, where it is stored, and when it is brought back into view.
Short-term and long-term memory
Session state
The running record of the current task: messages, tool calls and results. Kept as a durable log outside the context window so nothing is lost when context is trimmed.
Trimming
Keep only the last N turns. Simple and deterministic, but older details are dropped.
Summarisation
Fold older turns into a structured summary. Keeps the gist and can drop past mistakes, at the risk of losing a detail that mattered.
Notes and memory files
The agent writes what it learned to files outside its context and reads them back in later sessions.
Retrieved knowledge
Facts, preferences and past cases stored in a database or search index and pulled in when relevant.
What the labs say
Anthropic added a file-based memory tool and automatic clearing of stale tool results to its developer platform in September 2025, so learning can carry across sessions while the context window stays clean. OpenAI's Agents SDK cookbook describes trimming and summarisation as the two short-term strategies.
Google's guidance on context-aware multi-agent systems separates storage (sessions, memory and artifacts) from presentation (the working context built for each call). That split is the core design idea: memory is stored richly and shown to the model selectively.
How Motiontic's engineers apply it
Motiontic's engineers decide what an agent should remember by looking at where it fails without memory: repeated questions, lost decisions, forgotten preferences. Each type of memory gets its own store and its own rule for when it is recalled.
Long-term memory is treated as data, with retention limits, access controls and a way for a person to inspect or delete what the agent has stored.
Short-term compared with long-term agent memory
| Short-term (session) | Long-term | |
|---|---|---|
| Scope | One task or conversation | Across tasks, sessions and users |
| Typical store | Event log, trimmed or summarised history | Files, databases, vector or keyword search |
| Main risk | Context fills up and recall drops | Stale or wrong facts recalled with confidence |
| Managed by | Trimming, summarisation, compaction | Write rules, retrieval rules, retention and deletion |
Common questions
How do AI agents remember things?
The model itself does not. The agent harness stores conversation history, summaries, notes and facts outside the model, and puts the relevant parts back into the context window on each call.
What is the difference between agent memory and RAG?
RAG retrieves documents to answer a question. Agent memory also stores what the agent has done and learned, such as decisions, preferences and progress, and recalls it in later steps or sessions. Retrieval is one way to recall memory.
Does a bigger context window remove the need for memory?
No. Recall degrades as context fills, and a long history costs tokens on every call. Memory design keeps the working context small and relevant, whatever the window size.
Related
Context engineering
Curating everything in the model's view, not just the wording of the prompt.
Context rot
Why agents get worse the longer they run, and what keeps context clean.
RAG vs Agentic Search
One retrieval before the answer, compared with an agent that searches as it works.
RAG vs Fine-Tuning
Fetching the right facts at query time, compared with retraining the model's behaviour.
AI agent development
Agents that do real work for users, with the evals, traces and guardrails to keep them in production.
Running agents that have to hold up?
Describe the agent, the systems it touches and what it must never get wrong. The first call is with a lab engineer, who will say plainly whether it is ready for production, and whether Motiontic is the right team.