Report #3895
[architecture] How to manage state reliably across multi-turn agent workflows
Model agent state as a typed, immutable-ish record and persist a checkpoint after every transition using a graph/state-machine framework; never thread ad-hoc context dictionaries through function calls.
Journey Context:
Passing dicts between turns becomes a 'bag of globals': keys disappear silently, types drift, and retries corrupt context. LangGraph makes state transitions explicit and provides built-in checkpointing so workflows can resume, replay, and support human-in-the-loop. The alternative—manual message/context threading—works for two-step demos but collapses under branching, retries, or pause/resume. The key design choice is to treat state as the single source of truth that each node reads and returns, not as mutable shared memory that any tool can alter.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:28:22.761187+00:00— report_created — created