AG2 weather agent with A2A server and UI. Ask for current weather by city name or use your location; the agent uses Open-Meteo (no API key) for weather data and an LLM for conversation.
- Python 3.10–3.13
- Node.js and pnpm (for the UI)
- OpenAI API key (for the agent LLM)
You need two processes: the Python backend (agent + API) and the Next.js frontend.
From the project root:
# Install dependencies (uses uv)
uv sync
# Set your OpenAI API key
export OPENAI_API_KEY="your-openai-api-key"
# Start the backend on http://localhost:8000
uv run python weather.pyThe backend serves the agent at http://localhost:8000/weather/.
In a second terminal, from the project root:
cd ui
pnpm install
pnpm devThe app will be at http://localhost:3000. The UI talks to the backend at http://localhost:8000/weather/, so keep the backend running.
Open http://localhost:3000 in your browser and ask for weather, e.g.:
- “What’s the weather in London?”
- “Weather in Tokyo”
- “What’s the weather here?” (uses browser location if allowed)
| Component | Command | URL |
|---|---|---|
| Backend | uv run python weather.py |
http://localhost:8000 |
| Frontend | cd ui && pnpm dev |
http://localhost:3000 |
Weather data is from Open-Meteo (no API key). The chatbot uses the OpenAI API; set OPENAI_API_KEY before starting the backend.