A Streamlit-based AI agent that monitors news sentiment shifts for a watchlist of stocks and triggers in-app alerts when sentiment changes exceed your configured thresholds.
It uses:
- Finnhub for news sentiment (
/news-sentiment) and optional company headlines (/company-news). - OpenAI (optional) to generate a short narrated explanation of why a shift may have happened.
⚠️ Educational project only — not financial advice.
- Watchlist-based monitoring (AAPL, NVDA, etc.)
- Finnhub News Sentiment polling
- Threshold-based “shift detection” (delta-based)
- Persistent user context stored locally in JSON
- In-app alerts feed (acknowledge / clear)
- Email + chat notification channels included as disabled stubs (safe for public GitHub)
This project stores context in a local JSON file instead of a database.
- Per-user watchlist
- Threshold settings
- Last-seen sentiment values (baseline) to compute deltas
- Alert history (per user)
- Acknowledgement status
For a public repo, JSON is simple, portable, and easy to understand. For enterprise/multi-instance deployments, you’d replace this with a database.
You need:
- Finnhub API Key (required)
- OpenAI API Key (optional for narration)
Keys are entered in the Streamlit sidebar and are not committed to git.
Clone repo and install dependencies:
python -m venv venv
source venv/bin/activate # macOS/Linux
pip install -r requirements.txt