Build long-running agents with Google’s Agentic Stack | The Agent Factory

By Google Cloud Tech

Share:

Key Concepts

  • Long-Running Agents: AI agents that maintain state across sessions and operate over extended periods (hours, days, or weeks) rather than disappearing after a single prompt.
  • ADK (Agent Development Kit) 2.0: A production-grade stack for building agentic workflows, featuring a graph-based runtime and CLI.
  • Durable State: The requirement that an agent’s progress is saved to a database (as an enum or schema) at every transition, ensuring resilience against crashes.
  • Event-Driven Dormancy: The ability for an agent to "sleep" (consume zero compute) and wake up only when triggered by external events like webhooks or human input.
  • Multi-Agent Delegation: A pattern where a coordinator agent delegates specific tasks to specialized sub-agents to maintain clean reasoning chains.
  • Cognitive/Comprehension Debt: The risk of engineers losing critical thinking skills and deep understanding of their codebase by over-relying on AI to generate and fix code.
  • AEO (Agent Engine Optimization): A framework for structuring documentation and content to be easily consumable and actionable by AI agents.

1. The Architecture of Long-Running Agents

Addie Osmani emphasizes that long-running agents represent a shift from "chatbots" to "workflow owners." To build these effectively, three core principles must be met:

  • True Dormancy: Agents must not use active polling or blocked threads. They must be fully at rest until an external event (webhook, schedule, or human approval) triggers them.
  • Durable Checkpointing: Every step must be persisted. If a container crashes, the agent must be able to resume exactly where it left off without hallucinating intermediate steps.
  • Separated Evaluation: Agents should not grade their own work. Research (e.g., from Anthropic) shows agents are overconfident in their own output. A robust setup requires a Planner, a Generator, and a separate Evaluator.

2. Real-World Applications & Demos

  • New Hire Onboarding: An agent manages a multi-week process: sending welcome packets, waiting for document signatures, coordinating IT provisioning, and confirming hardware delivery. The agent remains dormant between these "pause gates."
  • Autonomous Coding (ADIOS): Using the "goal primitive," an agent was tasked with building a functional operating system. It persisted over hours, handling complex tasks like window management, file system indexing, and even running a game (Doom) and music visualizers.
  • 3D Scene Optimization: An agent was used to optimize a 156MB Blender file for browser use. It autonomously wrote Python scripts to handle Draco quantization, compressed glTF assets, and adjusted lighting intensities to ensure the scene was performant and visually faithful.

3. The "Beyond VIP Coding" Philosophy

Osmani addresses the tension between AI-assisted productivity and the potential loss of engineering craft:

  • The 80/20 Rule: Agents can handle 70–80% of a task, but the final 20–30% requires human judgment and deep understanding.
  • Cognitive Surrender: A major risk where developers stop thinking critically and blindly accept AI output. Osmani warns that if an agent fails, a developer who has "surrendered" their understanding of the codebase will be unable to debug or maintain the system.
  • Maintenance vs. Velocity: High-quality software requires more than just fast output; it requires rigorous testing (visual regression, unit tests) and intentional code review processes.

4. Agent Engine Optimization (AEO)

Osmani introduces AEO as the "SEO of the agentic era."

  • Purpose: It provides a standard for making documentation and interfaces machine-readable.
  • Application: If a company builds developer tools, AEO is critical so agents can "read" the documentation and build on behalf of the developer. For general content, standard web best practices (accessibility, load speed) remain the priority.

5. Synthesis and Conclusion

The transition to long-running agents marks a move toward "Agentic Engineering," where the unit of work is a multi-step, persistent workflow rather than a single prompt. While these tools offer massive productivity gains, Osmani stresses that the human role is shifting from "writer" to "architect and evaluator." Developers must remain vigilant against cognitive debt, ensuring they understand the "Lego bricks" of their systems even as they leverage agents to accelerate the construction process. The future of development lies in balancing the high velocity of AI agents with the stable, reliable judgment of human engineers.

Chat with this Video

AI-Powered

Load the transcript when you're ready to chat so the initial page stays lighter.

Ready to summarize another video?

Summarize YouTube Video