Antigravity (Interactions)

Run the Antigravity managed agent through the Gemini Interactions API. Antigravity is a general-purpose autonomous agent (Gemini 3.5 Flash) that plans, runs code, browses the web, and produces artifacts (PDFs, HTML, slides) inside a managed Linux sandbox.

The environment parameter selects the sandbox:

ValueBehavior
"remote"Fresh remote Linux sandbox.
"env_<id>"Reuse a previously provisioned sandbox.
dictFull EnvironmentConfig (sources, network rules).

Unlike Deep Research, Antigravity runs in the foreground. The model still forces store=True so the interaction is retrievable.

Code

1from kern.agent import Agent
2from kern.models.google import GeminiInteractions
3
4agent = Agent(
5 model=GeminiInteractions(
6 agent="antigravity-preview-05-2026",
7 environment="remote",
8 ),
9 markdown=True,
10)
11
12if __name__ == "__main__":
13 agent.print_response("What is the capital of France?")

Usage

Set up your virtual environment

1uv venv --python 3.12
2source .venv/bin/activate
1uv venv --python 3.12
2.venv\Scripts\activate

Set your API key

1export GOOGLE_API_KEY=xxx

Install dependencies

1uv pip install -U "google-genai>=2.0" kern-ai

Run Agent

1python cookbook/90_models/google/gemini_interactions/antigravity.py