Once you have sucessfully done every step mentioned below.
You can also Play around .
Stock_guru_ai.-.Made.with.Clipchamp.1.mp4
This project is a robust and scalable multi-agent stock investment and analysis platform built using a Flask backend and a Next.js frontend, leveraging CrewAI for sophisticated multi-agent interactions. The platform is designed to provide detailed insights and recommendations for stock investments by utilizing a multi-agent approach, enabling users to make informed decisions even with limited prior knowledge of stocks and market analysis.
- Multi-Agent Analysis: Utilizes CrewAI to deploy multiple agents for in-depth stock analysis and investment recommendations.
- User-Friendly Interface: Intuitive and responsive interface built with Next.js to enhance user experience.
- Real-Time Data: Provides real-time stock data and insights to aid in decision-making.
- Secure and Scalable: Flask backend ensures the platform is secure and can scale as needed.
- Backend: Flask
- Frontend: Next.js
- AI/ML Integration: CrewAI,LangChain
- Database: None (For Now)
- APIs: YahooFinance Api using yfinance Package
- Env:Conda
- Docker: Make sure Docker is installed on your system. You can download it from the official Docker website.
- Clone the repository: See Backend Setup Step 1 Command
- Setup Environments : See Env Setup
- Change Directory to Stock_Analyzer:-
cd Stock_investment_Analysis_Crew/Stock_Analyzer
4.Docker Build Both Frontend and Backend with Compose (Can even build Frontend and Backend Seperately using docker build Dockerfile)
docker-compose build
5.Docker Run build (replace 'up' with 'down' before recreating build)
docker-compose up
- Python 3.10+
- Node.js 14+
- npm or yarn
- Conda 20+
- Clone the repository:
git clone https://github.com/pravincoder/Stock_investment_Analysis_Agent.git
- Navigate to the Main directory:
cd Stock_investment_Analysis_Agent/Stock_Analyzer
- Create a conda environment:
conda env create -f environment.yml
- Activate the Conda Environment:
conda activate stock_guru
- Run the Flask development server:
python app.py
- Navigate to the frontend directory:
cd nextjs_app
- Install the dependencies:
Keep every option default while setting up the app.
npx create-next-app@latest --js --tailwind --eslint
- Run the Next.js development server:
npm run dev
Note:- You need to execute both the backend Flask app and the Frontend as we are using cross connection with flask-cors.
Create a .env file and add the below code :- (Make sure to add the api keys from the specified platforms)
# API Key for GROQ
GROQ_API_KEY=your_groq_api_key_here
# API Key for OpenAI
OPENAI_API_KEY=your_openai_api_key_here
# Base URL for OpenAI API (default for local setup)
OPENAI_API_BASE=http://localhost:11434/v1
# Model name for OpenAI (adjust based on available models)
OPENAI_MODEL_NAME=mistral:latest
# Optional: API Key for LangChain
LANGCHAIN_API_KEY=your_langchain_api_key_here
# Optional: Enable LangChain tracing
LANGCHAIN_TRACING_V2=true
-
Use the files in the setup folder to create a LLama3 , Mistral8b ... or your own LLM model
-
Commands/steps to setup ollama llm comming soon!
Once the servers are running, you can access the application in your browser by navigating to http://localhost:3000
.
- Dashboard: Begin by exploring the dashboard for a quick overview of stock market trends.
- Stock Analysis: Use the analysis tools to select specific stocks and view detailed insights provided by the AI agents.
- Recommendations: Get tailored investment recommendations based on your portfolio and risk profile.
The Flask backend exposes several API endpoints that can be used for data retrieval and interaction:
POST /analyze-stock
: Analyze a stock and return Analysis and Investment reports in Markdown format.
(Detailed documentation for each endpoint can be provided here. In near future we might make a seperate api endpoints for both reports.)
We welcome contributions! To get started:
- Fork the repository.
- Create a new feature branch (
git checkout -b feature-name
). - Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature-name
). - Open a pull request.
Please ensure your code adheres to the project's coding standards and passes all tests.
This project is licensed under the MIT License - see the LICENSE file for details.
For any questions, issues, or suggestions, please contact:
- Project Maintainer: Pravin Maurya
- GitHub: PravinCoder