AI Daily Digest

Selected Build ยท Automation & AI

AI Daily Digest

A personal daily digest that aggregates news, weather, sports, entertainment, and health data into a single mobile-friendly HTML email. A Python orchestrator pulls from seven independent sources, an LLM summarises and validates the content, and it lands in my inbox every morning โ€” running locally or as a scheduled AWS Lambda.

Python AWS Lambda EventBridge OpenAI S3 cache Gmail SMTP
7
Independent data sources
Daily
Scheduled by EventBridge
1
Mobile-friendly email out
90d
Health history healed & cached

๐Ÿ“‹ What it does

Every morning the app assembles a personal briefing and emails it as a single, clean HTML message. Each section comes from a dedicated module so sources can be added or swapped without touching the others:

Same code, two homes: the exact same orchestrator runs locally with python main.py or as an AWS Lambda triggered by EventBridge on a daily schedule โ€” with a lambda_handler() entry point and S3 holding state between runs.

๐Ÿ—๏ธ Architecture

main.py is the orchestrator: it calls each source module, normalises and validates the results, renders the email, and sends it. Modules are independent and fail soft, so one flaky API doesn't sink the whole digest.

flowchart TD
    EB[EventBridge
daily schedule] --> M M[main.py
orchestrator] M --> N[news.py
Serper API] M --> W[weather.py
NWS + Open-Meteo] M --> S[sports.py
CricAPI + RSS] M --> R[rugby.py
AI agent + web search] M --> MV[movies.py
Tavily API] M --> O[oura_pull.py
Oura API] O --> SC[smart_cache.py
S3-backed cache] N --> AI{{OpenAI
summarise + validate}} W --> AI S --> AI R --> AI MV --> AI O --> AI AI --> H[render HTML email] H --> G[Gmail SMTP send] classDef llm fill:#fef3c7,stroke:#d97706,color:#000 class AI llm

Seven independent source modules fan in to the orchestrator; OpenAI cleans and validates before send.

๐Ÿ”Œ Data sources

Each module owns one source and one API, returning ready-to-render content to the orchestrator.

ModuleSource / APIProvides
news.pySerper (Google search)South Africa & Amazon news
weather.pyNWS + Open-MeteoUS & international forecasts
sports.pyCricAPI + RSSSA cricket scores + sports feeds
rugby.pyAI agent + web searchSpringboks rugby news
movies.pyTavily searchTop movies & TV shows
oura_pull.pyOura APISleep, readiness & activity
smart_cache.pyS3 / local JSONCaches Oura analysis to cut API cost

โ˜๏ธ Stack & components

๐Ÿ Python orchestrator

main.py coordinates fetching, sanitising, formatting, validation, and sending โ€” with token accounting on every OpenAI call.

โšก AWS Lambda

A lambda_handler() entry point runs the same code in the cloud; Docker-built deploy packages ship it.

โฐ EventBridge

A scheduled rule fires the Lambda once a day so the digest arrives without any manual trigger.

๐Ÿค– OpenAI

Summarises noisy source content into clean bullets and optionally validates the final email's formatting.

๐Ÿชฃ Amazon S3

Holds state between Lambda runs โ€” cached Oura metrics, analysis, and API usage counters.

๐Ÿ’ Oura + smart cache

Pulls 90 days of health data, "heals" gaps caused by Oura API quirks, and caches AI analysis to reduce cost.

โœ‰๏ธ Gmail SMTP

Assembles a MIME multipart message and delivers the mobile-friendly HTML email to the inbox.

๐Ÿ“ Structured output

JSON schemas constrain the LLM's news output so rendering stays predictable and safe to template.

๐Ÿ”„ End-to-end run

Schedule fires

EventBridge triggers the Lambda (or a local cron / manual run) once a day to start the digest build.

Fan out to sources

The orchestrator calls each source module โ€” news, weather, sports, rugby, movies, Oura โ€” independently, so a single failing API degrades gracefully instead of breaking the run.

Summarise & sanitise

OpenAI condenses noisy content into clean bullets against JSON schemas; URL and text sanitisers strip tracking params and de-dupe, all under per-run token accounting.

Heal & cache health data

Oura history is back-filled around the API's single-day quirk and cached in S3 so repeat analysis doesn't re-spend tokens.

Render the email

All sections are assembled into a mobile-friendly HTML template and packed into a MIME multipart message โ€” with an optional AI pass that validates the formatting.

Send

The digest goes out via Gmail SMTP and lands in the inbox โ€” one concise briefing instead of a morning of scattered reading.

๐Ÿ’ก What it demonstrates