basic.py
"""
Antigravity on AgentOS
======================
Serves an Antigravity-backed agent through AgentOS, with sessions persisted
to a local SQLite database.
"""
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.models.google import GeminiInteractions
from agno.os import AgentOS
# ---------------------------------------------------------------------------
# Setup
# ---------------------------------------------------------------------------
db = SqliteDb(
db_file="tmp/antigravity_agentos.db",
)
# ---------------------------------------------------------------------------
# Create Antigravity Agent and AgentOS
# ---------------------------------------------------------------------------
antigravity_agent = Agent(
db=db,
id="antigravity-agent",
model=GeminiInteractions(agent="antigravity-preview-05-2026", environment="remote"),
add_history_to_context=True,
num_history_runs=3,
)
agent_os = AgentOS(
description="Example OS setup",
agents=[antigravity_agent],
)
# ---------------------------------------------------------------------------
# Create AgentOS App
# ---------------------------------------------------------------------------
app = agent_os.get_app()
# ---------------------------------------------------------------------------
# Run
# ---------------------------------------------------------------------------
if __name__ == "__main__":
agent_os.serve(app="basic:app", reload=True)
Run the Example
1
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activate
uv venv --python 3.12
.venv\Scripts\activate
2
Install dependencies
uv pip install -U "agno[os]" google-genai
3
Export your Google API key
export GOOGLE_API_KEY="your_google_api_key_here"
$Env:GOOGLE_API_KEY="your_google_api_key_here"
4
Run the example
Save the code above as
basic.py, then run:python basic.py