Skip to content

About

Personal RSS-to-email service with AI filtering

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

rss-digest

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.

Setup (local)

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 run

Gmail app password

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

Configuration

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

How it works

  1. Fetch all feeds concurrently (httpx + feedparser).
  2. For each feed, compute a stable item id (guid if present, else hash of link+title), and pick the items not seen before.
  3. 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.
  4. 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}.
  5. One small Claude call merges raw topic strings into 3–7 consolidated buckets ("ml", "ML research", "AI/ML" → one bucket).
  6. Render an HTML digest grouped by bucket, sections ordered by item count.
  7. Send via Gmail SMTP (STARTTLS).
  8. Mark items sent_at only 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).

Deploy (cloud VM, systemd)

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 -e

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

Files

  • state.db — SQLite. Records feeds, item IDs, decisions, sent timestamps, run history.
  • .env — secrets. Gitignored.
  • config.yaml — feeds + interests. Safe to commit (no secrets).

Operational notes

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

Verification checklist

  1. uv run rss-digest init-db — verify schema with sqlite3 state.db ".schema"
  2. Add 1–2 known feeds to config.yaml
  3. uv run rss-digest run --dry-run -v — read the rendered HTML and inspect kept/dropped decisions
  4. uv run rss-digest run — confirm one email arrives at DIGEST_TO
  5. Re-run immediately — digest should be empty (or skipped); items are marked sent_at

About

Personal RSS-to-email service with AI filtering

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages