The Google Antigravity SDK gives Python code the same tools, agent loop, and context management that run inside Google Antigravity. Agents built with it read files, run commands, and edit code, and the SDK handles the agentic loop, tool wiring, hooks, and policy defaults. It ships with a compiled runtime binary inside its platform-specific packages.
Models run through the Gemini API or through Gemini Enterprise Agent Platform (formerly Vertex AI), with either an API key (Express Mode) or a Google Cloud project, region, and Application Default Credentials (Standard Mode). The SDK also runs fully offline with Gemma 4 through LiteRT-LM, which works best with the Gemma 4 26B mixture-of-experts model and at least 24 GB of VRAM or shared memory.
An agent starts in read-only mode, and write-capable tools must be enabled explicitly. The SDK is organized in three layers:
| Layer | Purpose | Key classes |
|---|---|---|
| Simplified | High-level entry point | Agent |
| Session | Stateful session with history | Conversation, ChatResponse, Step, ToolCall, HookRunner, ToolRunner, TriggerRunner |
| Adapter | Transport and backend abstraction | Connection, ConnectionStrategy, LocalConnection |
Features
- Simple agent: one async context manager handles binary discovery, tool wiring, hook registration, and policy defaults
- Streaming: streams response tokens, reasoning deltas, and typed tool-call events as they arrive
- Conversations: stateful sessions accumulate step history and expose turn count and the last response
- Multimodal input: images, videos, audio, and documents attach to prompts from memory or from a file
- Custom tools: plain Python functions register as tools the agent can call
- MCP integration: connects to external MCP servers and exposes their tools to the agent
- Hooks and policies: declarative allow, deny, and ask-the-user rules gate each tool
- Triggers: background tasks react to external events or timers and push messages into the agent
- Local models: offline agentic workflows with Gemma 4 through LiteRT-LM
- Vertex AI support: Express Mode with an API key or Standard Mode with a project, region, and default credentials

