> Canonical URL: https://codingcat.dev/post/gemini-4-neon-antigravity-swarm-multi-agent-teams

# Gemini 4 Neon & Antigravity /swarm: Building Multi-Agent Teams That Actually Ship

✏️ Blog PostNovember 30, 2026[#AI & Agents](/topic/ai)[![](/logos/tags/gemini-symbol-light.svg)![](/logos/tags/gemini-symbol-dark.svg)Google Gemini](/topic/gemini)[![](/logos/tags/typescript-symbol-light.svg)![](/logos/tags/typescript-symbol-dark.svg)TypeScript](/topic/typescript)[![](/logos/tags/astro-symbol-light.svg)![](/logos/tags/astro-symbol-dark.svg)Astro](/topic/astro)

# Gemini 4 Neon & Antigravity /swarm: Building Multi-Agent Teams That Actually Ship

![Alex Patterson pointing toward a Gemini 4 Neon /swarm architecture diagram with Neon Coordinator, Hydrogen Workers, Git Worktrees, Shared Board, and Verifier Pass](https://cdn.sanity.io/images/hfh83o0w/production/8be5ea4a5765fde0be2e47855c28188d0be1d3d5-1376x768.jpg?w=1376&q=82&fit=max&auto=format)[![Alex Patterson](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/a606dfaa381aab08ddbe16a33fe1d3e1fb37c927-400x400.jpg?w=96&h=96&q=82&fit=max&auto=format)Alex Patterson](/author/alex-patterson)

One agent is a loop. A **swarm**  is many loops held together by a protocol. If you have ever watched a single AI coding agent burn 120k tokens bouncing between a parser, an API route, and a broken test suite while hallucinating that everything passed, you already know why single-agent loops hit a wall on real features.

In November 2026, Google shipped that multi-agent protocol as a first-class product inside Google Antigravity: `/swarm` paired with **Gemini 4 Neon**  as the default planner and coordinator, directing parallel **Gemini 4 Hydrogen**  workers with isolated git worktrees and an independent `@verifier`. In this deep dive, we break down how Antigravity's `/swarm` actually works under the hood, let you step through a live interactive simulation right inside this post, and then build the exact same Planner, Fan-Out, and Checker Loop in TypeScript with `@google/genai` and Python with Google ADK.

## 1. The Mental Model: How Antigravity /swarm Works

When you type `/swarm ` in the Antigravity App or `agy` CLI, your active conversation stops editing files and becomes the **Coordinator**. Instead of cramming an entire repo into one giant context window, the swarm splits work into four distinct roles coordinated over an append-only **Shared Message Board**:

- **Coordinator (Gemini 4 Neon, thinking: high): ** Never edits code directly. Splits the goal into non-colliding file lanes, posts public briefs on the board, sleeps (0 tokens) while workers run, and returns one verified summary at the end.
- **Workers (Gemini 4 Hydrogen, low or medium): ** Each worker starts in a clean context window and, when edits could overlap, its own isolated `git worktree`. Workers only see their brief and their lane, post questions or diffs, and sleep at 0 tokens once they post `[done]`.
- **Verifier (1 per 2 to 4 workers, separate model): ** Reads actual git diffs and reruns tests on a different model (such as Gemini 4 Carbon or Neon high). Never trusts a worker's self-reported `[done]`. Rejects failing claims directly back to the author so only that lane reruns.
- **Monitor (@monitor watchdog): ** Stays completely silent (0 tokens) while the swarm is healthy. Speaks only if every member goes quiet or deadlocks.

## 2. Interactive Walkthrough: Step Through a Live /swarm Run

Press Play or step forward below to watch a real CodingCat.dev Astro feature run through /swarm. Click any agent card or Shared Message Board entry to inspect its git worktree, thinking level, diff payload, and live token cost.

Gemini 4 Neon · Live Protocol

### Interactive Antigravity /swarm Simulator

Watch Gemini 4 Neon plan 3 isolated lanes, fan out to Hydrogen workers in git worktrees, catch a buggy test assertion via @verifier, and ship a verified merge.

Step1 / 8Est. Cost$0.042Tokens6.0kagy>`/swarm Add a typed /api/bookmarks endpoint with Astro parser, Zod validation, and integration tests`1/8·$0.042Speed:

Step 1: The developer runs /swarm. Your conversation becomes the Gemini 4 Neon Coordinator, splits the feature into 3 non-colliding lanes, and posts briefs to the append-only board.

#### Swarm Topology

ActiveWaiting (0 tok)Reject@coordinator (Gemini 4 Neon · high)

Never edits code. Splits /api/bookmarks into 3 isolated lanes and posts briefs #1 to #3.

Worktree: main (read-only) · Cost: $0.042

#### Shared Message Board (Append-Only)

@name · @allLive Inspector:@coordinator (Gemini 4 Neon · high)Worktree: main (read-only) · Cost: $0.042

```
// Coordinator Plan Output (Structured JSON)
{
  "lanes": [
    { "worker": "@parser",    "owns": "src/lib/bookmarks-parser.ts",  "worktree": "wt/parser" },
    { "worker": "@api-route", "owns": "src/pages/api/bookmarks.ts",   "worktree": "wt/api-route" },
    { "worker": "@api-tests", "owns": "tests/api/bookmarks.test.ts",  "worktree": "wt/api-tests" }
  ]
}
```

Tip: Click any agent card or Shared Message Board row to inspect its git worktree, thinking level, and cumulative USD cost.

## 3. Picking the Right Gemini 4 Model for Each Seat

The cheapest swarm is the one where every seat runs the smallest model that meets your quality bar. Per token, Neon costs double Hydrogen, yet Google reports 32% lower cost per finished task than Carbon at high thinking because Neon plans cleanly and avoids wasted retries.

ModelSwarm SeatDefault ThinkingAPI Price (In / Out per 1M)Why It FitsGemini 4 NeonCoordinator / Planner / Mergerhigh$3.00 / $15.00 ($0.15 cached)Reads fewer files twice, lowest fabrication rate, handles long tool-heavy plans.Gemini 4 HydrogenParallel Workerslow or medium$1.50 / $7.50Half Neon's per-token cost; ideal for narrow scoped edits, parsers, and test suites.Gemini 4 CarbonVerifier / Hardest Architecture Stephigh or medium$4.00 / $20.00 (post-Nov 30)Separate model tier for independent verification or brutal long-horizon debugging.

> AJ Pro-Tip on Thinking Tokens: Thinking tokens are billed as output tokens. In published benchmarks, Neon at `high` can spend 80% to 90% of its output bill on thinking tokens. Leave the Coordinator and Verifier on `high`, drop simple workers to `low`, and never pass `temperature`, `top_p`, or `top_k` to Neon (in-range values are ignored and out-of-range values return a 400 error).

## 4. Antigravity /swarm vs. Building Your Own Swarm

Use Antigravity's built-in /swarm when the work lives in your codebase and you want to steer live. Drop down to the Gemini API or Google ADK when the swarm runs headless inside your own product or on a schedule.

DimensionAntigravity /swarm (App & agy CLI)DIY Gemini API (@google/genai) / Google ADKBest ForCodebase features, refactors, live human-in-the-loop reviewHeadless product pipelines, scheduled jobs, custom SaaS backendsOrchestrationBuilt-in Coordinator, Shared Board, git worktrees, @monitorYou control Planner JSON, concurrency semaphore, and Checker loopObservabilitySwarm UI side pane, Board / Members / Graph, Alt+S in CLICustom logs, adk web event viewer, Cloud ObservabilityCost ControlGoogle AI Pro / Ultra subscription quotasExact per-run USD budget cap in shared state + 95% prefix caching

## 5. Build the Same Swarm in TypeScript (@google/genai)

Every production swarm reduces to three clean patterns: a typed Planner, an async Fan-Out / Fan-In worker pool with a concurrency cap, and a bounded Checker Loop. Here is the complete TypeScript implementation using the official @google/genai SDK.

Copied! 🐾📄 src/swarm/planner-and-fanout.tstypescript

```
// src/swarm/planner-and-fanout.ts
import { GoogleGenAI, Type } from "@google/genai";

const ai = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY! });

interface SwarmTask {
  id: string;
  brief: string;
  inputs: string[];
  outputShape: string;
  thinkingLevel: "low" | "medium";
}

interface Verdict {
  ok: boolean;
  problems: string[];
  redoTaskIds: string[];
  askHuman: boolean;
}

export async function planTasks(goal: string): Promise {
  const res = await ai.models.generateContent({
    model: "gemini-4-neon",
    contents: `You lead a team of fast worker agents.
Split this goal into 3 to 6 independent, non-colliding tasks.
Goal: ${goal}`,
    config: {
      thinkingConfig: { thinkingLevel: "high" },
      responseMimeType: "application/json",
      responseSchema: {
        type: Type.ARRAY,
        items: {
          type: Type.OBJECT,
          properties: {
            id: { type: Type.STRING },
            brief: { type: Type.STRING },
            inputs: { type: Type.ARRAY, items: { type: Type.STRING } },
            outputShape: { type: Type.STRING },
            thinkingLevel: { type: Type.STRING },
          },
          required: ["id", "brief", "inputs", "outputShape", "thinkingLevel"],
        },
      },
    },
  });

  return JSON.parse(res.text ?? "[]") as SwarmTask[];
}

async function runWorker(task: SwarmTask): Promise {
  const res = await ai.models.generateContent({
    model: "gemini-4-hydrogen",
    contents: `Do ONLY this scoped task.
Task: ${task.brief}
Inputs: ${JSON.stringify(task.inputs)}
Return only: ${task.outputShape}`,
    config: {
      thinkingConfig: { thinkingLevel: task.thinkingLevel },
    },
  });
  return [task.id, res.text ?? ""];
}

export async function runCheckedSwarm(goal: string, maxRounds = 2): Promise {
  const tasks = await planTasks(goal);
  const results = new Map(
    await Promise.all(tasks.map((task) => runWorker(task)))
  );

  for (let round = 0; round  verdict.redoTaskIds.includes(t.id));
    const retried = await Promise.all(toRedo.map((t) => runWorker(t)));
    for (const [id, text] of retried) {
      results.set(id, text);
    }
  }

  return `NEEDS HUMAN REVIEW after ${maxRounds} checker rounds.`;
}
```

## 6. The Same Swarm in Python with Google ADK

If you would rather not hand-roll async orchestration and session state, Google's open-source Agent Development Kit (ADK) gives you ParallelAgent, SequentialAgent, and LoopAgent out of the box, plus adk web to inspect every agent event in your browser.

Copied! 🐾📄 swarm_adk.pypython

```
# swarm_adk.py
from google.adk.agents import LlmAgent, ParallelAgent, SequentialAgent

def make_worker(name: str, focus: str) -> LlmAgent:
    return LlmAgent(
        name=name,
        model="gemini-4-hydrogen",
        instruction=(
            f"Research only {focus} for the requested goal. "
            "Return 5 concise bullet points with verified sources."
        ),
        output_key=name,  # Saved directly into shared session state
    )

team = ParallelAgent(
    name="worker_team",
    sub_agents=[
        make_worker("pricing", "pricing"),
        make_worker("features", "features"),
        make_worker("reviews", "developer reviews"),
    ],
)

merger = LlmAgent(
    name="neon_merger",
    model="gemini-4-neon",
    instruction=(
        "Merge {pricing}, {features}, and {reviews} into one crisp brief. "
        "Explicitly flag any claim that lacks a source."
    ),
)

root_agent = SequentialAgent(name="neon_swarm", sub_agents=[team, merger])
```

## 7. What One Production Swarm Run Actually Costs

Swarm pricing is simple arithmetic once you count tokens per seat. Putting Neon on the seats that plan and verify while Hydrogen handles high-volume worker calls keeps a full 8-worker checked run under 50 cents before prompt caching.

SeatModelInput TokensOutput + Thinking TokensEst. CostPlannerGemini 4 Neon8,0004,000$0.0848 Parallel WorkersGemini 4 Hydrogen8 x 6,0008 x 1,500$0.162MergerGemini 4 Neon20,0005,000$0.135Verifier / CheckerGemini 4 Neon15,0003,000$0.090Total (1 Checked Run)Mixed Fleet91,00024,000$0.471

## 8. Verdict: Purrfect or Pass?

**Purrfect ** for any task that cleanly splits into independent lanes: multi-file feature builds, test coverage sweeps, migration codemods, and parallel research. **Pass ** when step 3 strictly depends on step 2's output (that is a sequential pipeline, not a swarm) or when a single 2-file edit takes 15 seconds in one agent loop. Put hard caps on task counts, retry rounds, and per-run dollar budgets in code, and never skip the independent `@verifier`.

**Sources & Further Reading: ** Google's November 2026 *Introducing Gemini 4 Neon* launch announcement, Antigravity `/swarm` documentation, Google Agent Development Kit ([github.com/google/adk-python](https://github.com/google/adk-python)), and [@zodchiii's](https://x.com/zodchiii/status/2126357182698356901) practitioner working note on Gemini 4 Neon AI Agent Teams.

✏️ Visual Architecture Diagram

## how this post connects together.

Follow AJ through the state machine topology from input contract to production output.

Let’s build it!✏️ Architecture Diagram: Gemini 4 Neon & Antigravity /swarm: Building Mul…STATE MACHINE & LOOPARCHITECTURE DIAGRAM[Diagram Walkthrough]Content-driven state-machine diagram for Gemini 4 Neon & Antigravity /swarm: Building Multi-Agent Teams That Actually Ship: Gemini 4 Neon -> Antigravity /swarm -> Building Multi-Agent Tea.AAA Contrast Verified▶ Watch on @CodingCatDev YouTubeRelated Course & Video

## Watch the Related Video Deep Dive: Cloudflare Agents, Durable Objects & Stateful Workflows in TypeScript

Build stateful, long-running AI agents and resilient multi-step workflows using the Cloudflare Agents SDK, Durable Objects with embedded SQLite, WebSockets hibernation, and Workflows.

[View Full Page →](/course/cloudflare-agents-durable-workflows-typescript)![](https://cdn.sanity.io/images/hfh83o0w/production/d1afde44cc19c93fb4a68cfa428d5ff35009a7ca-1376x768.png?rect=6,0,1365,768&w=1920&h=1080&q=82&fit=max&auto=format)[@CodingCatDev62.5K / 100K Subscribers Goal](https://www.youtube.com/@codingcatdev?sub_confirmation=1)[Subscribe on YouTube→](https://www.youtube.com/@codingcatdev?sub_confirmation=1)[Watch on YouTube App ↗](https://www.youtube.com/watch?v=0GrZo2jxbUo&list=PLR0ZSOt97grA)

## related deep dives.

[All Blog Posts&rarr;](/blog)[![Gemini Decisions API vs. TypeSafe Jev vs. Cloudflare Clef: System One Routing in Production](https://cdn.sanity.io/images/hfh83o0w/production/ef0168a3852d4ce2eafed69a169efd8006e7f36c-1024x571.jpg?w=1024&q=82&fit=max&auto=format)](/post/gemini-decisions-api-vs-jev-vs-clef)November 14, 2026[#AI & Agents](/topic/ai)[![](/logos/tags/gemini-symbol-light.svg)![](/logos/tags/gemini-symbol-dark.svg)Google Gemini](/topic/gemini)[![](/logos/tags/cloudflare-symbol-light.svg)![](/logos/tags/cloudflare-symbol-dark.svg)Cloudflare](/topic/cloudflare)[+3](/post/gemini-decisions-api-vs-jev-vs-clef)

### [Gemini Decisions API vs. TypeSafe Jev vs. Cloudflare Clef: System One Routing in Production](/post/gemini-decisions-api-vs-jev-vs-clef)

Stop paying autoregressive LLMs to flip boolean switches. Compare Gemini Decision 1, TypeSafe Jev, and Cloudflare Clef for sub-250ms calibrated routing.

[![Alex Patterson](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/a606dfaa381aab08ddbe16a33fe1d3e1fb37c927-400x400.jpg?w=96&h=96&q=82&fit=max&auto=format)Alex Patterson](/author/alex-patterson)[![Blender MCP: Letting AI Agents Build, Rig & Render Your 3D Scenes](https://cdn.sanity.io/images/hfh83o0w/production/1e3036650fdccf7ba81dfd68a1203a70933016bc-1376x768.png?w=1376&q=82&fit=max&auto=format)](/course/blender-mcp-agentic-3d-scenes)November 4, 2026[![](/logos/tags/typescript-symbol-light.svg)![](/logos/tags/typescript-symbol-dark.svg)TypeScript](/topic/typescript)[#AI & Agents](/topic/ai)[![](/logos/tags/threejs-symbol-light.svg)![](/logos/tags/threejs-symbol-dark.svg)Three.js](/topic/threejs)[+1](/course/blender-mcp-agentic-3d-scenes)

### [Blender MCP: Letting AI Agents Build, Rig & Render Your 3D Scenes](/course/blender-mcp-agentic-3d-scenes)

Wire ahujasid/mcp-for-blender into Claude Code and Google Antigravity so your agent can inspect 3D scene hierarchies, execute Python bpy code, and verify 3D AJ renders.

[![Alex Patterson](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/a606dfaa381aab08ddbe16a33fe1d3e1fb37c927-400x400.jpg?w=96&h=96&q=82&fit=max&auto=format)Alex Patterson](/author/alex-patterson)