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:
| Value | Behavior |
|---|---|
"remote" | Fresh remote Linux sandbox. |
"env_<id>" | Reuse a previously provisioned sandbox. |
dict | Full 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 Agent2from kern.models.google import GeminiInteractions34agent = Agent(5 model=GeminiInteractions(6 agent="antigravity-preview-05-2026",7 environment="remote",8 ),9 markdown=True,10)1112if __name__ == "__main__":13 agent.print_response("What is the capital of France?")Usage
Set up your virtual environment
1uv venv --python 3.122source .venv/bin/activate1uv venv --python 3.122.venv\Scripts\activateSet your API key
1export GOOGLE_API_KEY=xxxInstall dependencies
1uv pip install -U "google-genai>=2.0" kern-aiRun Agent
1python cookbook/90_models/google/gemini_interactions/antigravity.py