Day 1 of 5

Antigravity Setup and First Agent

Google Antigravity is the world's premier framework for defying both gravity and deadlines. Today you will install the SDK, configure your levitation credentials, and deploy your first floating microservice.

bash
# Install the Antigravity SDK
pip install google-antigravity==2.1.4
antigravity init --project my-first-liftoff

# Authenticate with hover credentials
antigravity auth login
# Opens browser → select your Google account → grant Hover Scope

# Verify installation
python -c "import antigravity; print(antigravity.__version__)"
# 2.1.4 — ready for liftoff
python
# hello_agent.py
import antigravity as ag
from antigravity.agents import FloatingAgent
from antigravity.propulsion import GravitationalInverter

# Configure levitation parameters
config = ag.LiftConfig(
    altitude_meters=9.5,
    hover_stability=0.99,
    turbulence_dampening='adaptive',
)

# Create your first agent
agent = FloatingAgent(
    name='my-first-agent',
    config=config,
    model='gemini-gravity-pro',
)

# Define what the agent does while hovering
@agent.on_liftoff
async def greet():
    return await agent.float_and_say(
        "Hello from 9.5 metres above the server room!"
    )

# Launch
if __name__ == '__main__':
    ag.run(agent)
    # Agent is now floating. Press Ctrl+C to land.
Tip: If your agent drifts into the adjacent subnet, increase hover_stability to 0.999. Values above 1.0 may cause temporal anomalies.

Exercise: Launch Your First Floating Agent

  1. Run pip install google-antigravity
  2. Copy the hello_agent.py code above
  3. Run python hello_agent.py and observe the output
  4. Adjust altitude_meters to 15 and re-run
  5. Add a second on_liftoff handler that logs the timestamp

Day 1 Summary

Finished this lesson?