Do AI Agents Learn Between Sessions? The Honest Answer

You explained your project to the AI yesterday. Today you open a new conversation, and it has no idea who you are. That's not a bug. It's the default.
By default, no — AI agents do not learn between sessions. Most AI agents have no memory of prior conversations. Every new session starts from zero. The underlying language model is stateless. Agents that appear to remember are using an external memory layer that captures observations from one session and re-injects them into the next.
That's the honest answer. The longer answer — why this is the case, which platforms have memory features, and how to give your own agent real continuity — is the rest of this article.
Why LLMs Are Stateless By Default
The large language model at the center of any AI agent is a static file: weights produced by training, frozen at deploy time. When you send it a prompt, it produces a response based on those weights and the contents of your prompt. Nothing about that operation writes back to the model.
This means every API call is structurally independent. There is no continuous "session" at the model level. What you experience as a conversation — the back-and-forth that seems coherent across many turns — is the application layer re-sending the conversation history with every new message. The model sees the whole transcript fresh each time and responds. When the conversation ends, the transcript goes wherever the application decided to store it. The model itself has no awareness that the conversation happened.
This is true of every major LLM in 2026: GPT-5, Claude, Gemini, Llama, all of them. The model is stateless. Statefulness is something built around the model, not inside it. IBM's overview of AI agent memory is blunt about the consequence: "Large language models (LLMs) cannot, by themselves, remember things. The memory component must be added."
The implication: if you're building an AI agent and you want it to remember anything between sessions, that capability has to be added explicitly. It doesn't come from the model.
What Does "Memory Between Sessions" Actually Mean?
The word "memory" gets used loosely in this space, often in ways that conflate two very different things.
Short-Term Memory (Within a Session)
The context window holds the conversation while it's happening. It's the chunk of text the model can see on each call — usually 32k, 128k, or up to 1M tokens for frontier models in 2026. This is what makes a conversation feel continuous within a single session. The model can refer back to something said earlier in the same conversation because that earlier message is still in the context window.
But context windows have hard limits. When the conversation gets long enough, older messages drop off or get summarized. And when the session ends — when you close the tab, when the API connection terminates — the context window is gone. There is no place it persisted to by default.
Long-Term Memory (Across Sessions)
This is what people usually mean when they ask whether the AI "remembers" them. It's an external persistence layer that captures observations during a session and feeds them back when the user returns.
Long-term memory is not part of the model. It's a system that sits next to the model, with its own storage (a vector database, a knowledge graph, a document store, sometimes all three) and its own retrieval logic. When you start a new session, this system queries its storage for what's relevant to you, then injects those memories into the context window before the model responds.
From the user's perspective, the agent "remembers." Mechanically, the model is still stateless. The memory layer is doing the work.
Why This Distinction Matters
People ask "does the AI remember me?" expecting a simple yes or no. The honest answer is: the model doesn't, but the app around the model might.
This distinction matters because the answer to "how do I make my agent remember?" depends entirely on the app layer. There's no setting on the model itself. Adding memory means building or buying a separate system. The question shifts from "does AI remember?" to "what memory infrastructure does this product have?"
Do Specific AI Platforms Remember? A Comparison
Different consumer AI products handle memory differently. None of them rely on the model alone — they all add an external layer.
| Platform | Default behavior | Has memory? | How it works |
|---|---|---|---|
| ChatGPT (with Memory enabled) | Saves facts about you opt-in | Yes | Three-layer system: explicitly saved facts, full chat history reference, behavioral inference |
| Claude | Searches past conversations on request | Partial | Transparent tool call to search prior chats; doesn't auto-recall |
| Gemini | Personalization layer | Yes | Builds a knowledge graph of user preferences over time |
| Perplexity | No memory | No | Each query is independent |
| Cursor / Claude Code | Project-scoped context | Partial | Repo context, per-project rules files, no persistent user memory across projects |
| Custom-built agent on raw API | No | No | Until you add a memory layer |
The pattern: consumer products bolt on memory features when memory is a competitive feature. The model itself, in every case, is the same stateless artifact. ChatGPT's memory isn't a special model — it's an external storage system that injects "you saved this fact about yourself" into the context window before each session.
For developers building agents, the default state of the world is the bottom row: no memory at all. You get whatever the application layer provides, and if you're building it yourself, you provide it.
How AI Agent Memory Actually Works When It's Built In
The mechanics behind every "the agent remembers" experience follow the same five-step cycle:
-
Capture. During a session, the agent (or a background process watching the session) extracts noteworthy information — facts, preferences, outcomes, mistakes — and writes it to a memory store. The extraction can be rule-based, LLM-based, or both.
-
Index. The memory store organizes what was captured for fast retrieval. Most modern systems use embeddings for semantic search, keyword indexes for exact-match queries, and metadata (timestamps, user IDs, source) for filtering.
-
Retrieve. When the user returns, the agent queries the memory store with the current conversation as the query. The store returns relevant memories — usually a handful of top-ranked items.
-
Inject. The retrieved memories are inserted into the context window before the agent responds. From this point on, the model "sees" the memories as if they were always there.
-
Consolidate (advanced). Higher-end systems don't just store and retrieve raw memories. They periodically synthesize them — rolling up dozens of related observations into higher-order beliefs, reconciling contradictions, deciding what to forget. This is what differentiates auto-consolidating systems from log-style memory stores.
Every commercial memory platform — Mem0, Zep, Letta, Hindsight, Cognee, SuperMemory — implements some version of this cycle. They differ in how they extract, how they index, how aggressively they consolidate, and how their retrieval ranks results. The taxonomy these systems borrow from cognitive science — episodic, semantic, and procedural memory — was codified for LLM agents by the CoALA (Cognitive Architectures for Language Agents) framework, which IBM and most platforms reference as their conceptual model. For a deeper architectural walkthrough, see the pillar on how AI agents actually learn and the comparison of all 8 major frameworks.
What Counts as "Learning"?
Cross-session memory is the foundation of any meaningful agent learning. Without it, every session is groundhog day — the agent restarts at zero, and any insights gained during one session vanish when it ends. Augment Code calls this failure mode "perpetual amnesia" — "today's AI agents show perpetual amnesia because static model weights and weak cross-session memory architectures prevent experience from carrying forward reliably." A surprising number of production agents are in this state. They have logs of what happened; they have no way to use those logs to behave differently next time.
"Learning" in the LLM-agent context almost always means: memory writes that change future behavior. Other forms of learning exist — fine-tuning changes the model itself, in-context learning adapts behavior within a session — but for cross-session improvement, memory is the mechanism. The architecture of how the four learning mechanisms interlock is covered in the pillar; for this article the relevant point is that learning between sessions is structurally a memory problem.
How to Add Cross-Session Memory to Your Own Agent
If you're building an agent and you want it to learn across sessions, you have three real options.
Option 1: A Managed Memory Platform
Services like Mem0, Zep, and Letta provide hosted memory as a service. You send observations via their API; they store, index, and retrieve them. Most have client libraries that integrate with LangChain, LlamaIndex, and direct LLM APIs.
Pros: fast to integrate (often hours, not days), handles the operational complexity, provider takes responsibility for retrieval quality.
Cons: vendor dependency, per-request pricing at scale, data leaves your infrastructure, less control over consolidation behavior.
Best for teams who want memory working in a sprint and are comfortable with a SaaS dependency.
Option 2: Hindsight — Managed or Self-Hosted
Hindsight is offered as two equal first-class deployment options, with the same retrieval engine and benchmarks behind both.
Hindsight Cloud is the managed path: Vectorize runs it, native OAuth 2.1 for MCP clients (Claude Code, Claude Desktop, Cursor, Windsurf, ChatGPT), no ops overhead. This is the default mention for most teams — start here unless you have a specific reason to self-host.
Hindsight self-hosted is the data-sovereignty path: MIT license, embedded Postgres (pg0), one Docker command, Ollama-compatible for fully local deployments. Best for teams with air-gapped requirements, regulated data, or strict privacy constraints. Mem0 and Letta also offer self-hosted modes.
Pros: same accuracy benchmarks either way. Cloud removes the operational burden; self-hosted gives you data sovereignty and no per-request fees. The license doesn't gate features in either case.
Cons: Cloud is a managed dependency like any other SaaS. Self-hosted means you operate it (though "operate it" with embedded Postgres is closer to running a normal database than running specialized infrastructure).
Best for teams who want a memory layer with strong published benchmarks and the flexibility to pick managed or self-hosted based on their data posture.
Option 3: Build Your Own
Vector DB + embedding pipeline + retrieval logic + consolidation passes + observability. All buildable in principle. None of it cheap to build well.
Pros: full control, tailored to your exact needs.
Cons: months of work, all the production gotchas (deduplication, consolidation, drift, retrieval relevance, multi-tenancy). The major memory frameworks are essentially the productized versions of this work — they exist because building it well is harder than it looks.
Best for teams with very specific requirements and the engineering budget to take a years-long view.
For most teams, Options 1 or 2 win. Building memory infrastructure from scratch is a years-long product, not a sprint task. The comparison of all 8 major frameworks walks through the options on retrieval accuracy, self-hosting story, license, and other selection criteria.
How Long Does AI Memory Last?
This depends entirely on the memory layer's retention policy. There is no built-in answer; the system you choose (or build) decides.
Some platforms retain memories indefinitely. Some have configurable TTLs. Some auto-decay older memories that aren't retrieved frequently. Some delete on user request to comply with GDPR right-to-be-forgotten or healthcare data rules.
The right question isn't "how long does AI memory last?" — it's "what retention policy did you configure?" Check the docs for whichever platform you've chosen. With Hindsight — whether you're on Hindsight Cloud or self-hosting with embedded Postgres — the retention policy is a configuration option you control.
For compliance-sensitive deployments (healthcare, finance, legal), this is a more important question than retrieval accuracy. A memory system you can't audit and can't selectively delete from is a compliance liability waiting to surface.
When You DON'T Want Cross-Session Memory
Memory isn't always the right answer. Some honest counter-cases:
Privacy-sensitive contexts. Anonymous-by-default support agents, helplines, certain healthcare triage flows. Continuity is less important than not retaining identifying information.
Single-purpose agents where personalization adds no value. A code-formatting agent doesn't need to remember you across sessions; it formats code, and that's a stateless operation.
High-compliance environments where data isolation between users matters more than continuity. Strict tenant isolation is easier to guarantee when there is no shared persistence layer at all.
Early prototypes where adding memory infrastructure isn't justified by the value. Don't add memory to an MVP just because memory is technically possible — add it when the absence is causing real friction for users.
Memory is a tool. Use it where it fits.
Conclusion
By default, no — AI agents do not learn between sessions. The model is frozen, every API call is independent, and the conversation you had yesterday is invisible to today's session unless something explicit captured it.
Three things to remember:
- The LLM is stateless. Any apparent memory is the app layer. When a product seems to remember you, that's external infrastructure, not the model itself.
- Cross-session memory is a separate system you add. Mem0, Zep, Letta, Hindsight, Cognee, SuperMemory, or your own build — but it's a distinct architectural decision.
- "Learning between sessions" is structurally a memory problem. Not a fine-tuning problem, not a bigger-context-window problem. Memory.
If you're building an agent and you want it to learn across sessions, the question to answer is which memory layer fits your team — not whether to add one. The full breakdown is in the comparison of all 8 major frameworks; the architectural context is in the pillar on how AI agents actually learn.
FAQ
Does ChatGPT remember between sessions? With the Memory feature enabled, yes — ChatGPT saves opt-in facts about you and can reference prior conversation history. With Memory disabled, no. The model itself doesn't remember; an external system does.
Does Claude remember our past conversations? Partially. Claude can search past conversations via a transparent tool call when you ask it to, but doesn't auto-recall across sessions by default. Each new conversation starts without prior context unless explicitly retrieved.
How does AI memory actually work? A separate system captures observations during sessions, stores them with semantic indexing, retrieves the relevant ones when the user returns, and injects them into the context window before the model responds. The model itself is unchanged; the memory layer makes the appearance of continuity possible.
Can I make ChatGPT forget something? Yes, the Memory feature allows you to delete specific saved facts or clear memory entirely. The chat history may persist separately depending on your settings.
What's the difference between context window and memory? The context window is the chunk of text the model sees on each call — short-term, session-scoped, lost when the session ends. Memory is external storage that persists across sessions and gets retrieved into the context window when relevant.
Is there a difference between memory and chat history? Yes. Chat history is the raw transcript of past conversations, stored somewhere. Memory is the processed, indexed, retrievable version — extracted facts, semantic embeddings, and the retrieval logic that surfaces them when relevant. Chat history without retrieval logic is just storage, not memory. (For the related distinction between memory and document retrieval, see agent memory vs RAG.)
How is AI memory different from a database? A database is one of the storage layers a memory system uses. Memory adds the extraction logic (what to save from a conversation), the indexing (semantic embeddings, knowledge graph edges), the retrieval ranking (which memories are relevant right now), and increasingly the consolidation passes (reconciling contradictions, forming higher-order beliefs). The database is the floor; memory is everything you build on top of it.
Further Reading
- How Do AI Agents Learn? — the pillar covering all four learning mechanisms
- Fine-Tuning vs Memory for AI Agents — the head-to-head decision guide
- Why Fine-Tuning Is Almost Never the Right Answer — the opinionated companion piece
- Agent Memory vs RAG — memory vs document retrieval distinction
- Best AI Agent Memory Systems — full comparison of the eight major frameworks
Next reads: the pillar on how AI agents actually learn, fine-tuning vs memory for AI agents if you're choosing between approaches, or the full comparison of memory frameworks if you're picking a platform.