🤖 AI-powered stock analysis application built with Python, AutoGen multi-agent architecture, and Gradio UI
- 🔐 Secure Login - Authentication system protects application access
- 🔄 Dual API Sources - Alpha Vantage API with automatic failover to Yahoo Finance (plan B)
- 📊 Technical Analysis - Comprehensive metrics including:
- Moving averages (50-day, 200-day)
- Price trends and momentum indicators
- Volatility measurements
- 6-month and monthly returns
- 🧠 AI-Powered Recommendations - Get BUY/HOLD/SELL guidance based on technical indicators
- 📧 Email Reports - Send beautifully formatted HTML analysis reports via Azure Logic Apps
- 🤖 Multi-Agent Architecture - Leverages specialized AI agents for different analytical tasks

-
Clone the repository:
git clone https://github.com/yourusername/Stock-Analysis-AutoGen-Multi-Agent.git cd Stock-Analysis-AutoGen-Multi-Agent
-
Create and activate a virtual environment:
python -m venv venv # On Windows venv\Scripts\activate # On macOS/Linux source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
cp .env.example .env
Edit the
.env
file with your API keys and configuration settings.
-
Start the application:
python main.py
-
Open your web browser and navigate to:
http://localhost:7860
-
Log in with your credentials.
-
Enter a stock symbol (e.g., AAPL, MSFT) and click "Analyze" to get AI-powered insights.
├── agents/ # AutoGen multi-agent system components
│ ├── __init__.py
│ ├── analyst_agent.py # Technical analysis agent
│ ├── data_agent.py # Stock data retrieval agent
│ ├── planner_agent.py # Coordinates the analysis workflow
│ └── recommender_agent.py # Generates investment recommendations
├── assets/ # Static assets for UI
├── data/ # Cached data and analysis results
├── ui/ # Gradio UI components
│ ├── __init__.py
│ ├── app.py # Main UI definition
│ └── components/ # Reusable UI components
├── utils/ # Utility functions
│ ├── __init__.py
│ ├── api_handler.py # API integration with fallback
│ ├── auth.py # Authentication logic
│ ├── email_sender.py # Email report functionality
│ └── technical.py # Technical analysis functions
├── .env # Environment variables (not in git)
├── .env.example # Example environment variables
├── .gitignore # Git ignore file
├── LICENSE # Project license
├── main.py # Application entry point
├── README.md # Project documentation
└── requirements.txt # Python dependencies

This application requires the following API keys:
-
Alpha Vantage API - Primary source for stock data
- Get a free API key at: https://www.alphavantage.co/support/#api-key
-
Azure OpenAI Service - Powers the AI agents
- Set up through Azure AI services: https://azure.microsoft.com/en-us/products/ai-services/openai-service
-
Azure Logic Apps (optional) - For email delivery
- Configure through Azure portal: https://portal.azure.com
The system can send detailed stock analysis reports via email using Azure Logic Apps:
- Create an HTTP-triggered Logic App in Azure
- Add the Logic App URL to your
.env
file - Use the "Send Email" option in the application UI, see below template logicapps -

Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Alpha Vantage, yfinance API providers
- AutoGen - Multi-agent framework
- Gradio - UI framework
- Alpha Vantage - Stock data API
- Yahoo Finance - Backup stock data source