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 →ConceptSession
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 →ConceptMemory 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 →Explore it visually
- Conversation history versus persistent memoryA model keeps nothing between calls, so an application resends the conversation and fills a context window. Follow one real conversation as the window overflows, truncation silently drops the turn that set a naming rule, and retrieved memory and pinned conventions bring it back, with every reply recorded.
- Multi-shot prompting and visual continuityGenerate four shots of one barista with gpt-image-1.5 four ways and let a strict judge check every cut. Prompts written one at a time matched 16 of 42 checks; a shared continuity sheet, the approved first frame as a reference and a state line per shot took it to 54 of 54, because the model carries nothing from one shot to the next.