A demo project showcasing how AG-UI and CopilotKit connect a React frontend to AI agents, using Google ADK as the agent framework. The result is an interactive tutoring app that generates practice problems for students — but the real focus is the integration pattern between these technologies.
Key technologies demonstrated:
- AG-UI — Agent-UI protocol bridging the frontend and backend agent communication
- CopilotKit — React components and hooks for building agent-powered UIs (sidebar chat, shared state via
useCoAgent) - Google ADK — Agent Development Kit for defining and orchestrating AI agents (powered by Gemini models)
- A student describes a topic they want to practice (e.g. "Geometry problems for a 9-year-old")
- The AI tutor asks clarifying questions about level, scope, and focus areas
- Practice problems are generated with varying difficulty — some include SVG visual hints
- Students answer each problem interactively and get instant feedback
- The tutor can generate additional problems or adjust difficulty based on the conversation
The app runs two servers concurrently:
| Server | Port | Description |
|---|---|---|
| Next.js frontend | 3000 | React UI with CopilotKit sidebar for chat + problem display |
| FastAPI agent backend | 8000 | Google ADK agents that handle tutoring logic and problem generation |
Agents:
- TutorAgent (
gemini-2.5-flash) — Main conversational agent. Gathers topic details, orchestrates problem generation, and iterates with the student. - ProblemGeneratorAgent (
gemini-3-flash-preview) — Generates structured problem collections with questions, answers, answer types, and optional SVG hints.
The frontend communicates with the backend through a /api/copilotkit proxy route. Agent state (topic statement, generated problems) is synced to the UI via CopilotKit's useCoAgent hook.
- Node.js 18+
- Python 3.12+
- A Google API Key
- Install dependencies:
pnpm installThis automatically runs
install:agentviapostinstall, which creates a Python.venvinside theagent/directory and installs Python dependencies withuv.
- Set your Google API key:
export GOOGLE_API_KEY="your-google-api-key-here"- Start the development servers:
pnpm devThis launches both the Next.js UI and the ADK agent server concurrently.