Build Long-running AI Agents that Pause, Resume, and Never Lose Context with ADK
Google Developers Blog on using adk to build durable-agents — turning agents from stateless chatbots into production background processes that run for days/weeks, pause, and resume without losing context. The key move: separate workflow state from conversation history.
Mechanisms
- Durable state machines — explicit state schemas with named checkpoints; “the agent can’t skip a step or hallucinate progress because the state machine enforces the sequence.” Current state vars are injected into the prompt so the model always knows its position.
- Persistent session storage — ADK’s
DatabaseSessionServicebacks sessions with SQLite (local) / Cloud SQL (prod); every tool call durably writes state, so a crash mid-workflow resumes from the right checkpoint. - Event-driven resumption — webhooks fire
state_deltatransitions that wake dormant agents;run_asyncatomically applies the transition before the next inference (no polling/blocked threads). - Multi-agent delegation — focused sub-agents prevent prompt bloat over long workflows (agent-orchestration).
Why it belongs here
The deepest treatment so far of agent durability — the durable-agents concept. Use cases: HR onboarding (weeks), invoice disputes (days), sales sequences — all human-in-the-loop with long idle gaps. Extends adk beyond skills (adk-agents-with-skills) into stateful, resumable execution; the durable counterpart to the self-driven heartbeat model in claude-code-channels-vs-openclaw. (Caveat: vendor tutorial.)
Related
durable-agents · adk · google · agent-orchestration · adk-agents-with-skills