Providers & requests

Stateful

Stateful describes anything that keeps state across requests: conversation history, memory, a session. In an agent that job belongs to the harness or app, never to the stateless model API.

James Phoenix
Understanding Data Updated July 2, 2026

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.

Note
Stateful and stateless are two halves of the same design. A stateless model kept simple and predictable, wrapped in a stateful harness that supplies memory, is what makes a reliable agent possible.

Related terms

Building with AI agents?

This dictionary is part of how I think about agentic engineering. If you want the same thinking applied to your codebase, that is what I do.

See how I can help