A fast way to get started with Antigravity SDK on Google Cloud

Antigravity SDK by Google is a framework for building AI agents that uses the same underlying agent harness powering the Antigravity CLI, IDE, and desktop application. I'll show you how to get started with it on Google Cloud 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 history and the context window, applies safety policies, and executes tool calls such as file edits, shell commands, custom Python functions, and web searches. The Python package on GitHub (google-antigravity) wraps this closed-source agent harness binary so you can configure and run agents from Python.

Prerequisites

Before you begin, you'll need a Google Cloud project with billing enabled. Install uv (a fast Python package and project manager) and the gcloud CLI on your workstation.

Authenticate the gcloud CLI:

gcloud auth login

Then set up Application Default Credentials (ADC) for local Python code:

gcloud auth application-default login

Enable the Agent Platform API

To call Gemini models through Google Cloud, you first need to enable the Agent Platform API (aiplatform.googleapis.com) on your project. Set GOOGLE_CLOUD_PROJECT to your Google Cloud project ID in your shell:

export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"

With GOOGLE_CLOUD_PROJECT set, enable the Agent Platform API using the gcloud CLI:

gcloud services enable aiplatform.googleapis.com \
  --project="$GOOGLE_CLOUD_PROJECT"
Operation "operations/acat.p2-123456789012-7d64d58e-82cd-4cb9-be18-7a98277bf962" finished successfully.

Alternatively, you can enable the API in the APIs & Services section of the Google Cloud web console. On a newly created project, it can take up to a minute for endpoint permissions to propagate before the API accepts requests.

Create an agent project

Next, set up a local Python project with uv, install the google-antigravity package, and write a short script that configures an interactive web-searching agent.

Create a new antigravity-agent directory and initialize a minimal uv project (--bare creates only pyproject.toml without extra starter files):

mkdir antigravity-agent && cd antigravity-agent
uv init --bare
Initialized project `antigravity-agent`

With pyproject.toml initialized, install google-antigravity into a new virtual environment:

uv add google-antigravity
Using CPython 3.14.9
Creating virtual environment at: .venv
Resolved 46 packages in 639ms
Prepared 17 packages in 6.22s
Installed 43 packages in 95ms
 + google-antigravity==0.1.23
 + google-auth==2.62.2
 + google-genai==3.2.0
 ...

Now create a file named agent.py that configures LocalAgentConfig for Google Cloud and starts an interactive terminal loop:

agent.py
import asyncio
from google.antigravity import BuiltinTools, CapabilitiesConfig, LocalAgentConfig
from google.antigravity.utils.interactive import run_interactive_loop

config = LocalAgentConfig(
    vertex=True,
    location="global",
    model="gemini-3.8-flash",
    capabilities=CapabilitiesConfig(
        enabled_tools=[
            BuiltinTools.SEARCH_WEB,
        ]
    ),
)


async def main():
    await run_interactive_loop(config)


if __name__ == "__main__":
    asyncio.run(main())

Here's what each option in LocalAgentConfig configures:

  • vertex=True routes requests through the Agent Platform API on Google Cloud using your local ADC instead of the Google AI Studio endpoint. LocalAgentConfig automatically reads your target project from the GOOGLE_CLOUD_PROJECT environment variable.
  • location="global" sends requests to the global endpoint (explained in Use the global endpoint below).
  • model="gemini-3.8-flash" selects the Gemini 3.8 Flash model, which is also the SDK's default if you omit model.
  • capabilities=CapabilitiesConfig(...) restricts which built-in tools the agent harness exposes. By default, LocalAgentConfig enables all built-in file, web, and shell tools (prompting before running shell commands); passing enabled_tools=[BuiltinTools.SEARCH_WEB] limits this agent to web search only.

Run the agent

Run agent.py using uv run. Once the User: prompt appears, ask a question that requires a live web search, such as checking the latest google-antigravity release on PyPI:

uv run python agent.py
Starting interactive loop. Type 'exit' or 'quit' to end.
User: In one sentence, what is the latest version of the google-antigravity package on PyPI?
Agent: The latest version of the `google-antigravity` package on PyPI is **0.1.23**.
User: exit
Goodbye!

Calling run_interactive_loop switches the agent from its default autonomous mode (AgentBehavior.AUTONOMOUS) to interactive mode (AgentBehavior.INTERACTIVE) and starts the User: prompt. When you ask about PyPI, the agent runs the search_web tool, prints the grounded answer, and stops the local agent harness process when you type exit (you can also type quit or press Ctrl+C or Ctrl+D).

Use the global endpoint

Setting location="global" sends requests to a single global endpoint (aiplatform.googleapis.com) instead of pinning traffic to one physical region. Google Cloud dynamically routes each request to a region with available capacity, which improves availability and helps avoid regional rate-limit (429) errors. You don't choose which region handles a given request; see the Agent Platform locations documentation for supported models and details.

If you need to keep data processing within a specific jurisdiction, set location to a multi-region endpoint (us for the United States or eu for the European Union) or a single regional endpoint such as europe-west4 or us-central1.