Agent-readable wiki

Antigravity Python SDK: The First 30 Minutes

A guided onboarding path to the Antigravity SDK, focusing on rapid orientation, core abstractions, and the safety-first execution model.

Pages

  1. Start HereWhat this repo is, the fastest read order, the entry points to open first, and the vocabulary (Agent, Conversation, Hook, Trigger) a new reader needs.
  2. Rapid Setup & First RunInstallation nuances (PyPI wheels vs source clones), environment variables, and the hello_world.py entry point for immediate verification.
  3. The Safety Model: Policies vs CapabilitiesHidden constraints: why the SDK raises ValueError for write tools without policies, and how to optimize tokens by disabling tools vs denying them.
  4. Understanding the Agentic LoopThe three-layer architecture: Layer 1 (Simplified Agent), Layer 2 (Stateful Session), and Layer 3 (Transport Adapters).
  5. Agent Lifecycle & ContextHow the Agent class manages resource cleanup via AsyncExitStack and provides high-level streaming interfaces for thoughts and tool calls.
  6. Stateful Conversations & HistoryDeep dive into Conversation state, step history accumulation, and the low-level send/receive_steps API for granular interaction control.
  7. Tooling & MCP IntegrationExtending agent capabilities via native Python functions and the Model Context Protocol (MCP) bridge for stdio and SSE servers.
  8. Hooks & Policy PrecedenceThe priority-based policy model (Specific > Wildcard) and how to implement custom middleware using pre/post-step hooks.
  9. Interactive & Human-in-the-LoopImplementing interactive flows using run_interactive_loop and ask_user policy handlers for manual tool call approval.
  10. Event-Driven TriggersRunning background tasks that react to external events (e.g., timers via every()) and push asynchronous messages into the agent session.
  11. Multimodal & Content IngestionHandling rich media: using from_file for automatic MIME resolution and direct constructor instantiation for in-memory bytes (Image, Video, Document).
  12. Beyond 30 Minutes: Next StepsSynthesis of the core model, pointers to deep-dive examples (Middleware, Subagents), and how to contribute to the SDK.

Complete Markdown

The complete agent-readable Markdown files are published separately from this HTML page.