A sophisticated debate system using multiple AI agents in a swarm configuration to research, construct arguments, provide rebuttals, and evaluate debates on any topic.
This project demonstrates an advanced approach to collaborative AI reasoning through structured debate. The system uses a team of specialized agents that work together with distinct roles:
- Research Agent: Gathers facts, statistics, and evidence from the web
- Argument Construction Agent: Builds logical, compelling arguments based on research
- Rebuttal Agent: Critically analyzes arguments and constructs counterpoints
- Evaluation Agent: Assesses the debate using predefined evaluation criteria
The agents collaborate in a swarm pattern powered by AutoGen AgentChat and provide an interactive debate experience through a Chainlit UI.
Swarm is a multi-agent design pattern first introduced by OpenAI that implements a collaborative team where agents can hand off tasks to other agents based on their specialized capabilities.
The key innovation is that agents can delegate tasks to other team members using special tool calls, while maintaining a shared message context across the entire team. This approach enables decentralized task planning through local decision-making by individual agents, eliminating the need for a central orchestrator to coordinate all activities.
- Web Research: Utilizes Serper API for Google search and web scraping to gather current information
- Structured Debate Flow: Agents communicate in sequence with defined handoffs between stages
- Interactive UI: Clean, user-friendly interface using Chainlit
- Predefined Topics: Includes starter topics for immediate engagement
- Customizable Evaluation: Uses predefined criteria for objective assessment
Before using this AI agent, ensure you have the following:
- Python 3.8 or higher
uvpackage installer, recommended for Python project management (Reference)- Access to one of the supported LLM providers:
- Azure OpenAI [Reference Video]
- OpenAI
- Create a FREE account on Serper.dev
-
Clone the repository & get into the project directory
git clone https://github.com/tezansahu/ai-garage.git cd ai-garage/swarm-multiagent-debate-autogen-chainlit -
Create and activate a virtual environment using
uv:uv venv # On Windows .\.venv\Scripts\activate # On macOS/Linux source .venv/bin/activate
-
Install all dependencies
uv sync
-
Create a
.envfile with your Serper API keys:SERPER_API_KEY=<your-api-key> -
Configure your model settings in
model_config.yaml
Run the application:
chainlit run app.pyThis will start the Chainlit server, allowing you to:
- Select a predefined debate topic or enter your own
- Watch as agents research, construct arguments, rebut, and evaluate
- Review the complete debate thread
