Skip to content

Commit f6d7de5

Browse files
feat(02-use-cases): genai_powered_financial_advisor_tools (#181)
* new sample 16-genai_powered_financial_advisor_tools * new sample GenAI powered financial advisor tools * new sample 16 financial advisor genai tools * redme.md update * change on readme.md file and add .gitkeep to import empty folders * fixed chart issue * feat: feat: GenAI powered financial advisor tools- README.md update git push * feat: GenAI powered financial advisor tools” 11. Git push origin 16-genai_powered_financial_advisor_tools * feat: GenAI powered financial advisor tools” q * feat: GenAI powered financial advisor tools * feat: GenAI powered financial advisor tools --------- Co-authored-by: TH Her <[email protected]>
1 parent ca7230e commit f6d7de5

22 files changed

+7993
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TAVILY_API_KEY=""
Lines changed: 260 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,260 @@
1+
# GenAI-Powered Financial Advisor
2+
3+
A comprehensive GenAI-powered wealth and financial tools built with **Strands Agents**, **Amazon Bedorck**, and **MCP** designed to automate client meeting analysis, advisor follow-up item analysis, portfolio analysis, market research, and report generation for financial advisors.
4+
5+
## ✨ Key Features
6+
7+
### πŸ“Š Financial Analysis Capabilities
8+
- **Portfolio Analysis**: Comprehensive portfolio performance tracking and analysis
9+
- **Stock Market Data**: Real-time stock pricing, historical data, and market trends
10+
- **Market Research**: Web-based research using Tavily integration
11+
- **Performance Metrics**: Detailed financial metrics and comparative analysis
12+
13+
### πŸ“ Client Meeting Management
14+
- **Meeting Analysis**: AI-powered analysis of client meeting notes and transcripts
15+
- **Sentiment Analysis**: Customer sentiment assessment with supporting evidence
16+
- **Action Item Extraction**: Automated identification of follow-up tasks , decisions and find necessary answers
17+
18+
### πŸ“ˆ Reporting & Documentation
19+
- **PDF Report Generation**: Professional client reports with charts and analysis
20+
21+
### πŸ€– AI-Powered Chat Interface
22+
- **Interactive UI**: Streamlit-based interface with example queries and configuration options
23+
24+
## πŸ—οΈ Architecture
25+
Overall architecture in multi-agent collaboration with MCP and tools.
26+
![architecture](./assets/architecture.png)
27+
28+
Autonomous agents are a current market trend. Complex inquiries will take time to complete. Here is the process flow for financial advisors to complete complex tasks using **Strands Agents Graph pattern**
29+
30+
![architecture](./assets/architecture_graph.png)
31+
32+
### Core Components
33+
34+
```
35+
17-genai-powered-financial-advisor-tools/
36+
β”œβ”€β”€ application/ # Main application code
37+
β”‚ β”œβ”€β”€ app.py # Streamlit web interface
38+
β”‚ β”œβ”€β”€ chat.py # Core chat logic and agent
39+
β”‚ β”œβ”€β”€ info.py # Model configuration
40+
β”‚ β”œβ”€β”€ prompt.py # System prompts for GenAI
41+
β”‚ β”œβ”€β”€ retrieve_schema.py # pre-load database schema
42+
β”‚ β”œβ”€β”€ mcp_server_*.py # MCP server implementations
43+
β”‚ └── prerequisites/ # Setup and configuration
44+
β”‚ β”œβ”€β”€ athena_database_setup.py
45+
β”‚ β”œβ”€β”€ bedrock_knowledge_base_setup.py
46+
β”‚ β”œβ”€β”€ prereqs_config.yaml
47+
β”‚ └── client_meeting_note.txt
48+
β”œβ”€β”€ assets/ # Application assets (fonts, images)
49+
β”‚ β”œβ”€β”€ AmazonEmber_Lt.ttf
50+
β”‚ β”œβ”€β”€ architecture_graph.png
51+
β”‚ └── architecture.png
52+
β”œβ”€β”€ outputs/ # Generated reports and charts
53+
β”‚ β”œβ”€β”€ charts/ # Stock charts and visualizations
54+
β”‚ └── reports/ # PDF reports and analysis documents
55+
β”œβ”€β”€ requirements.txt # Python dependencies
56+
β”œβ”€β”€ README.md
57+
β”œβ”€β”€ .env.example
58+
└── deploy_prereqs.sh
59+
```
60+
### MCP (Model Context Protocol) Servers
61+
62+
The application includes specialized MCP servers for different data sources:
63+
64+
- **Stock Data Server** (`mcp_server_stock.py`): Yahoo Finance API integration for stock data
65+
- **Athena Server** (`mcp_server_athena.py`): AWS Athena database queries for portfolio data
66+
- **Tavily Server** (`mcp_server_tavily.py`): Web search capabilities for market research
67+
- **Knowledge Base List Server** (`mcp_server_kb.py`): Amazon Bedrock Knowledge Bases integration
68+
69+
### Specialized AI Agents
70+
71+
- **Client Meeting Analysis Agent**: Processes meeting notes and extracts insights
72+
- **Web Search Agent**: Conducts comprehensive web research for financial information
73+
- **Market Search Agent**: Specialized market research and economic analysis
74+
- **Database Query Agent**: Retrieves portfolio and client data from databases
75+
- **Stock Analysis Agent**: Real-time stock data analysis and reporting
76+
- **Report Generation Agent**: Generate PDF report
77+
78+
## πŸš€ Quick Start
79+
80+
### Prerequisites
81+
82+
- **Python 3.8+** (Python 3.9+ recommended)
83+
- **AWS Account** with Bedrock access and appropriate permissions
84+
- **AWS CLI** configured with credentials
85+
- **Required AWS Services**:
86+
- Amazon Bedrock (Claude models v3.7 and v4.0, follow instructions [here](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access-modify.html))
87+
- Amazon Bedrock Knowledge Bases (for doucment queries)
88+
- AWS Athena (for database queries)
89+
- Amazon S3 (for data storage)
90+
91+
### Installation
92+
93+
1. **Clone and navigate to the GenAI_powered_financial_advisor_tools directory**:
94+
```bash
95+
git clone https://github.com/strands-agents/samples.git
96+
cd 17-genai-powered-financial-advisor-tools
97+
```
98+
99+
2. **Set up Python virtual environment**:
100+
```bash
101+
python -m venv .venv
102+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
103+
```
104+
105+
3. **Install dependencies**:
106+
```bash
107+
pip install -r requirements.txt
108+
```
109+
110+
3. **Configure AWS credentials**:
111+
```bash
112+
aws configure
113+
114+
# Or set environment variables:
115+
116+
export AWS_ACCESS_KEY_ID=your_access_key
117+
export AWS_SECRET_ACCESS_KEY=your_secret_key
118+
export AWS_DEFAULT_REGION=us-west-2
119+
120+
```
121+
122+
4. **Set up prerequisites**:
123+
124+
This script will create Amazon Bedrock Knowledge Bases. Also, it will create database, tables, and insert sample data using Amazon Athena.
125+
```bash
126+
bash deploy_prereqs.sh
127+
```
128+
129+
6. **Create Tavily API key and add in the .env file**:
130+
131+
Visit [Travily](https://www.tavily.com/) and create API key post sign-up. Update your tavily api key in .env file. This is mandatory required to run the GenAI tools :
132+
```bash
133+
TAVILY_API_KEY=""
134+
```
135+
136+
6. **Start the application**:
137+
138+
Execute the following commands in the "17-genai-powered-financial-advisor-tools" directory
139+
```bash
140+
streamlit run application/app.py
141+
```
142+
143+
7. **Access the application**:
144+
- Open your browser to `http://localhost:8501`
145+
- Select your preferred AI model from the sidebar
146+
- Start interacting with the Financial Advisor AI
147+
148+
## πŸ”§ Configuration
149+
150+
### Prerequisites Configuration
151+
152+
The null fields will be automatically updated when you run deploy_prereqs.sh file
153+
`application/prerequisites/prereqs_config.yaml`:
154+
155+
```yaml
156+
database_name: null
157+
knowledge_base_description: financial advisor
158+
knowledge_base_id: null
159+
knowledge_base_name: null
160+
project_name: financial-advisor
161+
project_short_name: fa
162+
region_name: us-west-2
163+
s3_bucket_name_for_athena: null
164+
s3_bucket_name_for_kb: null
165+
166+
```
167+
168+
## πŸ’‘ Usage Examples
169+
170+
### Portfolio Analysis
171+
```
172+
"Michael Chen's Portfolio Summary"
173+
```
174+
Retrieves comprehensive portfolio information including holdings, performance metrics, and analysis.
175+
176+
### Stock Market Research
177+
```
178+
"Amazon stock pricing today"
179+
"Compare Amazon and Microsoft stock performance over the last year"
180+
"The prospects for the US stock market for remaining 2025"
181+
```
182+
183+
### Client Meeting Analysis
184+
```
185+
"client meeting summary of knowledge base ID kb-12345" (your knowledge base id)
186+
"using knowledge base Financial advisor Sarah Johnson, Provide a complete customer report"
187+
```
188+
189+
### Market Research
190+
```
191+
"Latest trends in renewable energy investments"
192+
"Federal Reserve interest rate impact on tech stocks"
193+
```
194+
195+
## πŸ“š Dependencies
196+
197+
### Core Dependencies
198+
- **strands-agents**: AI agent framework
199+
- **streamlit**: Web interface framework
200+
- **boto3**: AWS SDK for Python
201+
- **pandas**: Data manipulation and analysis
202+
- **matplotlib**: Plotting and visualization
203+
- **reportlab**: PDF generation
204+
- **yfinance**: Stock market data
205+
- **tavily-python**: Web search capabilities
206+
- **mcp**: Model Context Protocol implementation
207+
208+
209+
210+
7. **Access the application**:
211+
- Open your browser to `http://localhost:8501` (Check "7. Start the application" in the above instruction)
212+
- Select your preferred AI model from the sidebar
213+
- Start interacting with the Financial Advisor AI
214+
215+
## πŸ”§ Cleanup
216+
217+
Clean up created resources by executing the scripts in the application/prerequisites/ directory:
218+
219+
```yaml
220+
#Delete knowledge base relavent resources
221+
python bedrock_knowledge_base_setup.py --mode delete
222+
223+
#Delete database relavent resources
224+
python athena_database_setup.py --mode delete
225+
```
226+
227+
## πŸ“„ License
228+
229+
This project is licensed under the MIT No Attribution License - see the [LICENSE](LICENSE) file for details.
230+
231+
## 🀝 Contributing
232+
233+
Contributions are welcome! Please:
234+
235+
1. Fork the repository
236+
2. Create a feature branch
237+
3. Add comprehensive tests
238+
4. Update documentation
239+
5. Submit a pull request
240+
241+
## πŸ“ž Support
242+
243+
For support and questions:
244+
245+
1. **Review your permission** on AWS
246+
2. **Tavily API KEY** is added on .env file
247+
3. **Verify model access** in Bedrock console
248+
4. **Test basic functionality** with simple queries
249+
5. **Check application logs** for detailed error information
250+
251+
## πŸ”— Related Resources
252+
253+
- [Strands Agents Documentation](https://strandsagents.com/)
254+
- [AWS Bedrock Documentation](https://docs.aws.amazon.com/bedrock/)
255+
- [Amazon Bedrock Knowledge Bases](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base.html)
256+
- [Streamlit Documentation](https://docs.streamlit.io/)
257+
258+
---
259+
260+
**Transform your financial advisory practice with AI-powered insights and automation! πŸš€**

0 commit comments

Comments
Β (0)