Stateless vs Stateful
Stateless vs stateful LLM architectures: trade-offs for agent design, conversation management, and production deployment.
Last updated
After this section you can
- Explain why a conversation is the full messages array re-sent every turn, and estimate how its tokens and cost grow
- Choose where the transcript lives (client, your store, provider session) and defend the choice
- Spot the in-process state trap and describe the load, call, save pattern that fixes it
Stateless vs Stateful: Where Conversation State Lives
The model forgets everything the moment it answers. A chat that seems to remember is your code re-sending the conversation every turn, so the real design question is where that conversation lives in between.
The model and the API you call (for Claude, the Messages API) keep nothing between calls. A conversation is the messages array you send in full on every turn. Pick one place to keep that array between turns, and keep your servers free of it.