Architecture
How ALMA works
Four stages, seven APIs, zero manual steps on weekday mornings.
The pipeline
Data — Events & Weather
Once a month, a GitHub Action scrapes Milan's cultural calendar and stores events
in Supabase Postgres. Each morning it fetches the day's weather snapshot.
Everything lives in a single speeches table.
Speech — ALMA writes her script
generate_speech.py feeds the day's events and weather to Claude Sonnet.
The model writes a 60-second briefing in ALMA's voice — warm, local, specific.
The text is saved back to Supabase.
Video — Avatar + voice + subtitles
generate_video.py chains four AI services: ElevenLabs (TTS, voice Bianca)
→ Kling (talking-head avatar, SUMMER image) → Whisper (word-level timing)
→ ffmpeg (branded intro/outro + burned subtitles). Final MP4 is uploaded to Supabase Storage.
Email — Delivered to the team
send_email.py uses Resend to deliver a branded HTML email from
alma@alma-milano.com. One CTA button links to the video. Done by 9 AM.
GitHub Actions workflows
-
monthly_dataset.ymlRuns on the 25th of each month — scrapes Milan events, populates the DB for the next month.
-
daily_concierge.ymlMon–Fri 09:00 CEST — fetches weather, calls Claude, writes today's speech to Supabase.
-
generate_video.ymlManual trigger — runs the full TTS → Avatar → Whisper → ffmpeg pipeline (~20 min, ~$10).
-
send_email.ymlManual trigger — sends today's video email to all recipients via Resend (~10 seconds).