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
- 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.
- Rapid Setup & First RunInstallation nuances (PyPI wheels vs source clones), environment variables, and the hello_world.py entry point for immediate verification.
- 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.
- Understanding the Agentic LoopThe three-layer architecture: Layer 1 (Simplified Agent), Layer 2 (Stateful Session), and Layer 3 (Transport Adapters).
- Agent Lifecycle & ContextHow the Agent class manages resource cleanup via AsyncExitStack and provides high-level streaming interfaces for thoughts and tool calls.
- Stateful Conversations & HistoryDeep dive into Conversation state, step history accumulation, and the low-level send/receive_steps API for granular interaction control.
- Tooling & MCP IntegrationExtending agent capabilities via native Python functions and the Model Context Protocol (MCP) bridge for stdio and SSE servers.
- Hooks & Policy PrecedenceThe priority-based policy model (Specific > Wildcard) and how to implement custom middleware using pre/post-step hooks.
- Interactive & Human-in-the-LoopImplementing interactive flows using run_interactive_loop and ask_user policy handlers for manual tool call approval.
- Event-Driven TriggersRunning background tasks that react to external events (e.g., timers via every()) and push asynchronous messages into the agent session.
- Multimodal & Content IngestionHandling rich media: using from_file for automatic MIME resolution and direct constructor instantiation for in-memory bytes (Image, Video, Document).
- 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.