ANTIGRAVITY LABJP
Articles/Agents & Manager
Agents & Manager/2026-04-27Advanced

Building Multi-Agent Systems with AgentKit 2.0 in Antigravity — A Production Implementation Guide

AgentKit 2.0 dropped the barrier to multi-agent systems sharply. After implementing three different agent-coordination patterns in Antigravity, here's the design playbook covering decisions, traps, and production operation.

AgentKit 2.013Multi-Agent12Antigravity321Agent Design6Implementation Guide2

Premium Article

My first reaction when AgentKit 2.0 landed was, "wait, they actually simplified this."

In the 1.x days, orchestrating multiple agents meant fishing the OpenAI API directly, hand-managing message flows between them, the whole thing felt like "will this even work?" territory. I implemented three multi-agent patterns on Antigravity, and that was the moment it clicked — AgentKit 2.0 absorbs a lot of the complexity you used to carry yourself.

This guide walks you from design philosophy through three real patterns, into the production nightmares you'll actually hit. By the end you'll know how to ship multi-agent systems that don't just work in demos.

Why AgentKit 2.0 Matters: The 1.x to 2.0 Shift

First, understand what 2.0 fixed.

Version 1.x treated you to a "magic agent" API — declare what you want, trust the LLM. You built control-flow blind. Version 2.0 flipped the model: explicit control surfaces.

AgentKit 2.0 breaks orchestration into three clear layers:

  • Agent — single-purpose execution unit. "search for product info" or "request user approval," each fully scoped
  • Workflow — choreography recipe. "search first, then route results to approval" — you own the graph
  • Coordinator — system supervisor. Multiple workflows go parallel, one component orchestrates them safely

The moment you internalize this three-layer mental model, complex multi-agent systems become as predictable as a test spec.

The 1.x approach left control implicit. You were hoping the LLM made the right choice. 2.0 hands the control back to you. That's the revolution.

The Three Core Abstractions: Agent, Workflow, Coordinator

This section is make-or-break for mastering AgentKit 2.0.

Agent — Single Responsibility in Code

An Agent is one thing, done very well.

import { Agent } from '@google-cloud/agentkit';
 
const researchAgent = new Agent({
  name: 'researcher',
  systemPrompt: 'You are a product researcher. Find detailed information about the given product from web sources.',
  tools: ['search', 'summarize'],
  maxIterations: 5,
  timeoutMs: 30000,
});
 
const result = await researchAgent.execute({
  input: 'Research the Antigravity April 2026 update in detail',
});

Three things matter here:

1. Explicit Tool Declaration The Agent declares tools: ['search', 'summarize']. This isn't about capability — it's about guardrails. The LLM won't try to write files or launch deployments, because you didn't grant those powers. That cuts hallucinations and costs.

2. timeoutMs Is Non-Negotiable Agents that do web/API work need real timeouts. 30s is sane. Too high and you get zombie agents locking up the whole system. Too low and they never finish. This becomes your first production tuning knob.

3. maxIterations Caps Thinking This is the "how many times can the Agent loop on itself?" limiter. Default is 10. For decision-making agents (approval, risk assessment), drop to 3–5. Prevents infinite deliberation spirals.

Workflow — Graphs, Not Pipelines

Workflows compose Agents as a directed graph, not a linear pipeline.

import { Workflow, Edge } from '@google-cloud/agentkit';
 
const multiAgentWorkflow = new Workflow({
  name: 'product_review_workflow',
  agents: {
    research: researchAgent,
    fact_check: factCheckAgent,
    summarize: summarizeAgent,
  },
  edges: [
    new Edge('research', 'fact_check', (output) => output.length > 1000),
    new Edge('fact_check', 'summarize', () => true),
  ],
});
 
const result = await multiAgentWorkflow.execute({
  input: { product: 'Antigravity IDE' },
});

Key design choice: conditional edges.

The third argument to Edge is a predicate. (output) => output.length > 1000 means "only route to fact_check if research gave us substantial output." Skip it otherwise. That's how you encode branching logic.

Current AgentKit 2.0 Workflows are strictly linear when executing. Parallel fan-out goes to Coordinator. This constraint makes debugging far easier — you can trace execution sequentially.

Coordinator — Meta-Level Control

When you need multiple Workflows running concurrently, or one Workflow deciding which other Workflow to spawn, Coordinator handles that.

import { Coordinator } from '@google-cloud/agentkit';
 
const coordinator = new Coordinator({
  workflows: {
    review: multiAgentWorkflow,
    approval: approvalWorkflow,
  },
  maxConcurrent: 3,
  onConflict: 'halt',
});
 
const results = await coordinator.executeAll({
  inputs: [
    { product: 'Antigravity' },
    { product: 'Cursor' },
    { product: 'VS Code' },
  ],
});

maxConcurrent: 3 — sanity check. Don't run unlimited Workflows. API rate limits and LLM token quota are real. 2–3 is practical for most deployments.

onConflict: 'halt' vs 'delegate' — when two Workflows collide on the same resource (shared DB, API rate limit), what happens? halt stops and reports (safe). delegate has Coordinator auto-order them (fast, but complex). Start with halt.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
When to reach for each of AgentKit 2.0's three core abstractions (Agent / Workflow / Coordinator) becomes obvious after reading the design patterns — you'll recognize them in your own architecture challenges
Full implementation code for three patterns I shipped: parallel research, sequential approval chain, and hierarchical supervisor — all copy-paste ready and tested in production
Production failure modes (timeouts, infinite loops, runaway costs) and the mitigations that actually held up — specific code patterns you can adopt today to protect yourself
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Antigravity Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Agents & Manager2026-04-23
Production Multi-Agent Systems with Antigravity AgentKit 2.0: Patterns, Failure Modes, and What the Demos Don't Show
AgentKit 2.0 makes multi-agent systems look effortless in demos, but running them in production is a different problem. This guide covers Planning vs. Fast mode, three real orchestration patterns, and the failure modes — infinite loops, cost blowouts, prompt injection — that bite on day one.
Agents & Manager2026-04-07
Orchestrating a Team of Specialist Agents Solo: Practical Multi-Agent Design in Antigravity
Master multi-agent development in Antigravity. Deep dive into Manager Surface architecture, specialist agent design, AGENTS.md configuration, common patterns, and production deployment strategies for enterprise-grade systems.
Agents & Manager2026-04-05
Building Next-Generation AI Agents on Antigravity with AgentKit 2.0
A comprehensive guide to building AI agents with AgentKit 2.0 in Antigravity. Covers the 16 specialized agents, the Orchestrator, Planning vs Fast mode, and practical implementation patterns.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →