google-antigravity/antigravity-sdk-python

A Python library for building AI agents that leverage the full power of Google Antigravity.

What it solves

It simplifies the creation of AI agents by providing a secure, scalable, and stateful infrastructure layer. It abstracts the complex "agentic loop" (the cycle of reasoning and acting), allowing developers to focus on the agent's specific functionality rather than the underlying runtime mechanics.

How it works

The SDK uses a three-layer architecture to manage agents powered by Gemini:

  1. Simplified Layer: The Agent class provides a high-level entry point for quick setup.
  2. Session Layer: The Conversation class manages stateful sessions, tracking step history and turns.
  3. Adapter Layer: Handles transport and backend abstractions via Connection and ConnectionStrategy.

It integrates with Gemini and the Gemini Enterprise Agent Platform (Vertex AI), supporting multimodal inputs (images, video, audio, documents) and real-time streaming of both final responses and internal model reasoning ("thoughts").

Who it’s for

Python developers building AI agents who want a structured framework for managing state, tool execution, and security policies without building the agent loop from scratch.

Highlights

  • Tool Integration: Supports registering custom Python functions as tools and integrates with the Model Context Protocol (MCP) to connect to external servers.
  • Policy System: A declarative system to allow, deny, or require user approval for specific tool calls.
  • Multimodal Support: Ability to ingest mixed prompts containing text and various file types (PDFs, images, etc.).
  • Triggers: Support for background tasks that can push messages to the agent based on external events or timers.
  • Streaming: Native async streaming for text tokens, internal reasoning, and tool call events.

Related

  • Project
  • Project
  • Project
  • Project
  • Project