Skip to content

Commit 0d95fa5

Browse files
committed
Keep Calm and Debug Agentic Workflows
Signed-off-by: Kerry Kurcz <kerry@galileo.ai>
1 parent 6aaa5e2 commit 0d95fa5

19 files changed

Lines changed: 2692 additions & 0 deletions

.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Python virtual environment
2+
finance_env/
3+
venv/
4+
env/
5+
6+
# Python cache files
7+
__pycache__/
8+
*.py[cod]
9+
*$py.class
10+
11+
# Streamlit
12+
.streamlit/secrets.toml
13+
14+
# Distribution / packaging
15+
dist/
16+
build/
17+
*.egg-info/
18+
19+
# IDE specific files
20+
.idea/
21+
.vscode/
22+
*.swp
23+
*.swo
24+
25+
# Environment variables
26+
.env
27+
.env.local
28+
29+
# Logs
30+
*.log

.streamlit/secrets.toml.example

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# API Keys
2+
openai_api_key = ""
3+
galileo_api_key = ""
4+
alpha_vantage_api_key = ""
5+
pinecone_api_key = ""
6+
7+
# Galileo Configuration
8+
galileo_project = ""
9+
galileo_log_stream = ""
10+
galileo_console_url = "https://app.galileo.ai"
11+
12+
# Pinecone Configuration
13+
pinecone_index_name = "galileo-demo"
14+
pinecone_namespace = "sp500-qa-demo"
15+
16+
# Used to authorize users for deleting experiments
17+
admin_key = ""

README.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Finance Transcripts Bot
2+
3+
A Streamlit-based chat application that uses Retrieval Augmented Generation (RAG) to analyze financial transcripts and provide intelligent responses. The application includes tools for stock trading simulation and observability through Galileo.
4+
5+
## Key Features
6+
7+
- RAG-powered question answering over financial transcripts
8+
- Stock trading simulation with purchase/sell functionality
9+
- Galileo observability integration
10+
- Configurable AI models (GPT-4 or GPT-3.5 Turbo)
11+
- Experiment runner for batch processing
12+
- Streamlit web interface with real-time chat
13+
14+
## Project Structure
15+
16+
```
17+
.
18+
├── app.py # Main Streamlit application
19+
├── experiment_runner.py # (Unused) Script for experiment runner
20+
├── generate_env.py # (Unused) Script to convert secrets.toml to .env
21+
├── galileo_api_helper.py # Helper functions for Galileo API
22+
├── pages/ # Streamlit page components
23+
│ └── 2_run_experiment.py
24+
├── tools/ # Financial tools
25+
│ ├── purchase_stocks.py
26+
│ ├── sell_stocks.py
27+
│ └── get_stock_price.py
28+
│ └── get_ticker_symbol.py
29+
└── log_hallucination.py # Hallucination logging utility
30+
```
31+
32+
## Installation
33+
34+
1. Clone the repository
35+
2. Install dependencies:
36+
37+
```bash
38+
pip install -r requirements.txt
39+
```
40+
41+
3. Set up secrets in .streamlit/secrets.toml
42+
43+
```env
44+
openai_api_key = "your_openai_api_key"
45+
pinecone_api_key = "your_pinecone_api_key"
46+
galileo_console_url = "your_galileo_console_url"
47+
pinecone_index_name = "galileo-demo"
48+
pinecone_namespace = "sp500-qa-demo"
49+
galileo_api_key = "your_galileo_api_key"
50+
galileo_project = "your_galileo_project"
51+
galileo_log_stream = "your_galileo_log_stream"
52+
ALPHA_VANTAGE_API_KEY= "your_alpha_vantage_key"
53+
```
54+
55+
## Running the Application
56+
### Streamlit UI
57+
58+
```bash
59+
streamlit run app.py
60+
```
61+
62+
The application will be available at http://localhost:8501
63+
64+
## Usage
65+
66+
The application provides:
67+
68+
1. Interactive chat interface for financial queries
69+
2. Stock trading simulation tools
70+
3. Batch experiment processing
71+
4. Galileo observability for monitoring and debugging
72+
73+
## Tools
74+
75+
- Stock Purchase Simulation: Simulates buying stocks with specified ticker, quantity, and price
76+
- Stock Sale Simulation: Simulates selling stocks with specified ticker, quantity, and price
77+
- Ticker symbol lookup: Using the company name (uses AlphaVantage API key or mocks the data if over API limit)
78+
- Get Stock price: Using the ticker symbol (uses AlphaVantage API key or mocks the data if over API limit)
79+
- RAG System: Uses Pinecone vector store for semantic search over financial transcripts
80+
81+
## Observability
82+
83+
The application uses Galileo for:
84+
- Logging chat interactions
85+
- Tracking tool usage
86+
- Monitoring RAG performance
87+
- Debugging and error tracking

0 commit comments

Comments
 (0)