|
1 | | -# Financial Analyst with CrewAI and DeepSeek using SambaNova |
| 1 | +# MCP-powered Financial Analyst using CrewAI and Deepseek-R1 |
2 | 2 |
|
3 | | -This project implements a Financial Analyst with CrewAI and DeepSeek using SambaNova. |
4 | | -- [SambaNova](https://fnf.dev/4jH8edk) is used to as the inference engine to run the DeepSeek model. |
5 | | -- CrewAI is used to analyze the user query and generate a summary. |
6 | | -- Streamlit is used to create a web interface for the project. |
| 3 | +This project implements a financial analysis agentic workflow that analyzes stock market data and provides insights. |
7 | 4 |
|
| 5 | +We use: |
| 6 | +- CrewAI for multi-agent orchestration. |
| 7 | +- Ollama for serving Deepseek-R1 locally. |
| 8 | +- Cursor IDE as the MCP host. |
8 | 9 |
|
9 | 10 | --- |
10 | 11 | ## Setup and installations |
11 | 12 |
|
12 | | -**Get SambaNova API Key**: |
13 | | -- Go to [SambaNova](https://fnf.dev/4jH8edk) and sign up for an account. |
14 | | -- Once you have an account, go to the API Key page and copy your API key. |
15 | | -- Paste your API key by creating a `.env` file as shown below: |
| 13 | +**Install Ollama** |
16 | 14 |
|
17 | | -``` |
18 | | -SAMBANOVA_API_KEY=your_api_key |
| 15 | +```bash |
| 16 | +# Setting up Ollama on linux |
| 17 | +curl -fsSL https://ollama.com/install.sh | sh |
| 18 | + |
| 19 | +# Pull the Deepseek-R1 model |
| 20 | +ollama pull deepseek-r1 |
19 | 21 | ``` |
20 | 22 |
|
| 23 | +**Install Dependencies** |
21 | 24 |
|
22 | | -**Install Dependencies**: |
23 | | - Ensure you have Python 3.11 or later installed. |
| 25 | + Ensure you have Python 3.12 or later installed. |
| 26 | + |
| 27 | + You can use uv to directly install the required dependencies (recommended). |
24 | 28 | ```bash |
25 | | - pip install streamlit openai crewai crewai-tools |
| 29 | + uv pip sync uv.lock |
| 30 | + ``` |
| 31 | + |
| 32 | + Or you can also use pip to install the following dependecnies to your local environment. |
| 33 | + ```bash |
| 34 | + pip install crewai crewai-tools ollama mcp pydantic yfinance pandas matplotlib |
26 | 35 | ``` |
27 | 36 |
|
28 | 37 | --- |
29 | 38 |
|
| 39 | +## Run the project |
| 40 | + |
| 41 | +First, set up your MCP server as follows: |
| 42 | +- Go to Cursor settings |
| 43 | +- Select MCP |
| 44 | +- Add new global MCP server. |
| 45 | + |
| 46 | +In the JSON file, add this: |
| 47 | +```json |
| 48 | +{ |
| 49 | + "mcpServers": { |
| 50 | + "financial-analyst": { |
| 51 | + "command": "uv", |
| 52 | + "args": [ |
| 53 | + "--directory", |
| 54 | + "absolute/path/to/project_root", |
| 55 | + "run", |
| 56 | + "--with", |
| 57 | + "mcp", |
| 58 | + "server.py" |
| 59 | + ] |
| 60 | + } |
| 61 | + } |
| 62 | +} |
| 63 | +``` |
| 64 | + |
| 65 | +You should now be able to see the MCP server listed in the MCP settings. |
| 66 | + |
| 67 | +In Cursor MCP settings make sure to toggle the button to connect the server to the host. Done! Your server is now up and running. |
| 68 | + |
| 69 | +You can now chat with Cursor and analyze stock market data. Simply provide the stock symbol and timeframe you want to analyze, and watch the magic unfold. |
| 70 | + |
| 71 | +**Example queries**: |
| 72 | +- "Show me Tesla's stock performance over the last 3 months" |
| 73 | +- "Compare Apple and Microsoft stocks for the past year" |
| 74 | +- "Analyze the trading volume of Amazon stock for the last month" |
30 | 75 |
|
31 | 76 | --- |
32 | 77 |
|
|
0 commit comments