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

> Source: <https://codingcat.dev/post/gemini-4-neon-antigravity-swarm-multi-agent-teams>
> Published: 2026-11-30 05:11:19+00:00

**Key takeaway:** Antigravity's /swarm assigns each Gemini 4 Hydrogen worker an isolated git worktree and a separate @verifier model that reruns tests on real diffs, so a failing lane reruns alone instead of the whole swarm.

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

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 <task>` 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.

### 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.

`/swarm Add a typed /api/bookmarks endpoint with Astro parser, Zod validation, and integration tests`
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

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

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

@name · @all

```
// 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.

| Model | Swarm Seat | Default Thinking | API Price (In / Out per 1M) | Why It Fits | 
|---|---|---|---|---|
| Gemini 4 Neon | Coordinator / Planner / Merger | high | $3.00 / $15.00 ($0.15 cached) | Reads fewer files twice, lowest fabrication rate, handles long tool-heavy plans. | 
| Gemini 4 Hydrogen | Parallel Workers | low or medium | $1.50 / $7.50 | Half Neon's per-token cost; ideal for narrow scoped edits, parsers, and test suites. | 
| Gemini 4 Carbon | Verifier / Hardest Architecture Step | high 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.

| Dimension | Antigravity /swarm (App & agy CLI) | DIY Gemini API (@google/genai) / Google ADK | 
|---|---|---|
| Best For | Codebase features, refactors, live human-in-the-loop review | Headless product pipelines, scheduled jobs, custom SaaS backends | 
| Orchestration | Built-in Coordinator, Shared Board, git worktrees, @monitor | You control Planner JSON, concurrency semaphore, and Checker loop | 
| Observability | Swarm UI side pane, Board / Members / Graph, Alt+S in CLI | Custom logs, adk web event viewer, Cloud Observability | 
| Cost Control | Google AI Pro / Ultra subscription quotas | Exact 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.

## 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.

## 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.

| Seat | Model | Input Tokens | Output + Thinking Tokens | Est. Cost | 
|---|---|---|---|---|
| Planner | Gemini 4 Neon | 8,000 | 4,000 | $0.084 | 
| 8 Parallel Workers | Gemini 4 Hydrogen | 8 x 6,000 | 8 x 1,500 | $0.162 | 
| Merger | Gemini 4 Neon | 20,000 | 5,000 | $0.135 | 
| Verifier / Checker | Gemini 4 Neon | 15,000 | 3,000 | $0.090 | 
| Total (1 Checked Run) | Mixed Fleet | 91,000 | 24,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.

## how this post connects together.

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

## 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 →](https://codingcat.dev/course/cloudflare-agents-durable-workflows-typescript)
