5 Architectures for Building Long-Running AI Agents, from Stateful Graphs to Task Queues
goyalshaliniuk · x · 2026-11-09
Most AI agents are built to finish one task and return. For agents that must run for hours, days, or weeks — ongoing research, business monitoring, project management — you need architecture that preserves state, recovers from failures, and keeps working over time. The author outlines 5 patterns:
- Stateful graph: model the workflow as a graph of steps with state and checkpoints (e.g. LangGraph) so agents can pause, resume, and revisit decisions.
- Durable workflow: break work into durable activities, persist execution history, retry with policies (e.g. Temporal) so crashes don't lose progress.
- Event-driven: trigger agent workflows from API/database/message-broker events, process asynchronously (e.g. Kafka) instead of constantly burning model calls.
- Supervisor–worker: a supervisor decomposes goals, specialized worker agents execute and report back (e.g. CrewAI), keeping coordination centralized.
- Queue-based distributed: durable message queues with independent workers, retries, and dead-letter queues (e.g. Celery) for hundreds to thousands of tasks.
Each pattern comes with a linked reference implementation.
Related event: Five Architectures for Long-Running AI Agents and How to Choose(7 posts)→
More from coding & agent
- Real-world coding agent benchmark: best model fully solves only 26.4% of tasks — emmanuelvivier · 2026-11-09
- NVIDIA open-sources Auto Ontology to fix text-to-SQL's biggest problem — Roger_M_Taylor · 2026-11-09
- Getting Omarchy running on Snapdragon Surface Pro: custom kernel plus SSH tunnel for OpenClaw — vincent_koc · 2026-11-09
- Resurfacing in Obsidian: Random Notes, Review Queues and Related Notes — dSebastien · 2026-11-09
- One prompt edit made an agent burn $133 on 21 rogue calls — and the 3 gates that fixed it — Worth_Wealth_6811 · 2026-11-09
- Solo dev adds read-only MCP connector so Claude and ChatGPT can query your food diary — Content-Two5729 · 2026-11-09