A multi-agent AI system built with CrewAI and Ollama that performs live stock analysis and debates. The system fetches real-time data using yfinance and coordinates three specialized agents to reach a final investment verdict.
- Core Framework: CrewAI
- LLM Engine: Ollama (Local Execution)
- Programming Language: Python 3.12 (Requires < 3.14 for dependency compatibility)
- Data Source: yfinance (Real-time stock data and news)
- LLM Connector: LiteLLM (For non-native model providers)
- Ollama: Install and have it running locally.
- Python 3.12: CrewAI's current dependencies (like
numpy) are most stable on Python 3.10 - 3.13.
Clone the repository and set up a virtual environment:
# Create venv with Python 3.12
py -3.12 -m venv .venv
# Activate (Windows)
.venv\Scripts\activate
# Install dependencies
pip install crewai langchain_ollama litellm yfinanceEdit config.json to set your target stock and preferred local models:
{
"stock_ticker": "TSLA",
"agents": {
"bull": { "model": "qwen3.5:0.8b", ... },
"bear": { "model": "qwen3.5:0.8b", ... },
"moderator": { "model": "qwen3.5:0.8b", ... }
},
"ollama_base_url": "http://localhost:11434"
}Run the live debate:
.venv\Scripts\python.exe debate_crew.py- Bull Analyst: Identifies growth drivers, innovation, and positive market sentiment.
- Bear Analyst: Highlights valuation risks, competition, and macroeconomic headwinds.
- Chief Investment Officer: Moderates the arguments and provides a final "Buy", "Sell", or "Hold" verdict.
- Sentiment Analysis Tool: Integrate Reddit/Twitter sentiment analysis for meme-stock volatility tracking.
- Technical Analysis Agent: Add a fourth agent specializing in chart patterns (RSI, MACD, etc.).
- Multi-Stock Comparison: Enable the crew to debate which of two stocks is a better investment.
- Portfolio Integration: Connect to personal portfolio APIs to give personalized advice.
- Messenger Integration: Create a Telegram or Discord bot to trigger debates via chat commands.
- PDF Reports: Auto-generate a beautiful PDF report of the debate summary.