Real customer conversations refuse to follow a flowchart. People disappear, return hours later, change their mind, provide half an answer and ask for a human at inconvenient moments.
Once an AI agent has to operate inside that reality, conversation memory is no longer enough. The product needs state.
Memory and state solve different problems
Memory helps a model understand what has already been said. State tells the application what is happening now and which transitions are valid next.
In a commerce flow, memory may contain a product preference. State records whether the system is still discovering requirements, waiting for an address, confirming an order or handing the thread to a person.
Keeping those responsibilities separate makes behaviour testable. It also stops the model from guessing the current stage of a workflow from a long transcript.
Model the interruptions
The happy path is usually obvious. The useful design work is in the interruptions:
- the customer stops replying midway through a flow;
- a required external service is temporarily unavailable;
- a message changes the intent of the conversation;
- confidence drops below an acceptable threshold;
- a human joins, resolves the issue and returns control.
Each interruption should lead to an explicit state with a recovery policy. The agent can then resume from durable facts instead of replaying the entire conversation and hoping for the same interpretation.
Human handoff is a product feature
A handoff should carry a concise summary, gathered fields, actions already attempted and the reason for escalation. The human should not have to reconstruct the conversation under pressure.
When automation resumes, ownership needs to be equally clear. A simple lease or mode flag can prevent the model and an operator from replying at the same time.
This does not make the agent less capable. It makes the surrounding system more dependable.
What I now optimise for
For real conversational products, I optimise for continuity over cleverness:
- Persist the smallest useful state.
- Make transitions observable.
- Treat failures as expected branches.
- Give humans enough context to act quickly.
- Resume without forcing the customer to repeat themselves.
The best agentic experience often feels uneventful. The conversation simply keeps moving, even when the underlying path is not straight. For the wider production framework around evaluation and failure handling, read Production AI begins after the demo.