Setup and context — Why Multi-Agent Changes Everything
Using AI assistants in software development is becoming commonplace, but relying on a single AI for everything has clear limitations. Code generation, test writing, documentation updates, and code reviews all demand different kinds of expertise.
Antigravity's multi-agent feature was designed to solve this problem. Multiple AI agents each handle their area of specialization, coordinating through the Manager Surface to achieve development efficiency that a single agent simply cannot match.
Manager Surface Basics
The Manager Surface is the central interface for Antigravity's multi-agent capabilities. It's where you launch agents, assign tasks, and monitor progress.
Launching and Configuring Agents
Open the Manager Surface from Antigravity's command palette by searching for Manager Surface, or use the keyboard shortcut Cmd+Shift+M (macOS) / Ctrl+Shift+M (Windows/Linux).
# You can also launch agents from the Antigravity CLI
# Run from your project root
antigravity agent start --name "code-reviewer" --role "Code Review Specialist"
antigravity agent start --name "test-writer" --role "Test Suite Generator"
antigravity agent start --name "doc-updater" --role "Documentation Maintainer"
# Check running agents
antigravity agent list
# Expected output:
# ID NAME ROLE STATUS
# ag-1 code-reviewer Code Review Specialist active
# ag-2 test-writer Test Suite Generator active
# ag-3 doc-updater Documentation Maintainer activeEach agent can be assigned a role, which functions as a system prompt that specializes its behavior for the designated task.
Assigning Tasks
Assign tasks to agents through the Manager Surface task panel or directly via CLI.
# Assign tasks to specific agents
antigravity agent assign ag-1 --task "Review src/auth/login.ts and report security concerns"
antigravity agent assign ag-2 --task "Create unit tests for src/auth/login.ts"
antigravity agent assign ag-3 --task "Update src/auth/README.md to match the latest login.ts implementation"
# Check task progress
antigravity agent status
# Expected output:
# ag-1 [code-reviewer] ████████░░ 80% Reviewing login.ts...
# ag-2 [test-writer] ██████░░░░ 60% Writing unit tests...
# ag-3 [doc-updater] ████░░░░░░ 40% Updating README.md...Practical Coordination Patterns
The real power of multi-agent workflows emerges when agents coordinate to handle complex development scenarios.
Pattern 1: Pipeline (Sequential Processing)
A chain where one agent's output becomes the next agent's input.
# .antigravity/workflows/pipeline.yaml
name: code-quality-pipeline
description: Validate code quality through sequential stages
steps:
- agent: code-generator
task: "Generate code based on user requirements"
output: generated_code
- agent: code-reviewer
task: "Review generated code for security and quality"
input: $generated_code
output: review_report
- agent: test-writer
task: "Create test suite incorporating review findings"
input: $generated_code, $review_report
output: test_suite
- agent: doc-updater
task: "Update documentation based on final code and tests"
input: $generated_code, $test_suiteThe pipeline pattern ensures quality at each stage. The flow of code generation → review → testing → documentation mirrors the same process a human team would follow.
Pattern 2: Fan-Out (Parallel Processing)
Multiple agents execute independent tasks simultaneously, then aggregate results.
# .antigravity/workflows/fan-out.yaml
name: comprehensive-analysis
description: Run multi-dimensional codebase analysis in parallel
parallel:
- agent: security-scanner
task: "Scan dependencies for vulnerabilities"
output: security_report
- agent: performance-analyzer
task: "Identify bottlenecks and create a performance report"
output: performance_report
- agent: accessibility-checker
task: "Audit for WCAG 2.1 compliance"
output: a11y_report
aggregate:
agent: report-compiler
task: "Consolidate three reports into a prioritized action list"
input: $security_report, $performance_report, $a11y_reportFan-out dramatically reduces total time by running independent tasks in parallel. If you're already comfortable with single-agent operations, the transition to this pattern is straightforward.
Pattern 3: Monitor and Feedback Loop
One agent monitors another's output and creates a feedback loop when quality standards aren't met.
// Define a custom workflow in TypeScript
import { AgentManager, WorkflowBuilder } from "@antigravity/agents";
const manager = new AgentManager();
const workflow = new WorkflowBuilder()
.addAgent("implementer", {
role: "Feature Implementation Specialist",
maxRetries: 3,
})
.addAgent("quality-gate", {
role: "Quality Assurance Gate",
criteria: {
testCoverage: 80,
lintErrors: 0,
typeErrors: 0,
docCoverage: 100,
},
})
.setFeedbackLoop("quality-gate", "implementer", {
onFail: (report) => ({
message: `The following criteria were not met:\n${report.failures.join("\n")}`,
action: "retry_with_feedback",
}),
})
.build();
const result = await manager.run(workflow, {
task: "Implement password reset for user authentication",
});
console.log(result.summary);
// Expected output:
// ✅ Implementation complete after 2 feedback iterations
// - Test coverage: 85%
// - Lint errors: 0
// - Type errors: 0
// - Doc coverage: 100%Common Errors and Solutions
Multi-agent environments introduce error types you won't encounter with a single agent.
Context Sharing Conflicts
When agents try to modify the same files, Antigravity uses a locking mechanism to prevent conflicts. However, deadlocks can occur if multiple agents attempt simultaneous edits on the same file.
The solution is to clearly define file ownership during workflow design. Pipeline patterns naturally provide exclusive access, but fan-out patterns require ensuring each agent operates on non-overlapping files.
Optimizing Resource Consumption
Running multiple agents simultaneously increases API calls and token usage. To control costs, assign lightweight models to simple tasks (linting, format checking) and reserve high-performance models for critical tasks (security reviews, architecture decisions).
Summary
Antigravity's multi-agent feature is a powerful tool for fundamentally streamlining your development workflow. By understanding the three core patterns — Pipeline, Fan-Out, and Monitor/Feedback — you can handle virtually any development scenario.
Start with just two agents (code generation + review), then expand your workflow gradually. The key isn't adding more agents — it's deepening each agent's specialization and improving the quality of their coordination.