Something is stateful when it remembers. It holds on to information across requests instead of starting fresh each time. The important twist for AI coding is where that memory actually lives. The model API is stateless; it forgets everything between calls. So every stateful behaviour you experience is provided by the software around the model, not the model itself.
The harness holds the state
When an agent seems to remember what you said, or picks up a project the way you left it, that continuity is engineered:
- Conversation history. The client keeps the running transcript and resends it, which is what makes a session feel continuous.
- A [memory system](/ai-coding-dictionary/memory-system). Facts written to a file or database and reloaded into context on demand give an agent something like long-term recall.
- Working files and project state. The filesystem itself is durable state the agent reads back on the next run.
Why keeping the split clear matters
Blurring this line leads to bad mental models and real bugs. If you assume the model remembers, you will be surprised when it does not. If you understand that state is the harness's job, you know exactly where to look when memory goes wrong: the code that stores and reloads context, not the model. It also means the state is inspectable and fixable, because it lives in files and databases you can open, not locked inside frozen parameters.
Related terms
Stateless
Stateless means the model API keeps no memory between requests. Each call starts blank, so every request must carry all the context the model needs. This is foundational to how agents are built.
Read definition →Session
A session is one continuous conversation with an agent that accumulates history in the context window. Resetting or ending it clears that history and starts the agent from a blank slate.
Read definition →Memory system
A memory system is an external store the harness uses to persist facts across sessions and reload them into context. It is how a stateless model ends up behaving as if it remembers you and your project.
Read definition →