Skip to content

jkpe/agent-news-summary

Repository files navigation

agent-news-summary

A scheduled AI-powered news digest bot that runs on Cloudflare Workers. Every morning it aggregates articles from configured sources, deduplicates them, summarises them with an LLM, and delivers a digest to Discord and/or WhatsApp.

How it works

  1. A daily cron (default: 08:00 UTC) wakes the agent
  2. New, unseen articles are collected from all configured sources
  3. A Cloudflare Workers AI model produces a structured JSON digest
  4. The digest is delivered to Discord and/or WhatsApp
  5. Delivered articles are marked as seen (30-day retention) to avoid repeats
agent-news-summary

Tech stack

Setup

Prerequisites: Node.js, a Cloudflare account with Workers AI, Browser Rendering, and Durable Objects enabled.

npm install

Configure secrets (at least one delivery channel required):

# Discord
wrangler secret put DISCORD_WEBHOOK_URL

# WhatsApp (all three required together)
wrangler secret put WHATSAPP_ACCESS_TOKEN
wrangler secret put WHATSAPP_PHONE_NUMBER_ID
wrangler secret put WHATSAPP_TO

Deploy:

npm run deploy

Development

npm run dev

Trigger a digest immediately without waiting for the cron:

curl -X POST http://localhost:8787/agents/source-digest-agent/default/trigger
npm test

Configuration

Edit wrangler.jsonc to change non-secret settings:

Variable Default Description
MODEL @cf/moonshotai/kimi-k2.5 Workers AI model for summarisation
SCRAPE_CRON 0 8 * * * Cron schedule (UTC)
SKIP_SEEN "false" Set to "true" to disable deduplication

Adding sources

Edit src/sources.ts. Three source types are supported:

  • "hn-api" — Hacker News Firebase API
  • "rss" — RSS 2.0 / Atom feed URL
  • "browser" — Puppeteer-rendered page with heuristic article extraction

What does it look like?

discord

About

A scheduled AI-powered news digest bot that runs on Cloudflare Workers. Every morning it aggregates articles from configured sources, deduplicates them, summarises them with an LLM, and delivers a digest to Discord and/or WhatsApp.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors