Common issues when working through the AG2 Workshop episodes.
Cause: OPENAI_API_KEY is missing or invalid. Fix:
.env.example to .env: cp .env.example .env.envpython -c "import os; from dotenv import load_dotenv; load_dotenv(); print('Key set:', bool(os.getenv('OPENAI_API_KEY')))"Cause: OpenAI account has no credits remaining. Fix: Add credits at https://platform.openai.com/account/billing
gpt-xxx does not exist”Cause: Invalid model name in code.
Fix: Use gpt-4o-mini (recommended for this workshop — fast and affordable). Check that no notebook uses gpt-4.1-mini or gpt-5.
Fix: All workshop episodes use gpt-4o-mini by default. If you changed to a larger model, switch back. Estimated cost for all 23 episodes: $3-5.
Cause: Too many API calls in a short period.
Fix: Wait 30-60 seconds and re-run the cell. If persistent, add time.sleep(1) between agent calls during development.
pip install ag2[openai] failsFix:
# Make sure you're on Python 3.12+
python --version
# Use quotes around extras (required in zsh)
pip install "ag2[openai]>=0.10"
Cause: MCP requires Python 3.12+.
Fix: python --version — if below 3.12, upgrade Python. MCP is not available on older versions.
chromadb fails to install (Ep 12)Fix:
pip install chromadb
# If build fails on Mac, install Xcode CLI tools:
xcode-select --install
Fix:
# Install the kernel for your environment
pip install ipykernel
python -m ipykernel install --user --name ag2-workshop
Then select “ag2-workshop” kernel in Jupyter.
Cause: Agent is waiting for human input (human_input_mode="ALWAYS").
Fix: Check the terminal/notebook output for an input prompt. Type your message and press Enter. To avoid this, use human_input_mode="NEVER" during development.
Fix: AG2 is the package name. Install with pip install "ag2[openai]". The import is import autogen (legacy) or from autogen import ....
Causes & Fixes:
register_for_llm and register_for_execution are calledCauses & Fixes:
max_turns or max_roundsis_termination_msg functionCauses & Fixes:
description is vague — make descriptions specific about what the agent handlesdescription and system_message are confused — description guides routing, system_message guides behaviorFix: Install Docker Desktop from https://www.docker.com/products/docker-desktop/
Fix: Ensure Docker Desktop is running (check the system tray icon).