CORE GUIDE
Conversation state
Conversation state is application-owned structured state about what the interaction is doing now; it should not be confused with raw chat history, model memory or whatever happens to fit in the context window.
Mental model
State records durable facts needed to continue the workflow: current intent, collected fields, pending actions, approvals, tool results and unresolved questions. History is evidence that may help reconstruct state, but it is not the state contract itself.
Why it matters
Multi-turn applications fail when each model call must infer workflow state from prose. Long histories become expensive, hidden assumptions accumulate, and a summary mistake can silently change business logic. Explicit conversation state makes continuity testable, resumable and independent of one model call's interpretation.
01
Separate workflow state from conversational evidence
Define a schema for the facts the application must preserve across turns. Update it only through explicit transitions after validating model or tool outputs. Keep raw messages for audit and retrieval, but render only the relevant state plus selected history into the next context. Version important state so resume, rollback and migrations remain possible.
02
Example: booking flow restarts after a long detour
A travel assistant collects destination, dates and budget, then the user asks several unrelated questions. If the app relies on chat history, the next model call may forget which fields are confirmed. A structured state object preserves confirmed values and pending fields, while the detour remains optional conversational context.
Common failure modes
- Using the entire chat transcript as the only source of workflow truth.
- Letting model-generated summaries mutate critical business state without validation.
- Storing every conversational detail as durable state even when it has no future effect.
Engineering heuristics
- Model conversation state explicitly when later actions depend on it.
- Keep raw history as evidence, not as the primary state machine.
- Validate transitions and version consequential state.
Takeaways
- 01State belongs to the application, not to the model's hidden memory.
- 02Structured state makes multi-turn behavior testable and resumable.
- 03History can inform state without becoming the state contract.
Reading evidence
This records actions you actually took; it does not claim mastery, proficiency, or certification.
Used in
This Concept is reused across these canonical learning paths.