Skip to main content
Antigravity wraps Managed Agents in the Gemini API. AntigravityTools lets a regular Agno agent delegate a sub-task to a Google-managed, sandboxed agent that can run code, search the web, and read/write files. The sandbox is provisioned lazily and reused across calls within the same session. Use this when you want an Agno agent (with its own model) to call Antigravity as one tool. To serve Antigravity itself as an AgentOS agent, use AntigravityAgent instead.

Prerequisites

pyyaml is only required when using agent_directory.

Example

cookbook/91_tools/antigravity/antigravity_tools.py

Toolkit Params

agent_directory conflicts with explicit agent= or default_sources= and will raise.

Tools

You can use include_tools or exclude_tools to modify the list of tools the agent has access to. Learn more about selecting tools.

Concepts

Session persistence

run_antigravity_task caches the sandbox’s environment_id in the calling agent’s session_state, so repeated calls within the same session reuse the sandbox (files and installed packages persist). Persistence requires non-streaming responses. The streaming SSE response does not expose environment_id.

Custom agents (Agents API)

The toolkit exposes the full /agents CRUD surface. Register a named agent once, then invoke it by name with run_custom_antigravity_agent. Each named agent gets its own per-session sandbox.

Agent directories

Pass agent_directory to wire a local folder (agent.yaml + AGENTS.md + workspace/ + skills/) into the toolkit. On construction it parses the folder, registers the agent with the API, and routes subsequent run_antigravity_task calls at that named agent.

Examples

Delegate a task

A Gemini agent delegates a research sub-task to the sandbox.

Agents API CRUD

Create, invoke, and delete custom agents through tools.

Agent from a directory

Wire a local agent.yaml folder into the toolkit.

Environment snapshot

Run a sandbox task then download the environment as a tar.

Developer Resources