define state --plain-english
State
TLDR:When you're mid-sentence in a draft email and your browser crashes, the draft is gone.
When you're mid-sentence in a draft email and your browser crashes, the draft is gone. The server didn't save it. That draft existed only in your browser's state — and the crash cleared it.
State is what the system remembers right now. Not what it has saved to disk. Not what's in the database. Right now, in this moment, with this session, in this running process — what does the system currently know?
The clearest analogy I've found: a whiteboard in the middle of a meeting. The whiteboard shows the current working picture — the diagram someone drew five minutes ago, the list of decisions made so far, the thing everyone's pointing at. That's state. It's not a permanent record. When the meeting ends and someone wipes the board, it's gone. The meeting minutes you type up and email out afterward are a different thing — that's saving to a database. The whiteboard itself is state.
Why this trips people up with AI.
"Stateless" sounds like a technical insult. It just means: when this process ends, nothing is remembered. Every new request starts from scratch, with a blank whiteboard. This is actually fine and often desirable for simple tasks — the process is clean, predictable, can't drift.
But an agent doing a multi-step task needs state. It needs to hold "step one is done, here's what I found, now doing step two" somewhere. If the process gets killed in the middle and the state wasn't saved somewhere durable, the agent wakes back up with no whiteboard. It doesn't know what it was doing. You start over.
The questions state makes you ask:
- Where does this system store its current working picture? Memory, a database, an external file?
- What happens if the process crashes before it's done?
- When I say "continue where you left off," where exactly is "left off" written down?
For any AI workflow that runs in steps over time, "how are we managing state?" is one of the most important questions to ask before you build it. The agent that loses track of what it was doing mid-task is almost always a state problem, not a model problem.
State is the whiteboard. Storage is the filing cabinet. You need both, and confusing them is where most of the headaches live.