Day 3 of 5

Multi-Agent Workflows

One floating agent is impressive. A fleet is unstoppable. Today you will orchestrate multiple Antigravity agents in a DAG (Directed Acyclic Graph) where each agent hands off results to the next.

python
from antigravity.fleet import AgentFleet, AgentNode

# Define individual agents
researcher = AgentNode(
    name='researcher',
    model='gemini-gravity-pro',
    task='Search the stratosphere for relevant data',
)

analyst = AgentNode(
    name='analyst',
    model='gemini-gravity-flash',
    task='Analyse the research findings',
    depends_on=[researcher],  # waits for researcher to complete
)

writer = AgentNode(
    name='writer',
    model='gemini-gravity-pro',
    task='Write a report from the analysis',
    depends_on=[analyst],
)

# Parallel agents — run simultaneously
fact_checker = AgentNode(
    name='fact-checker',
    model='gemini-gravity-flash',
    task='Verify all claims',
    depends_on=[researcher],  # also depends on researcher, runs with analyst
)

# Merge node — collects from multiple parents
final = AgentNode(
    name='final-editor',
    task='Merge writer output with fact-checker notes',
    depends_on=[writer, fact_checker],  # waits for BOTH
)

fleet = AgentFleet(nodes=[researcher, analyst, writer, fact_checker, final])
result = fleet.run(input='Quarterly performance of the anti-gravity sector')
print(result)
Tip: Real multi-agent systems use the same DAG pattern — see LangGraph, CrewAI, and AutoGen. Replace the propulsion metaphors with LLM API calls and you have production code.

Exercise: Build a 3-Agent Pipeline

  1. Create a research agent that searches a topic
  2. Create an analyst agent that summarises findings
  3. Create a formatter agent that outputs markdown
  4. Chain them: research → analysis → format
  5. Add error handling: if research fails, skip analysis

Day 3 Summary

Finished this lesson?