AG2 + CopilotKit Starter
February 23, 2026 · View on GitHub
A weather agent demo built with AG2 and the AG-UI protocol.
Project Structure
ag2-copilotkit-starter/
├── agent-py/ # Python backend (AG2 agent + AG-UI endpoint)
│ ├── backend.py
│ └── requirements.txt
├── ui-react/ # React + CopilotKit frontend
│ └── app/
│ ├── api/copilotkit/route.ts
│ ├── layout.tsx
│ ├── page.tsx
│ └── globals.css
└── README.md
Prerequisites
- Python 3.10+
- Node.js 18.18+
- OpenAI API key
Backend Setup
cd agent-py
pip install -r requirements.txt
export OPENAI_API_KEY="your_openai_api_key"
python backend.py
The backend server starts at http://localhost:8008.
React + CopilotKit Frontend Setup
cd ui-react
npm install
npm run dev
Open http://localhost:3000 and chat with the weather agent.