Skip to content

Latest commit

 

History

History
59 lines (39 loc) · 1.64 KB

File metadata and controls

59 lines (39 loc) · 1.64 KB

📰📈 Sentiment Shift Alert Agent

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.


✨ Features

  • 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)

🧠 How “Context” Works (JSON Memory)

This project stores context in a local JSON file instead of a database.

context.json stores:

  • Per-user watchlist
  • Threshold settings
  • Last-seen sentiment values (baseline) to compute deltas

alerts.json stores:

  • 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.


🔑 API Keys

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.


📄 Setup

Clone repo and install dependencies:

python -m venv venv
source venv/bin/activate  # macOS/Linux
pip install -r requirements.txt