Antigravity Streaming (Interactions)

Stream the Antigravity agent's progress (tool calls, intermediate text, generated artifacts) instead of waiting for the final result. Antigravity runs in the foreground, so the stream stays open for the duration of the autonomous loop. No background reconnect is needed.

Code

1import asyncio
2
3from kern.agent import Agent
4from kern.models.google import GeminiInteractions
5
6agent = Agent(
7 model=GeminiInteractions(
8 agent="antigravity-preview-05-2026",
9 environment="remote",
10 ),
11 markdown=True,
12)
13
14if __name__ == "__main__":
15 agent.print_response(
16 "Read Hacker News, summarize the top 5 stories, and save the "
17 "summary as a Markdown report.",
18 stream=True,
19 )
20
21 asyncio.run(
22 agent.aprint_response(
23 "Find the three most-starred new Python repos on GitHub this "
24 "week and write a one-paragraph blurb for each.",
25 stream=True,
26 )
27 )

Usage

Set up your virtual environment

1uv venv --python 3.12
2source .venv/bin/activate
1uv venv --python 3.12
2.venv\Scripts\activate

Set your API key

1export GOOGLE_API_KEY=xxx

Install dependencies

1uv pip install -U "google-genai>=2.0" kern-ai

Run Agent

1python cookbook/90_models/google/gemini_interactions/antigravity_streaming.py