This repo contains a small "news agent" that fetches public RSS feeds daily, ranks items for AI/ML progress and startup/VC investing news, generates a <= 10 minute on-site digest, and renders it in a clean, organized UI.
- Fetches configured RSS/Atom feeds (polite timeouts + lightweight parsing)
- Classifies items into
aivsvcusing keyword signals - De-duplicates and ranks by relevance + recency + source weight
- Produces one daily digest per category in
data/digests/<categorySlug>/(and.../latest.json) - Renders category digests in the Next.js app (
/and/category/<slug>)
npm install
npm run digest # generate today's digests (one per category)
npm run smoke # validate latest digest JSON parses correctly
npm run dev # view UIIf DATABASE_URL is set, digests are written to Postgres instead of data/digests/.
# 1) set DATABASE_URL in .env.local
npm run db:push
npm run db:seed
npm run digestEdit lib/agent/sources.ts to add/remove feeds. Prefer RSS/Atom endpoints from public sites rather than scraping article HTML; it's more stable and less likely to violate site policies.
Option A (simplest): run the script via cron on your server:
0 7 * * * cd /path/to/repo && npm run digestOption B: call the built-in API route from your scheduler:
POST /api/cron/digestwithAuthorization: Bearer $CRON_SECRET- Set
CRON_SECRETin your environment- Copy
.env.exampleto.env.localfor local dev - Vercel Cron Jobs call your endpoints with
GET(supported by these routes)
- Copy
Send emails (requires Postgres + Resend):
POST /api/cron/send-digestswithAuthorization: Bearer $CRON_SECRET- Set
RESEND_API_KEY,EMAIL_FROM, andSITE_URL
This repo includes vercel.json with a daily cron pointing at GET /api/cron, which runs:
- digest generation (all categories)
- email send (only if Resend env vars are configured)
Note: cron schedules are interpreted in UTC.
Note: writing to the filesystem works great on a traditional server. On serverless platforms with ephemeral disks, store digests in a DB/object store instead of data/.
If OPENAI_API_KEY is set, the agent will ask a model to refine the final top items and produce tighter bullet summaries (still capped to the 10-minute daily read budget).