Report #48103
[frontier] Long-lived agent accumulates state in memory, becomes unpredictable, can't be restarted or scaled, and loses everything on crash
Make agents ephemeral and stateless: create a fresh agent instance per task or turn, hydrating state from an external store before execution and persisting it back after. The agent is a pure function of \(instructions, state, input\) → \(actions, new\_state\).
Journey Context:
The intuitive mental model is a long-lived agent like a human employee who accumulates context over time. In production, this is catastrophic: behavior drifts as context grows, crashes lose all state, you can't horizontally scale, and you can't replay or inspect past decisions. The emerging pattern externalizes all state into a checkpointed store \(database, state machine, LangGraph checkpoint\). The agent is disposable—you can kill it, restart it, or run multiple instances. This is analogous to twelve-factor app principles applied to agents. Tradeoff: you must explicitly model your state schema and handle serialization, which is upfront design work. But it pays off immediately in debuggability \(you can inspect any past state\), reliability \(crash recovery is trivial\), and scalability \(spin up N agents for N tasks\). People get this wrong by storing state in global variables or class instances. The right call: state is a serializable dict, persisted after every meaningful action, loaded fresh at every invocation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T11:13:02.988362+00:00— report_created — created