Stateful vs Stateless AI Agents: What Actually Changes When an Agent Keeps State
Every production LLM is stateless. Statefulness is the layer you wrap around it — and making an agent stateful is the easy half of the problem.
October 13, 2026 · Caura.AI
Stateful vs stateless is never a decision about the model. Every production LLM is stateless at inference, so statefulness belongs to the layer you wrap around it, and the real decision is where state lives, who may read it, and what happens when it goes out of date. One number sets the expectation: on Caura’s published 500-question LongMemEval run, a perfect oracle-quality memory handed to the reader scored 94.6%, while real retrieval scored 92.2%.
Retrieval costs 2.4 points. The reader costs the other 5.4. Making an agent stateful is the easy half of the problem. This blog covers what separates a stateless agent from a stateful one, what statefulness measurably buys, the four things that break the day you turn it on, and how the answer changes once more than one agent reads the same facts.
What is the difference between a stateful and a stateless AI agent?
A stateless agent rebuilds its entire world on every call. A stateful agent reads from a store that survived the last call. The model is identical in both cases. What differs is whether anything was written down, and whether the next run can find it.
What stateless actually means for an agent
Stateless means the model receives a request and returns a response with no recollection of any request before it. Everything it appears to know in a long conversation was resent by the surrounding code. Close the session and the knowledge is gone, which is why Claude Code forgets everything between sessions unless something outside the model is keeping notes. A stateless agent fails loudly. It asks a question you answered yesterday, and you notice immediately.
What makes an agent stateful
Statefulness needs four parts, not one:
- A store that outlives the process.
- A write path that decides what is worth keeping and how it is labelled.
- A read path that pulls back the relevant slice rather than the whole archive.
- A lifecycle that retires facts once they stop being true.
Teams usually build the first three and skip the fourth, which is why so many stateful agents work in week one and degrade quietly by week six. Caura’s breakdown of the three kinds of state a fleet actually holds goes further into the task, knowledge and policy split.
Why the web-architecture definition misleads you here
The vocabulary is borrowed, and it inverts on the way over. In HTTP, stateless is the win: a stateless application scales horizontally because any server can answer any request. In agents, stateless is the loss: an agent that holds nothing is correct only for work that fits inside one call.
The search data makes this concrete. In October 2026 we pulled the live US Google results for “stateful vs stateless” and “stateful vs stateless AI agents”, and across the 15 unique page-one organic URLs, 10 were about firewalls, HTTP, Kubernetes, or web application design. Zero of the eight results for the unqualified term were about AI agents at all. We also pulled the 68 keywords Google treated as related to the term at the same time. Exactly one contained “ai”, and not one contained “agent”, “memory”, “context”, or “LLM”. Carry the HTTP intuition into agent design and you will optimise for the wrong property.
Where does an agent’s state actually live?
In three places, and only one of them is memory. Confusing the three is the most common architectural mistake in this area.
| Layer | Holds | When it fails |
|---|---|---|
| Context window | Scratch space for a single call; hard ceiling, expensive to fill | Wiped when the call ends — it was never state |
| Session store | Checkpoints, step counters, partial tool results, the orchestration graph’s position | You lose a run, you see it happen, you restart |
| Governed memory | Facts, decisions, preferences, rules, outcomes that outlive the call and the run | Nothing crashes — the agent acts on a stale fact and the output looks correct |
The context window is scratch space for a single call. A bigger window does not make an agent stateful; it makes each stateless call more expensive. Caura’s explainer on why the context window is a working set, not memory draws the line precisely. The session store — the layer LangGraph-style runtimes manage well — is the cheapest kind of state to add and the least interesting. Governed memory holds what the fleet knows, and it carries the value and the risk, because when it is wrong, nothing crashes.
How much does statefulness actually buy you?
Two measured things: it is cheaper, and it is more accurate, but less than you would guess from the marketing. Most content on this topic quantifies neither, which is why the numbers below are worth more than another list of benefits.
It cuts context tokens by roughly four-fifths
On Caura’s 500-question LongMemEval run, the median retrieved context handed to the reader was 22,410 tokens tokens against a 107,706 tokens-token full haystack. That is a 79.2% reduction in context tokens, or 75.4% counting every reader call in the pipeline. The full method and per-category breakdown sit in the LongMemEval benchmark write-up, alongside the committed result files.
Perfect memory is worth less than you expect
Here is the finding nobody writing about stateful vs stateless agents has surfaced. That same benchmark includes an oracle run, where the retrieval step is replaced with ground truth, and the reader gets exactly the right evidence every time. It scored 94.6%. The production retrieval path scored 92.2%.
The gap between them is 2.4 points, while the gap between oracle and perfect is 5.4. Read that as a budget. If your stateful agent is getting things wrong, the odds are better than two to one that the fault lies in how it reasons over what it retrieved rather than in the retrieval itself. Teams routinely spend a quarter tuning embeddings and reranking while the larger loss sits in the prompt and the reader model.
It changes what a new agent is worth on day one
A stateless agent added to a team starts from zero every time. A stateful one inherits what the fleet already established, which is the practical content of the agent cold-start problem. That is the compounding argument, and it is the honest reason to accept the costs below.
What breaks the day your agent becomes stateful?
Four things, in rough order of how often they bite. The first three appear in most serious writing on agent memory. The fourth rarely does, and it is the one that will surprise an experienced engineer.
Facts go stale while the run is still going
Caura’s long-run fleet reference exists to demonstrate exactly this. Three agents share one memory pool across fourteen simulated days, and on day nine a competitor’s price changes from $299 to $349 a month. Without lifecycle handling, every agent that recorded $299 keeps asserting it, and the daily brief stays confidently wrong. With contradiction detection, the superseded records transition to outdated and drop out of the default recall surface before the synthesis agent runs.
Stale state is not a rare edge case. Caura’s write-up of eToro’s governed company brain reports 3,716 conflicted memories identified and resolved during a single platform upgrade, and the business-side version of the same failure is the price changed, and your agents didn’t notice.
Two agents write over each other
Two agents read the same fact, both reason from it, both write back, and one write disappears. A stateless architecture cannot have this problem, which is genuinely a point in its favour. Once state is shared, you need writes scoped per agent or per run, and you need the check to happen at write time rather than in a prompt instruction.
A prompt rule is not a boundary
Caura’s own documentation is unusually honest here. In the cross-fleet governance reference, fleet isolation works because the fleet identifier becomes a WHERE clause applied before the hybrid search runs, so excluded memories are never loaded, never scored, and never returned.
The repository then states the limitation openly: in the self-hosted open-source deploy, the storage layer filters to whatever fleet the agent declares, and does not validate that declaration against the agent’s identity. A query-layer contract is not a cryptographic key. If an agent must be structurally unable to see something, that takes a tenant boundary or a trust tier, not a sentence in a system prompt. As Caura’s keystones post puts it, a rule that might not be in context is a hope, not a policy.
Your agent’s behaviour becomes a function of your memory layer’s version
A stateless agent is pinned by two things: its prompt and its model version. A stateful agent adds a third — the version of the memory server behind it. Change the server build and the same prompt, the same data and the same model can retrieve a different slice, because retrieval behaviour lives in the server, not the agent.
Caura’s own LongMemEval harness takes this seriously enough to record the exact server and plugin version in the results file for every run. The published 92.2% is pinned to a specific server build, not to Caura in general. That is the honest shape of a stateful benchmark: a number is reproducible for a given server build, and you cannot assume it carries across builds.
The implication is a real operational rule. A stateless agent is pinned by its prompt and its model version. A stateful agent is pinned by its prompt, its model version, and its memory layer’s version. If you evaluate a stateful agent, record the memory-layer build alongside the model, and re-run your evaluation when you upgrade it. Almost nobody does this today.
Does the answer change when you run more than one agent?
Yes, completely. Single-agent state is a storage question. Fleet state is a distributed-systems question, and the same four failure modes change character once several agents read the same rows.
Shared state replaces agent-to-agent messaging
When agents coordinate by passing messages, every handoff is a chance to drop context. When they coordinate through a governed store, the record is the handoff. Caura’s build fleet reference shows the mechanism concretely: the performance agent writes a “zero external JS” constraint, the SEO agent recalls it before acting and picks inline JSON-LD over a CDN schema library. No code wires those two agents together. The constraint propagates because the second agent reads what the first decided. Caura covers the general pattern in shared context without agents talking to each other.
Visibility becomes a permission, not a filter
In the same reference, the manager agent is read-only, and that is enforced by never handing it the write tool at the schema level rather than by instructing it not to write. Caura’s four trust levels generalise this: restricted, standard, cross-fleet read, and admin. The question stops being “can the agent find this fact” and becomes “is this agent permitted to find this fact”, which is a different system.
When should an agent stay stateless?
More often than vendors of memory layers tend to admit. Stay stateless when the work genuinely fits in one call: classification, extraction, translation, a single tool invocation, a code-review comment that needs no history. Keep it stateless when the facts your agent reasons over are authoritative somewhere else and can simply be fetched on demand. And keep it stateless when one agent does the work and never disagrees with itself, because most of the machinery above exists to resolve disagreements a single agent cannot have.
The test is a single question: does the next run need anything from the last one? If the answer is no, every layer you add is cost without benefit. Caura’s own posts on fleet memory name the same boundary, listing single-agent setups and small fleets that never conflict among the cases that should skip governed memory entirely.
How do you add state without inheriting all four problems?
Five steps, in this order. Doing them out of order is how teams end up with a memory store that nobody trusts.
- Decide what deserves to be written. Caura’s measurement of a production fleet found that 96% of what an agent logs for itself is disposable episodic telemetry. Writing everything is the same as writing nothing, because recall then returns noise.
- Move the write out of the model’s discretion. An agent that is asked to remember things will skip it under task pressure. Putting the write into the runtime that executes the agent turns it into a guarantee, which is the argument in deterministic versus agentic memory.
- Give every write a scope at write time. Private, fleet or organisation. Retrofitting visibility onto rows that were written without it is far harder than stamping it on the way in.
- Add contradiction detection before you add volume. Supersede stale facts rather than deleting them, so the lineage survives for audit and the current answer is unambiguous.
- Pin and re-evaluate the memory build. Record the memory-layer version in every evaluation run, and treat an upgrade as a reason to re-measure.
If you want to see all five running end to end rather than read about them, the engine is Apache 2.0 at github.com/caura-ai/caura, and the three fleet references above are runnable. Caura’s own two-week fleet pilot is scoped around one workflow and five to twenty agents, which is roughly the smallest setup where governed shared state pays for itself.
What to do next
You now have a sharper version of the stateful vs stateless question than the one the top-ranking pages pose. It is not whether to give your agent memory. It is which of the three state layers you actually need, whether your boundaries are enforced in the query or only in a prompt, and whether your evaluation records the memory build alongside the model.
The smallest useful first step takes an afternoon. Pick one agent that currently repeats work, instrument what it would have written, and look at how much of that log is genuinely reusable rather than telemetry. If the reusable share is small and the work is single-agent, stay stateless and save yourself four failure modes. If several agents are reading the same facts and those facts change while the work is running, you need state that is governed rather than merely stored, and that is the problem Caura was built to solve.
Frequently Asked Questions
Is an LLM stateful or stateless?
Stateless. The model holds nothing between calls. Anything that looks like memory in a chat interface is the surrounding application resending conversation history on every request, which is why longer conversations cost more rather than remembering more.
Is a stateful AI agent the same as an agent with memory?
Not quite. Memory is one kind of state. A stateful agent can also carry task state, meaning where it is in a workflow, and policy state, meaning the budgets and constraints it must respect. An agent can have excellent memory and still lose a run because its task state was not checkpointed.
Does a bigger context window make an agent stateful?
No. A larger window gives each stateless call more room to work in. It does not make anything survive the call. It also makes every call more expensive, which is the opposite of the 79.2% context-token reduction measured when retrieval replaces full replay.
Which is cheaper, stateful or stateless agents?
Stateful is usually cheaper per task once conversations run long, because you retrieve a relevant slice instead of replaying the whole history. Stateless is cheaper to operate, because there is no store to run, no lifecycle to maintain, and no governance to enforce. Short tasks favour stateless; long and repeated work favours stateful.
Can a stateful agent switch model providers?
The state can, if it lives outside the model. That is the practical argument for keeping memory in a provider-agnostic layer rather than in a vendor’s conversation object. Your reader model will change, probably more than once, and state written against one provider’s abstraction moves badly.
What is the single biggest mistake teams make when going stateful?
Treating a prompt instruction as a boundary. Scoping, access control, and the retirement of stale facts have to be enforced where the data is read. Anything enforced only in a system prompt holds right up until the run where the model does not follow it.
Related reading: Stateful AI Agents & Fleet State · Long-Term Memory Architectures · Stale Memory in Long-Running Fleets