
An AI-powered stock analysis and investment recommendation app built using CrewAI Agents, Gemini LLM, DuckDuckGo Search and real-time financial data via Yahoo Finance. The application uses multi-agent AI with Gemini models to collect stock data, news, research/web scraping and perform financial analysis & generates comprehensive reports, news summaries, and buy/hold/sell advice.
- 📈 Real-time stock data, financial ratios, and historical trends
- 📰 Latest company-specific news analysis
- 🧠 Multi-agent reasoning using CrewAI
- 💡 Buy/Hold/Sell recommendations based on financial insights
- 📨 Report generation + optional email delivery
- 🧾 Exports PDF report for LinkedIn, email, or investor presentation use
- CrewAI – Autonomous multi-agent orchestration
- Google Gemini (via Langchain) – LLM for reasoning and generation
- Yahoo Finance API – Real-time financial data
- Streamlit – Interactive web UI
- pdfkit + markdown – PDF report generation
- smtplib – Email dispatch functionality
- Stock Data Collector
- News Reader
- Financial Analyst
- Financial Expert
- Input company name or stock ticker to generate reports.
- Fetches real-time stock data and historical prices.
- Extract financial data from income statements, balance sheets and cash flow.
- Summarizes recent news articles related to the stock.
- Conducts stock market research with web scraping.
- Generates a detailed stock analysis report in both text/markdown and PDF formats.
- Displays the report and chain of thought reasoning in the user interface.
- Sends the generated report via email.
Run Application:
streamlit run app.py


git clone https://github.com/MukulGupta121190/CrewAi-Gemini-Stock-Analyser.git
cd CrewAi-Gemini-Stock-Analyser
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install -r requirements.txt
LITELLM_PROVIDER=gemini
MODEL_NAME=gemini-2.0-flash-lite
GEMINI_API_KEY=your_google_gemini_api_key
GOOGLE_APPLICATION_CREDENTIALS=path_to_your_service_account.json
AGENTOPS_API_KEY=your_agentops_api_key
SENDER_EMAIL=your_email@gmail.com
EMAIL_PASSWORD=your_app_specific_password
- Download wkhtmltopdf package from https://wkhtmltopdf.org/downloads.html
- Use the following command on Mac terminal to install the package on your machine
Sudo installer -pkg /path_to_package/wkhtmltox-0.12.6-2.macos-cocoa.pkg -target /usr/local/bin
Gemini’s web tools and some Langchain integrations require access to Google Cloud resources (e.g., embedding, vector search). This is authenticated via a service account JSON file, pointed to by GOOGLE_APPLICATION_CREDENTIALS. You can generate this JSON from:
By default, CrewAI expects an OpenAI API key even if you’re using Google Gemini. To avoid this, we apply the following temporary workaround in config.py or before initializing the Crew:
os.environ["OPENAI_API_KEY"] = "dummy-key"
os.environ["AGENTOPS_DISABLED"] = "true"
This bypasses internal validation and disables telemetry via AgentOps.
Contributions to this project are welcome! If you have any ideas for improvements, bug fixes, or new features, feel free to submit a pull request.
For any questions or issues, please contact [mukulgupta121190@gmail.com] or feel free to reach out to me on LinkedIn.