> ## Documentation Index
> Fetch the complete documentation index at: https://phidatainc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Antigravity (Interactions)

> Run the Antigravity managed autonomous agent in a sandbox through the Gemini Interactions API.

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). |

`GeminiInteractions` in Agno 2.7.2 sends Antigravity requests in the foreground and forces `store=True` so each interaction is retrievable. The Google API also supports background Antigravity execution. Use the Google Gen AI SDK directly when you need background execution.

## Code

```python antigravity.py theme={null}
from agno.agent import Agent
from agno.models.google import GeminiInteractions

agent = Agent(
    model=GeminiInteractions(
        agent="antigravity-preview-05-2026",
        environment="remote",
    ),
    markdown=True,
)

if __name__ == "__main__":
    agent.print_response("What is the capital of France?")
```

## Usage

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Set your API key">
    ```bash theme={null}
    export GOOGLE_API_KEY=xxx
    ```
  </Step>

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U "google-genai>=2.0" agno
    ```
  </Step>

  <Step title="Run Agent">
    Save the code above as `antigravity.py`, then run:

    ```bash theme={null}
    python antigravity.py
    ```
  </Step>
</Steps>
