A modern stock analysis application powered by a chain of AI agents to collect data, perform analysis, and create visualizations.
This application uses a pipeline of specialized agents to analyze stocks:
- Data Collector Agent: Fetches historical stock data, news, and fundamentals from Alpha Vantage
- Analysis Agent: Examines the data and generates insights and recommendations
- Visualization Agent: Creates interactive charts and visual representations of the analysis
- Modern, responsive UI with sleek animations and visual feedback
- Real-time agent status visualization to show pipeline progress
- Interactive stock charts with price history and technical indicators
- Comprehensive analysis with buy/sell/hold recommendations
- Support for various time periods (1 week to 10 years)
- Python 3.10+
- Alpha Vantage API key (free tier is sufficient)
- Ollama with deepseek-coder model (for LLM capabilities)
-
Clone the repository:
git clone https://github.com/yourusername/ChainOfAgents.git cd ChainOfAgents
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
# On macOS/Linux source venv/bin/activate # On Windows venv\Scripts\activate
-
Install the required dependencies:
pip install -r requirements.txt
-
Configure your API keys in
config.py
:# Alpha Vantage API key ALPHA_VANTAGE_API_KEY = "your_api_key_here"
-
Ensure your virtual environment is activated:
source venv/bin/activate
-
Start the Flask application:
python app.py
-
Open your web browser and navigate to:
http://127.0.0.1:5000
-
Enter a stock symbol (e.g., AAPL, MSFT, GOOG) and select a time period to analyze
-
To stop the application, press
Ctrl+C
in the terminal -
When finished, deactivate the virtual environment:
deactivate
The application uses a chain of agents, each with a specialized role:
-
Data Collector Agent:
- Fetches stock data from Alpha Vantage
- Retrieves news articles and fundamental data
- Caches responses to minimize API calls
-
Analysis Agent:
- Processes historical price data
- Analyzes trends and patterns
- Generates buy/sell/hold recommendations with confidence levels
-
Visualization Agent:
- Creates interactive price charts
- Visualizes key technical indicators
- Provides visual insights to support the analysis
- Frontend: HTML5, CSS3, JavaScript, Bootstrap 5
- Backend: Flask, Python
- Data Visualization: Plotly.js
- API Integration: Alpha Vantage, Yahoo Finance (fallback)
- LLM Integration: Ollama with deepseek-coder model
- Empty Charts: If charts appear empty, check your Alpha Vantage API key in
config.py
- Slow Responses: The free tier of Alpha Vantage has rate limits; cached responses are used when available
- SSL/TLS Errors: These are handled by the application and can be safely ignored
MIT