The purpose of this project is to compare two multi-agent architectures for collaborative report generation:
- Orchestrator Team: Centralized coordination with an orchestrator managing three specialized agents
- Swarm Team: Decentralized peer-to-peer communication between three autonomous agents
- Searches for relevant information
- Extracts key facts and data
- Saves findings to shared memory
- Verifies information across sources
- Synthesizes research findings
- Identifies patterns and trends
- Performs calculations and comparisons
- Generates actionable insights
- Creates structured reports
- Maintains coherent narrative
- Ensures proper flow and style
- Determines when task is complete
- Communication: All through central orchestrator
- Decision Making: Orchestrator plans and assigns tasks
- Advantages: Clear control flow, consistent coordination
- Entry/Exit: Orchestrator manages entire workflow
- Communication: Direct peer-to-peer between agents
- Decision Making: Agents autonomously decide next steps
- Advantages: Parallel processing, emergent solutions
- Entry/Exit: Research agent entry, Writer agent determines completion
src/
├── analysis/
│ ├── swarm_log_analyzer.py
│ ├── orchestrator_log_analyzer.py
├── orchestrator_team/
│ ├── __init__.py
│ ├── orchestrator_agent.py
│ ├── research_agent.py
│ ├── analysis_agent.py
│ ├── writer_agent.py
│ └── orchestrator_graph.py
├── swarm_team/
│ ├── __init__.py
│ ├── research_agent.py
│ ├── analysis_agent.py
│ ├── writer_agent.py
│ └── swarm_graph.py
├── __init__.py
├── tools.py
├── base_agent.py
├── logging_utils.py
├── run_orchestrator.py # Easy runner for orchestrator team
└── run_swarm.py # Easy runner for swarm team
Output directories (created automatically):
├── logs/ # Detailed execution logs
│ ├── orchestrator_log_1.txt
│ └── swarm_log_1.txt
└── reports/ # Generated reports
├── orchestrator_report_1_*.md
└── swarm_report_1_*.md
- Install dependencies:
pip install -r requirements.txt- Create a
.envfile in the src directory (or parent directory) with the following content:
GEMINI_API_KEY=your_api_key_here
To run either team, you can run the two scripts run_orchestrator.py and run_swarm.py in the src directory. You can modify how long of a report each team generates by modifying the report_length parameter and what the team searches for by modifying the task parameters.
Each run generates a detailed log file with timestamped entries:
-
Orchestrator logs: Show hierarchical communication flow
- Orchestrator decisions and task assignments
- Agent responses and completions
- Tool executions with inputs/outputs
-
Swarm logs: Show peer-to-peer interactions
- Direct agent-to-agent communications
- Autonomous decision making
- Collaborative handoffs
Final reports are saved as Markdown files with:
- Task description
- Generation timestamp
- Link to corresponding log file
- Full report content
[HH:MM:SS] Agent Name: Message | Metadata: {...}
- Python 3.8+
- Google Gemini API key (Free from https://aistudio.google.com/apikey)

