In agent-first development, you describe what you want — not how to do it. The Antigravity runtime figures out the HOW. Today you will write declarative floating specifications and let the framework optimise the trajectory.
# Declarative levitation specification
from antigravity.spec import LevitationSpec, Trajectory, WindModel
spec = LevitationSpec(
payload='my-flask-api',
destination=Trajectory(
start=(37.7749, -122.4194, 0), # San Francisco, ground level
end=(37.7749, -122.4194, 9.5), # Same coords, 9.5m up
),
wind_model=WindModel.adaptive(),
landing_protocol='graceful', # completes requests before landing
)
# Deploy — the framework plans the optimal ascent path
deployment = spec.deploy()
print(deployment.status) # FLOATING
print(deployment.eta_to_altitude) # 3.2 seconds# Intent-based routing — tell the agent what to do, not how
from antigravity.router import IntentRouter
router = IntentRouter()
@router.intent('process_document')
async def handle_document(payload: dict):
# Antigravity analyses payload and routes to best handler
return await router.dispatch(payload)
@router.handler(type='pdf', confidence_threshold=0.85)
async def handle_pdf(doc):
return extract_text(doc)
@router.handler(type='image', confidence_threshold=0.85)
async def handle_image(img):
return describe_image(img)
# The router decides which handler to call based on payload analysis
result = await router.process({'file': 'report.pdf', 'data': b'...'})