This project demonstrates and compares three leading Python agent frameworks for orchestrating multi-agent financial analysis workflows:
- CrewAI: Role-based, sequential agent orchestration
- LangGraph: State-driven, graph-based agent workflows
- AutoGen: Conversational, group-chat style agent collaboration
All three frameworks are implemented to solve the same problem: analyzing a stock's recent performance and generating an investment recommendation (BUY/SELL/HOLD) with rationale.
ai-agent-comparision/
├── crewai/ # CrewAI implementation
├── langgraph/ # LangGraph implementation
├── autogen/ # AutoGen implementation
├── requirements.txt
├── .env.example
└── README.md
- Python 3.8+
- API keys for Groq and Tavily
- Install dependencies:
python -m venv .venv source .venv/Scripts/activate # Windows pip install -r requirements.txt cp .env.example .env # and fill in your API keys
cd crewai
python main.py- Prompt: Enter a stock ticker (e.g. NVDA, AAPL)
- Output: Executive summary and recommendation
cd langgraph
python main.py- Prompt: Enter a stock ticker
- Output: Analysis and recommendation
cd autogen
python main.py- Prompt: Enter a stock ticker
- Output: Analyst/Researcher group chat, final report
| Feature | CrewAI | LangGraph | AutoGen |
|---|---|---|---|
| Orchestration | Sequential pipeline | State graph (DAG) | Group chat (conversational) |
| Agent Roles | Explicit, role-based | Node-based, flexible | Conversational, flexible |
| Task Flow | Linear, step-by-step | Custom graph transitions | Multi-turn dialogue |
| Extensibility | Add agents/tasks | Add nodes/edges | Add agents, chat logic |
| Best For | Business workflows | Complex dependencies | Dynamic collaboration |
| Code Structure | agents.py, tasks.py, tools.py | nodes.py, state.py, tools.py | agents.py, workflow.py, config.py |
| Learning Curve | Low/Medium | Medium/High | Medium |
| Output | Executive report | Analysis + recommendation | Chat log + report |
- Add new data sources: Edit
tools.pyin any framework - Change agent logic: Edit
agents.pyornodes.py - Add new analysis steps: Add new tasks/nodes/agents as appropriate
This project is a reference for anyone looking to build modular, multi-agent systems in Python using modern frameworks.