Personal RSS feeds → AI-filtered weekly email digest.
The service fetches a list of RSS feeds, asks Claude to filter out items that don't match your stated interests, groups what's left by AI-inferred topic, and emails you one HTML digest. Designed to be run once a week from a cron/systemd timer on an always-on host.
Requires uv and Python 3.12+.
git clone <repo>
cd rss-digest
uv sync
cp .env.example .env
# edit .env — set ANTHROPIC_API_KEY, GMAIL_USER, GMAIL_APP_PASSWORD
# edit config.yaml — adjust interests and feeds list
uv run rss-digest init-db
uv run rss-digest run --dry-run--dry-run prints the rendered HTML to stdout and does not send email, but does write to SQLite (so it bootstraps your feeds — that's intentional, otherwise the first real run would flood you).
To send the digest for real:
uv run rss-digest runGmail SMTP requires a 16-character app password (regular Gmail passwords don't work). 2FA must be enabled on the account, then generate one at https://myaccount.google.com/apppasswords.
config.yaml — feeds and interests. interests is free-form prose; the more specific you make it (including what to drop), the better the filter.
interests: |
Keep posts on: distributed systems, Postgres internals, LLM tooling.
Drop: crypto/NFT hype, generic startup advice, low-effort AI listicles.
caps:
max_items_per_feed_to_llm: 30 # cost guard
first_run_keep_recent: 5 # bootstrap: only first N from a new feed
rss_content_truncate_chars: 1500
send_empty_digest: false
llm:
filter_model: claude-haiku-4-5-20251001
topic_model: claude-haiku-4-5-20251001
max_concurrent_feeds: 4
feeds:
- name: Example
url: https://example.com/rss- Fetch all feeds concurrently (
httpx+feedparser). - For each feed, compute a stable item id (
guidif present, else hash of link+title), and pick the items not seen before. - New-feed bootstrap: for a feed observed for the first time, mark all but the most recent N items as already-seen — no email flood from a 500-item historical archive.
- One Claude call per feed: system prompt = your interests (prompt-cached across feeds); user message = JSON list of new items. Response: per-item
{keep, summary, topic, reason}. - One small Claude call merges raw topic strings into 3–7 consolidated buckets ("ml", "ML research", "AI/ML" → one bucket).
- Render an HTML digest grouped by bucket, sections ordered by item count.
- Send via Gmail SMTP (STARTTLS).
- Mark items
sent_atonly after SMTP success — if the email fails or the process dies mid-pipeline, the next run retries the same items without re-spending LLM tokens (the kept/summary/topic are already stored).
sudo mkdir -p /opt/rss-digest
sudo rsync -a --exclude .venv --exclude '*.db' ./ /opt/rss-digest/
cd /opt/rss-digest
sudo uv sync
sudo cp deploy/rss-digest.service /etc/systemd/system/
sudo cp deploy/rss-digest.timer /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now rss-digest.timer
# verify
systemctl list-timers rss-digest.timer
sudo systemctl start rss-digest.service # one-shot manual fire
journalctl -u rss-digest.service -eThe timer fires Mon 08:00 server-local time by default — edit deploy/rss-digest.timer to change. Persistent=true means a missed run (e.g. VM was off) fires on next boot.
state.db— SQLite. Records feeds, item IDs, decisions, sent timestamps, run history..env— secrets. Gitignored.config.yaml— feeds + interests. Safe to commit (no secrets).
- Cost. Per run: one batch LLM call per feed (Haiku, with prompt caching of the interests block) + one small topic-merge call. For ~20 feeds this is cents per week.
- A feed went 404. Run completes; that feed's error is logged and shown in the digest under "Run had N error(s)". It retries next week.
- LLM error for one feed. That feed's items are sent unfiltered for the week so nothing is silently dropped; the digest flags them as
topic: unfiltered. - Empty week. With
send_empty_digest: false, no email is sent.
uv run rss-digest init-db— verify schema withsqlite3 state.db ".schema"- Add 1–2 known feeds to
config.yaml uv run rss-digest run --dry-run -v— read the rendered HTML and inspect kept/dropped decisionsuv run rss-digest run— confirm one email arrives atDIGEST_TO- Re-run immediately — digest should be empty (or skipped); items are marked
sent_at