Skip to content

Commit 6e3797e

Browse files
committed
ai stock analyst agent
1 parent b1ad665 commit 6e3797e

File tree

7 files changed

+472
-0
lines changed

7 files changed

+472
-0
lines changed

ai_stock_analyst_agent/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
__pycache__/
2+
*.py[cod]
3+
.web
4+
assets/external/
5+
*.db

ai_stock_analyst_agent/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Pynecone, Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

ai_stock_analyst_agent/README.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# AI Stock Analyst Agent using Gemini 2.0 Flash (exp)
2+
3+
The **AI Stock Analyst Agent** leverages **Reflex**, **Agno** and **Gemini 2.0 Flash (exp)** to provide advanced financial analysis. It allows users to get comprehensive insights into stock market performance by analyzing individual stocks and their metrics. The app queries relevant data from stock sources, including historical prices, market analysis, and recommendations, to answer user queries about stocks and financial performance.
4+
5+
## Note
6+
7+
Educational Purpose Only: This project is intended for educational purposes only to demonstrate the power of AI in stock analysis.
8+
9+
---
10+
11+
## Features
12+
13+
- **Stock Analysis:** Analyze individual stocks, including key metrics like P/E ratio, market cap, EPS, and 52-week highs and lows.
14+
- **Watchlist Management:** Add or remove stocks from your personalized watchlist for easy monitoring.
15+
- **Gemini 2.0 Flash Integration:** Utilizes Google's Gemini 2.0 Flash for fast, accurate, and dynamic responses.
16+
- **Real-Time Market Data:** Get live stock data, analyst recommendations, and company news from reliable sources like Yahoo Finance.
17+
- **Custom Financial Reports:** In-depth analysis, including executive summaries, professional insights, and risk disclosures.
18+
19+
---
20+
21+
## Getting Started
22+
23+
### 1. Clone the Repository
24+
Clone the GitHub repository to your local machine:
25+
```bash
26+
git clone https://github.com/reflex-dev/reflex-llm-examples.git
27+
cd reflex-llm-examples/ai_stock_analyst_agent
28+
```
29+
30+
### 2. Install Dependencies
31+
Install the required dependencies:
32+
```bash
33+
pip install -r requirements.txt
34+
```
35+
36+
### 3. Set Up Gemini API Key
37+
To use the Gemini 2.0 Flash model, you need a **Google API Key**. Follow these steps:
38+
Go to [Google AI Studio](https://aistudio.google.com/apikey), get your API Key, and set it as an environment variable:
39+
```bash
40+
export GOOGLE_API_KEY="your-api-key-here"
41+
```
42+
43+
### 4. Run the Reflex App
44+
Start the application:
45+
```bash
46+
reflex run
47+
```
48+
49+
---
50+
51+
## How It Works
52+
53+
1. **Stock Query:** Ask questions like "Analyze AAPL's performance" or any other stock symbol.
54+
2. **Gemini 2.0 Flash:** The app generates a detailed report with metrics like the latest stock price, P/E ratio, market cap, analyst recommendations, and more.
55+
3. **Real-Time Data:** The app integrates with Yahoo Finance and other tools to get real-time market insights.
56+
4. **Watchlist:** Add stocks to your watchlist for easy monitoring and analysis over time.
57+
58+
---
59+
60+
## Why AI Stock Agent?
61+
62+
- **Real-Time Data Access:** Provides live stock information, analyst insights, and historical data to give you a full picture of stock performance.
63+
- **Smart Financial Analysis:** The agent uses the power of Gemini 2.0 Flash and Yahoo Finance tools to give you comprehensive, accurate financial reports.
64+
- **User-Friendly:** Seamless user experience with easy stock addition/removal, and clear, actionable insights.
65+
66+
---
67+
68+
## Contributing
69+
70+
We welcome contributions! Feel free to open issues or submit pull requests to improve the app.
71+
72+
---

ai_stock_analyst_agent/agent/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)