CopilotKit + Google Antigravity
Bring your Google Antigravity agentsinto any app
CopilotKit is an open-source framework that connects your app to Google Antigravity agents. Give your agents chat, generative UI, human-in-the-loop, AG-UI Streams, Automatic Learning and more.
QuickstartBuild with Google Antigravity
Antigravity gives you the agent: a harness that runs the model, its tools and its sessions. What it does not give you is the surface. Somewhere for the conversation to happen, a way to show the run while it is running, and a moment for a person to step in. Each capability below builds on something your agent already does.
Generative UI
Your Python tools run inside the adapter, and their calls and results stream to the browser as they happen. CopilotKit renders each one as a React component instead of leaving the user with a spinner.
Human-in-the-loop
Antigravity awaits a tool with no timeout, so a frontend tool that asks the user just parks the run. CopilotKit resolves it from the browser once the user decides, and the same turn continues with the answer.
Frontend tools
Every tool your app registers becomes a real Antigravity tool. The model calls it like any other, and the value your handler returns is the result it sees.
Shared state and app context (experimental), attachments, reasoning, A2UI and multi-agent flows work with Google Antigravity too. And more
Start building
Scaffold a new app with the CLI, or follow the quickstart to connect the Google Antigravity agent you already run.
npx copilotkit@latest init --framework antigravityConnect your agent
Your agent keeps running as its own Python service, with the ag-ui-antigravity adapter in front of it. CopilotKit reaches that service over HTTP, so nothing inside the agent changes.
import { HttpAgent } from "@ag-ui/client";
import {
CopilotRuntime,
createCopilotRuntimeHandler,
} from "@copilotkit/runtime/v2";
import type { NextRequest } from "next/server";
const runtime = new CopilotRuntime({
agents: {
antigravity_agent: new HttpAgent({
url: process.env.AGENT_URL ?? "http://localhost:8000",
}),
},
});
const handler = createCopilotRuntimeHandler({
runtime,
basePath: "/api/copilotkit",
mode: "single-route",
});
export const POST = (req: NextRequest) => handler(req);How is this guide?