A personalised AI newsletter is a satisfying end-to-end project: it touches data collection, LLM summarisation, templating, and delivery, and the output is something real people read every morning. This tutorial breaks the pipeline into four stages and includes an estimator so you can size the LLM cost and send volume before you build.
Stage 1 — Crawl and collect
Every newsletter starts with a content pool. For each topic you cover, pull candidate items from RSS feeds and APIs — Hacker News, Reddit, arXiv, GitHub trending, or niche feeds in your domain. Store the title, canonical URL, published date, and a body snippet in a database, and deduplicate by URL so the same story crawled from two feeds appears once. Run this on a schedule (every few hours) so by send time you have a fresh pool.
Stage 2 — Summarise once, personalise per reader
The cost-control insight here is to summarise each item exactly once and cache the result. Send the model the article snippet with a prompt like “Write a two-sentence, neutral summary capturing the key claim and why it matters.” That summary is reused across every subscriber.
Personalisation is the cheap per-reader layer: score each item against the subscriber’s stated interests (and, later, their open history), rank, and keep the top N. Then a short per-reader call writes a one-line intro tying the digest to what that person cares about. Summaries are shared; ranking and intro are personal.
Stage 3 — Render to HTML
Turn the ranked, summarised digest into a responsive HTML email. Keep the markup simple and table-based for client compatibility, include a plain-text fallback, and always add a working unsubscribe link — it is both a legal requirement and a deliverability signal. Group items under topic headings so a reader can scan in seconds.
Stage 4 — Send and schedule
Deliver through a transactional email API such as Resend, SendGrid, or SES. Authenticate your sending domain with SPF, DKIM, and DMARC, send from a monitored reply-to address, and trigger the whole pipeline on a cron schedule — crawl through the night, generate and send at a fixed morning hour in each reader’s time zone.
Use the estimator below to project the per-send LLM cost as your list grows, then read how to build a chatbot with the OpenAI API for the summarisation call pattern and the LLM API Cost Calculator for finer cost modelling.