Your AI co-pilot for FIRE investing

Inspiration

The FIRE (Financial Independence, Retire Early) movement has inspired millions to take control of their financial futures. But here's the problem: markets don't sleep, and neither should your portfolio monitoring.

I've watched friends obsessively check stock prices during work hours, miss critical buying opportunities overnight, and panic-sell during market dips because they didn't have the full picture. Traditional portfolio trackers are passive β€” they show you what happened, but they don't act on your behalf.

The "Aha!" Moment: What if we could build an AI agent that monitors your portfolio 24/7, analyzes not just prices but also market sentiment from news, and proactively alerts you to opportunities and risks? An agent that combines real-time data, sentiment analysis, and intelligent decision-making to protect your path to financial independence.

That's how FIRE Sentinel was born.

What it does

FIRE Sentinel is an autonomous AI portfolio monitoring system that:

  1. Monitors Stock Prices - Fetches real-time prices using Alpha Vantage with Yahoo Finance fallback
  2. Scrapes Financial News - Pulls latest articles from Google News RSS (unlimited, free)
  3. Analyzes Sentiment - Uses VADER sentiment analysis to gauge market mood
  4. Calculates Risk - Combines price movements and sentiment to assess portfolio risk
  5. Generates Smart Alerts - Sends actionable notifications via email/Slack for:
    • 🎯 Target profit reached (take profits!)
    • πŸ›‘ Stop loss triggered (cut losses!)
    • πŸ“‰ Significant price drops
    • πŸ“ˆ Price surges
    • πŸ’° Strong BUY signals
    • ⚠️ Strong SELL signals
    • 🚨 High risk warnings

The Magic: It doesn't just tell you what happened β€” it tells you what to do about it.

How we built it

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Agent Orchestrator                    β”‚
β”‚              (Coordinates entire workflow)               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β–Ό                   β–Ό                   β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚Price Monitor β”‚    β”‚News Scraper  β”‚    β”‚Risk Assessor β”‚
β”‚              β”‚    β”‚              β”‚    β”‚              β”‚
β”‚Alpha Vantage β”‚    β”‚Google News   β”‚    β”‚VADER         β”‚
β”‚+ Yahoo       β”‚    β”‚RSS Feed      β”‚    β”‚Sentiment     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚                   β”‚                   β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚Alert Engine  β”‚
                    β”‚              β”‚
                    β”‚Email / Slack β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Tech Stack

Core:

  • Python 3.10+ - Main language
  • Pydantic - Data validation and modeling
  • asyncio - Concurrent data fetching

Data Sources:

  • Alpha Vantage API - Primary stock price data
  • yfinance - Fallback price data (eliminates rate limits!)
  • Google News RSS - Free, unlimited news articles
  • feedparser - RSS parsing

AI/ML:

  • VADER Sentiment Analysis - News sentiment scoring
  • Custom Risk Algorithm - Combines price + sentiment

Alerts:

  • Python SMTP - Email delivery
  • Slack Webhooks - Team notifications

Development:

  • Prompt-Driven Development (PDD) - AI-assisted code generation
  • pytest - Testing framework
  • Git/GitHub - Version control

Key Implementation Details

1. Dual-Source Price Monitoring

def get_price_change(symbol: str, period: str) -> PriceChange:
    try:
        # Try Alpha Vantage first
        return get_price_change_alpha_vantage(symbol, period)
    except APIError:
        # Fallback to Yahoo Finance
        return get_price_change_yfinance(symbol, period)

Why? Alpha Vantage has strict rate limits (25 req/day free tier). Yahoo Finance provides unlimited fallback.

2. Direct RSS Scraping

def _parse_rss_directly(symbol: str, limit: int = 20) -> List[NewsArticle]:
    url = f"https://news.google.com/rss/search?q={symbol}+stock"
    feed = feedparser.parse(url)
    # Parse and filter articles from last 48 hours

Why? No API keys, no rate limits, no costs. Just pure RSS parsing.

3. Sentiment-Driven Risk Assessment

The risk calculation combines multiple signals:

$$\text{Risk Score} = w_1 \cdot \text{Price Change} + w_2 \cdot \text{Sentiment} + w_3 \cdot \text{Volatility}$$

Where:

  • Price drops > 5% β†’ High risk
  • Negative sentiment (< -0.3) β†’ High risk
  • Combined signals β†’ Intelligent recommendations

4. Smart Buy/Sell Recommendations

STRONG BUY Signal:

  • Price drop β‰₯ 5% AND positive sentiment (> 0.2)
  • Interpretation: Market overreacted, fundamentals strong

STRONG SELL Signal:

  • Price drop β‰₯ 5% AND negative sentiment (< -0.3)
  • Interpretation: Fundamental problems, cut losses

5. Target Profit & Stop Loss

Automated profit-taking and loss-cutting:

$$\text{Profit/Loss \%} = \frac{\text{Current Price} - \text{Purchase Price}}{\text{Purchase Price}} \times 100$$

  • Alert when profit β‰₯ target (e.g., 20%)
  • Alert when loss β‰₯ stop loss (e.g., 10%)

Challenges we ran into

Challenge 1: API Rate Limits

Problem: Alpha Vantage free tier allows only 25 requests/day. With 5 stocks and hourly monitoring, we'd hit limits in 5 hours.

Solution: Implemented Yahoo Finance as automatic fallback. Now we have unlimited price data!

# Graceful degradation
try:
    price = get_alpha_vantage_price(symbol)
except RateLimitError:
    price = get_yahoo_finance_price(symbol)  # Unlimited!

Challenge 2: News API Costs

Problem: Most news APIs (NewsAPI, Alpha Vantage News) have strict limits or require paid plans.

Solution: Discovered Google News RSS feeds are free, unlimited, and don't require API keys! Built custom RSS parser with VADER sentiment analysis.

Impact: $0/month for unlimited news vs. $50-200/month for paid APIs.

Challenge 3: Toolhouse SDK Integration

Problem: Toolhouse SDK is designed for LLM tool calling, not direct action execution. The run_action() method doesn't exist.

Solution: Replaced with Python's built-in smtplib for email and Slack webhooks. More reliable, no external dependencies.

Challenge 4: Threshold Management

Problem: Different stocks need different thresholds (TSLA is volatile, AAPL is stable).

Solution: Implemented per-stock threshold overrides with portfolio-level defaults:

{
  "symbol": "TSLA",
  "threshold": {
    "price_drop_percent": 5.0,
    "target_profit_percent": 25.0,
    "stop_loss_percent": 12.0
  }
}

Challenge 5: Timezone Issues

Problem: News articles published "1 hour ago" might be in different timezones, causing false negatives.

Solution: Extended time window from 24 to 48 hours and added timezone-aware date parsing.

Accomplishments that we're proud of

  1. βœ… Zero-Cost News Scraping - Eliminated $50-200/month API costs by using Google News RSS feeds
  2. βœ… Intelligent Recommendations - Not just alerts, but actionable BUY/SELL/HOLD advice based on price + sentiment
  3. βœ… Robust Fallbacks - System never fails due to rate limits (Alpha Vantage β†’ Yahoo Finance fallback)
  4. βœ… Clean Architecture - Modular, testable, maintainable code with 7 core modules
  5. βœ… Comprehensive Testing - 15 test files covering all modules with real-world scenarios
  6. βœ… Production-Ready - Error handling, logging, retry logic, and graceful degradation
  7. βœ… Well-Documented - 14 markdown docs explaining every feature and design decision
  8. βœ… Real-Time Analysis - Reduced analysis time from 30s to 5s using async Python
  9. βœ… Flexible Thresholds - Per-stock threshold overrides for different risk profiles
  10. βœ… $0/month Operating Cost - Runs entirely on free-tier APIs

What we learned

Technical Learnings

  1. Async Python is Powerful - Concurrent API calls reduced analysis time from 30s to 5s
  2. RSS is Underrated - Free, reliable, and perfect for news aggregation
  3. Graceful Degradation - Always have a fallback (Alpha Vantage β†’ Yahoo Finance)
  4. Sentiment Analysis Works - VADER accurately captures market mood from headlines
  5. Pydantic is Amazing - Type safety and validation prevented countless bugs

Product Learnings

  1. Users Want Actionable Insights - Not just "price dropped 5%" but "SELL NOW: Stop loss triggered"
  2. Context Matters - Combining price + sentiment gives better signals than either alone
  3. Automation Reduces Stress - Users don't want to check prices constantly
  4. Thresholds Must Be Flexible - One size doesn't fit all stocks

AI/Prompt Engineering Learnings

  1. Prompt-Driven Development (PDD) - Used AI to generate initial module code from detailed prompts
  2. Iterative Refinement - Started with basic monitoring, evolved to intelligent recommendations
  3. Documentation is Key - Well-documented prompts β†’ better AI-generated code

What's next for FIRE (The Financial Independence, Retire Early) Sentinel

Short-Term (Next 3 Months)

  1. Machine Learning Predictions - Train LSTM models on historical data to predict price movements with 70%+ accuracy
  2. Mobile App - React Native app with push notifications for instant alerts on your phone
  3. Backtesting Engine - Test your strategies on 5+ years of historical data before risking real money
  4. Social Sentiment Integration - Add Twitter/Reddit sentiment analysis using NLP to catch viral trends early

Medium-Term (6-12 Months)

  1. Portfolio Optimization - AI-powered rebalancing suggestions based on Modern Portfolio Theory (MPT)
  2. Crypto Integration - Monitor Bitcoin, Ethereum, and top 50 cryptocurrencies with 24/7 volatility alerts
  3. Multi-Currency Support - Track international stocks (LSE, TSE, NSE) with automatic currency conversion
  4. Advanced Charting - Interactive TradingView-style charts with technical indicators (RSI, MACD, Bollinger Bands)

Long-Term (1-2 Years)

  1. Community Features - Share strategies, compare portfolios, and learn from top FIRE investors
  2. Robo-Advisor Integration - Auto-execute trades based on AI recommendations (with user approval)
  3. Tax Optimization - Suggest tax-loss harvesting and optimal withdrawal strategies for FIRE
  4. Voice Assistant - "Alexa, how's my portfolio?" - Get instant updates via voice

Scalability & Infrastructure

  • Database Integration - PostgreSQL for historical data, TimescaleDB for time-series analysis
  • Caching Layer - Redis for sub-second response times on repeated queries
  • Microservices Architecture - Split into independent services (price, news, alerts, ML)
  • Kubernetes Deployment - Auto-scaling to support 10,000+ concurrent users
  • GraphQL API - Enable third-party integrations and custom dashboards
  • Real-Time WebSockets - Live price updates without polling

Business Model (Future)

  • Free Tier - Monitor up to 10 stocks, daily analysis
  • Pro Tier ($9.99/mo) - Unlimited stocks, hourly analysis, advanced alerts
  • Enterprise Tier ($99/mo) - API access, custom integrations, priority support

Built With

  • additional
  • alert-system
  • alpha-vantage
  • api
  • artificial-intelligence
  • asyncio
  • automation
  • categories:
  • data-analysis
  • financial-independence
  • fintech
  • fire-movement
  • git
  • github
  • google-news
  • keywords:
  • machine-learning
  • natural-language-processing
  • portfolio-management
  • pydantic
  • pytest
  • python
  • real-time-monitoring
  • rss
  • sentiment-analysis
  • slack
  • smtp
  • stock-market
  • vader-sentiment
  • yahoo-finance
Share this project:

Updates