MCPcopy Index your code
hub / github.com/ag2ai/build-with-ag2

github.com/ag2ai/build-with-ag2 @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
610 symbols 2,338 edges 100 files 257 documented · 42%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

🌟 Build with AG2

Are you building with AG2? Add your project to the list by submitting code through pull requests or add a link to your own repository!

A curated collection of awesome agentic applications built with AG2.

  • 💡 Practical implementations demonstrating AI agents in action - from custom support to smart email management systems

  • 🔥 Cutting-edge AI agent applications that seamlessly integrate models from OpenAI, Anthropic, Gemini, and open-source providers, and a diverse range of tools

  • 🎓 Production-ready, extensively documented agentic projects that help you contribute to the thriving AI agent ecosystem

🎓 AG2 Workshop: 23-Episode Course

New to AG2? The AG2 Workshop takes you from first agent to production deployment in 23 hands-on episodes.

  1. Learn the patternsAgent Pattern Cookbook — 13 runnable examples from simple two-agent chat to hierarchical multi-agent systems.
  2. See real apps → Browse the Featured Agentic Apps section below for complete, documented projects.
  3. Connect external services → Explore Arcade SDK Examples to integrate OAuth-protected APIs like Gmail and Linear.
  4. Add a UI → Explore AG-UI Examples to connect your agents to a browser frontend.
  5. Deep dive → Work through the 7-module workshop for a comprehensive hands-on course.
  6. Go to production → Use the GCP Agent Starter Pack to deploy your agent to Google's Cloud Run with CI/CD and observability.
Section Episodes What You Build
Basics 1-4 Your first agent, tools, two-agent collaboration
Patterns 5-9 Round-robin, auto, handoffs, pipelines, decision framework
Applications 10-15 Customer service, research, RAG, web browsing, UI, MCP
Production 16-20 Observability, security, testing, costs, deployment
Advanced 21-23 Redundancy, reasoning, what's next

Start Episode 1 → | Try the Playground (no setup) →

🗺️ More Ways to Learn

  • See real apps → Browse the Featured Agentic Apps below for complete, documented projects.
  • Add a UI → Explore AG-UI Examples to connect your agents to a browser frontend.
  • Go to production → Use the GCP Agent Starter Pack to deploy your agent to Google Cloud Run with CI/CD and observability.

📂 Featured Agentic Apps

  • 🛍️ E-Commerce Custom Service for Order Management (last updated and ran on 09/20/2025, ag2 version 0.9.9): A smart, agent-driven system that makes order tracking quick and easy while simplifying returns for both logged-in and guest users.
  • 📈 Financial Analysis (last updated and ran on 09/20/2025, ag2 version 0.9.9): A AI-powered stock analysis generating market insights and recommendations.
  • 🤖 Automated Machine Learning for Kaggle (last updated and ran on 09/20/2025, ag2 version 0.9.9): An agent system to automate the machine learning pipeline for Kaggle competitions.
  • 🧑‍🔬 Deep Research Agent: Reference implementation of the deep research agent.
  • ✈️ Travel Planner: A trip planning multi-agent system that creates an itinerary together with a customer.
  • 🎮 AI Game Design Agent Team ⚠️ (currently broken — pending fix for AG2 0.9+): A collaborative game design system that generates comprehensive game concepts through the coordination of multiple specialized AI agents.
  • Manage Todos With Realtime Agent: A voice-controlled todo assistant with real-time interaction.
  • 🔍 Due Diligence with TinyFish: A multi-agent due diligence pipeline that automatically researches a company from a single URL using AG2 and TinyFish for deep web scraping.
  • 🛠️ IT-Ops Triage: IT Operations reference design using AG2 Beta agent network — parallel diagnosis specialists, human-in-the-loop sign-off as a parallel participant, real persisted tickets with duplication detection, and a live React UI over WebSocket.

🔌 Arcade SDK Examples

Examples of connecting AG2 agents to external services via Arcade — a managed OAuth2 platform that handles authorization and tool execution, so there's no token storage or manual API setup required.

  • 📋 Linear Agent: A natural language interface for managing Linear issues — list, create, and update issues via Arcade's managed OAuth2 integration.
  • 📧 Gmail Agent: A Gmail management agent that reads, searches, sends, and organizes emails through natural language.

🖥️ AG-UI Examples

Examples of connecting AG2 agents to browser frontends using the AG-UI protocol. Each example includes a FastAPI backend and a vanilla HTML/JS frontend — no React or build step required.

  • 🌤️ Weather Agent: Single-agent chat with a weather tool. Demonstrates AGUIStream, streaming text, tool call events, and SSE consumption in the browser.
  • 🏭 Factory Agent: Multi-agent document pipeline (plan → draft → review → revise → finalize). Demonstrates ContextVariables with STATE_SNAPSHOT events to provide multi-agent context to the UI.
  • 🔬 GPT Researcher: Wraps the GPT Researcher multi-agent pipeline as an AG2 tool and streams pipeline stage updates and the final report to a browser frontend via AG-UI.

☁️ Deploy to Google Cloud

  • 🚀 GCP Agent Starter Pack: Production-ready template that deploys an AG2 agent to Google's Cloud Run with one command. Includes Terraform, CI/CD (Cloud Build or GitHub Actions), OpenTelemetry tracing, and A2A protocol support for cross-framework agent communication.

🚀 Getting Started

  1. Clone the repository

bash git clone https://github.com/ag2ai/build-with-ag2.git

  1. Navigate to the desired project directory

bash cd build-with-ag2/travel-planner

  1. Install the required dependencies

bash # Requires Python >= 3.9, < 3.14 pip install -r requirements.txt

  1. Follow the project-specific instructions in each project's README.md file to set up and run the app.

🔗 Links to More Projects Built with AG2

  • 📓 AG2 Notebooks: AG2 notebooks
  • 🖥️ Waldiez: UI for designing AG2-based workflows using drag-and-drop
  • 🦸 HeroYouth: Empowering youth against school bullying
  • 🔬 SciAgents: Automating scientific discovery through multi-agent intelligent graph reasoning
  • 🌐 Agent-E: A browser automation agent for natural language-driven web interactions and task automation.
  • 📱 Aquinas: AI-Powered social media engagement tool
  • 🛡️ disarmBot: A multi-agent LM system for analyzing disinformation based on DISARM
  • 🛠️ Hercules: An open-source testing agent that turns simple Gherkin steps into fully automated end-to-end tests
  • 📊 CMBAgent: Multi-agent system for data analysis and visualization
  • 🔏 AutoDefense: Multi-agent LLM Defense against jailbreak attacks
  • 🔍 Prompt Leakage Probing: Framework for testing LLM agents for system prompt leaks
  • 💌 AI-Powered Event Invitation Workflow: Multi-agent event invitation system using Neosantara AI's Grok 4 for personalized multilingual content generation
  • L402 Lightning Payments for AG2: Gives AG2 agents the ability to access L402-protected APIs with automatic Bitcoin Lightning micropayments using register_function()
  • 💧 AquaInsightAI: AI-powered multi-agent water analytics platform to analyse datasets, create visualisations, and produce technical reports.

🤝 Contributing to AG2 Open Source

Created something with AG2? Contributions are welcome! If you have any ideas, improvements, or new apps to add, please create a new GitHub Issue or submit a pull request. Make sure to follow the existing project structure and include a detailed README.md for each new app.

Option 1: Link to your own repositories built with AG2

Refer to the external repository guide to link to your own repositories showcasing projects built with AG2.

Option 2: Creating a new project

  • You can take the project template as a starting point
  • Use kebab-case for a new project, e.g. space-time-travel-agent
  • Add a requirements.txt file with the required libraries
  • Write a concise README.md file, use this as a template
  • Add a OAI_CONFIG_LIST_sample file
  • Create your project and contribute. Happy coding!

Code Style and Linting

This project uses pre-commit hooks to maintain code quality. Before contributing:

  1. Install pre-commit:
pip install pre-commit
pre-commit install
  1. The hooks will run automatically on commit, or you can run them manually:
pre-commit run --all-files

🌟 Stay Updated

Star this repository and AG2 to receive notifications about the newest and coolest agentic applications!

Core symbols most depended-on inside this repo

get
called by 198
beta/data-analyst/backend.py
get
called by 98
itops/orchestration/run_demo.py
fold
called by 43
itops/orchestration/parallel_workflow.py
escapeHtml
called by 22
beta/mystery-dinner/app/static/mystery_dinner.js
initial_state
called by 20
itops/orchestration/parallel_workflow.py
emit
called by 17
itops/it_ops_app/server.py
call_arcade_tool
called by 11
arcade/gmail-agent/main.py
to_dict
called by 10
itops/orchestration/run_demo.py

Shape

Function 443
Method 91
Class 48
Route 28

Languages

Python86%
TypeScript14%

Modules by API surface

itops/orchestration/run_demo.py54 symbols
ag-ui/gpt-researcher/server.py30 symbols
beta/mystery-dinner/app/static/mystery_dinner.js28 symbols
itops/it_ops_app/server.py25 symbols
itops/orchestration/test_parallel_workflow.py22 symbols
beta/data-analyst/backend.py22 symbols
itops/orchestration/parallel_workflow.py19 symbols
beta/parallel-research/main.py19 symbols
arcade/gmail-agent/main.py17 symbols
tutorial/agent_pattern_cookbook/pattern_advanced_pipeline.py15 symbols
tutorial/agent_pattern_cookbook/pattern_advanced_feedback_loop.py14 symbols
due-diligence-with-tinyfish/main.py14 symbols

For agents

$ claude mcp add build-with-ag2 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact