AI Newsletter Platform
A production-ready, AI-powered newsletter system that automatically curates, summarizes, and delivers topic-based newsletters to subscribers.
Key Features
Automated news collection from RSS feeds and News API
AI-powered curation and summarization via OpenAI GPT
Hybrid ranking system combining heuristics and content quality metrics
Professional HTML email delivery via SendGrid
Scheduled daily and weekly newsletter generation with APScheduler
One-click unsubscribe links per topic
RESTful API for full subscription management
CLI tools for testing, seeding, and manual newsletter triggers
Docker support for production deployment
Configurable LLM model, temperature, and max tokens
Architecture
┌─────────────────────────────────────────────────────────────┐ │ Newsletter Platform │ ├─────────────────────────────────────────────────────────────┤ │ ┌──────────────┐ ┌─────────────────┐ │ │ │ FastAPI │◄────►│ PostgreSQL │ │ │ │ Backend │ │ Database │ │ │ └──────┬───────┘ └─────────────────┘ │ │ │ │ │ ├──► News Ingestion ──► RSS Feeds + News API │ │ ├──► Ranking Service ──► Heuristics + LLM │ │ ├──► LLM Service ──────► OpenAI API │ │ ├──► Email Service ────► SendGrid │ │ └──► APScheduler ──────► Daily/Weekly Jobs │ └─────────────────────────────────────────────────────────────┘
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/topics | List available topics |
| POST | /api/subscribe | Subscribe to topics |
| GET | /api/subscriptions/:email | View subscriptions |
| GET | /api/unsubscribe | Unsubscribe via token |
How It Works
News Ingestion
RSS feeds and News API are polled for fresh articles across configured topics (Sports, World News, US Stocks).
AI Ranking & Curation
A hybrid ranking system scores articles using heuristics (recency, source authority) and LLM-based content quality assessment.
LLM Summarization
Top-ranked articles are summarized by OpenAI GPT with custom prompts that generate subject lines, introductions, and 'why it matters' sections.
Email Delivery
Professional HTML newsletters are composed and delivered via SendGrid to all subscribers of that topic, respecting their daily/weekly frequency preference.