A fast way to get started with the Antigravity SDK on Google Cloud
The Antigravity SDK by Google is a framework for building AI agents that use the same underlying agent harness powering the Antigravity CLI, IDE, and desktop application. I'll show you how to get started with it and run an interactive agent loop locally for development.
An agent harness is the execution environment that turns an LLM into an agent. It manages conversation state, handles context windows, and enforces safety policies, allowing the model to interact with its environment by running shell commands, editing files, executing code, and searching the web.
The Antigravity Python SDK, available on GitHub, is a wrapper around the closed-source agent harness binary.
Prerequisites
Before you begin, you'll need a Google Cloud project with billing enabled.
You'll need a few tools installed locally. First, for this example, you will need
uv. Second, install the
gcloud CLI. Make sure you have run gcloud auth application-default login to set up
your local application credentials.
If you are unfamiliar with uv, it is a fast Python package manager and
resolver written in Rust. It serves as a unified replacement for pip,
pip-tools, pipx, poetry, pyenv,
twine, and virtualenv.
Enable the Agent Platform API
Before you can use Gemini, you need to enable the Agent Platform API for your project.
You can enable it using the gcloud CLI:
gcloud services enable aiplatform.googleapis.com
Alternatively, you can enable the API directly in the APIs & Services section of the Google Cloud Console.
Create an agent project
First, create a new directory for your project:
mkdir antigravity-agent
cd antigravity-agent
Now, initialize uv in the directory:
uv init
Next, add the google-antigravity package to your project:
uv add google-antigravity
Now, create a file named agent.py and paste the following Python code:
import os
import asyncio
from google.antigravity import LocalAgentConfig, CapabilitiesConfig, BuiltinTools
from google.antigravity.utils.interactive import run_interactive_loop
config = LocalAgentConfig(
vertex=True,
project=os.environ.get("GOOGLE_CLOUD_PROJECT"),
location="global",
model="gemini-3.5-flash",
capabilities=CapabilitiesConfig(
enabled_tools=[
BuiltinTools.SEARCH_WEB,
]
)
)
async def main():
await run_interactive_loop(config)
if __name__ == "__main__":
asyncio.run(main())
Let's break down the configuration block:
-
vertex=True: This tells the SDK to use Agent Platform on Google Cloud as the backend. -
project=os.environ.get("GOOGLE_CLOUD_PROJECT"): Retrieves the Google Cloud project from the environment variable. -
location="global": Configures the location. See below why the global region is recommended. model="gemini-3.5-flash": Specifies the model to query.-
capabilities=CapabilitiesConfig(...): Configures capabilities of the agent, in this case exclusively enabling the built-in web search tool (BuiltinTools.SEARCH_WEB).
Run the agent
Now you can launch the agent and enter an interactive session in your terminal. Since
the SDK needs to know which Google Cloud project to target, make sure the
GOOGLE_CLOUD_PROJECT environment variable is set:
export GOOGLE_CLOUD_PROJECT=[YOUR_PROJECT_ID]
uv run python agent.py
Replace [YOUR_PROJECT_ID] with your actual Google Cloud project ID.
When the script starts, it launches an interactive session in your terminal where you
can chat with your agent. Let's ask it a question that requires searching the web:
What is the most recent release of Antigravity SDK?
Starting interactive loop. Type 'exit' or 'quit' to end.
User: What is the most recent release of Antigravity SDK?
Agent: The most recent release of the official Python **Antigravity SDK** (`google-antigravity`) is **`v0.1.5`**.
You can end the interactive loop by typing exit or hitting
Ctrl+D.
Use the global region
Using the global region provides a single, highly available endpoint. This
means that instead of being tied to a specific physical location, your requests are
dynamically routed to a region with available capacity. You don't control which region
handles the request; the system automatically prioritizes availability. You can read
more about this in the
Agent Platform documentation.
Similarly, there are multi-regional endpoints us and eu.
Multi-region endpoints allow you to make sure that processing stays within a specific
jurisdictional boundary, such as the United States or the European Union.
Wrap up
I've shown you how to get started with the Antigravity SDK and use it to run an interactive agent loop locally. You can use it as a starting point to build more advanced standalone agents.