An automated, AI-driven morning broadcast system that scrapes the latest news, clusters related stories, and generates a witty audio script hosted by 'Igor' (News) and 'Olivia' (Weather).
- Robust Scraping: Uses
curl-cffifor TLS impersonation to bypass 403 Forbidden blocks on major news sites. - Intelligent Clustering: Groups similar articles from different sources using TF-IDF and Agglomerate Clustering to avoid repetitive reporting.
- Categorical News: Automatically categorizes stories into topics like AI, Tech, Politics, and World News.
- Double LLM Pass:
- Synthesizer: Consolidates multiple sources into a single objective summary.
- Scriptwriter: Converts summaries into a punchy, humorous broadcast script.
- Dynamic Weather: Fetches local forecasts via Open-Meteo and generates a conversational weather report.
- High-Quality TTS: Uses Inworld AI's character voices for distinct, expressive host personalities.
- Web Dashboard: Modern UI to read the summaries while listening to the broadcast.
- Python 3.9+
ffmpeginstalled on your system (for audio mixing)
- Clone the repository.
- Install dependencies:
pip install -r requirements.txt
- Create a
.envfile with your API keys:OPENROUTER_API_KEY=your_key_here INWORLD_API_KEY=your_key_here
- Configure your sources and location in
config.yaml.
Generate today's broadcast by running:
python main.pyThis will:
- Scrape latest articles.
- Synthesize summaries.
- Generate TTS audio in
output/morning_mutation.mp3. - Export metadata to
output/broadcast_data.json.
Open the dashboard to view summaries and listen to the audio:
# Start a simple server
python -m http.server 8000
# Visit http://localhost:8000/frontend in your browserThe simplest way to run Morning Mutation is via Docker.
- Setup Environment: Ensure
.envis populated. - Start the Web Dashboard:
The dashboard will be available at
docker compose up -d morning-mutation-web
http://localhost:37542/frontend. - Run the Pipeline:
This will scrape news, generate audio, and export data to the
docker compose up --build morning-mutation
output/volume shared with the web server.
To have your broadcast ready every morning, add a cron job to your host system:
- Open crontab:
crontab -e - Add a line to run the pipeline at 7:00 AM daily (adjust path to your project):
0 7 * * * cd /path/to/morning-mutation && /usr/local/bin/docker-compose up morning-mutation >> /var/log/morning-mutation.log 2>&1
main.py: The orchestrator script.src/scraper.py: Handles RSS fetching and article scraping with TLS bypass and keyword filtering.src/cluster.py: Categorizes and clusters articles.src/summarizer.py: LLM logic for synthesis and script generation.src/weather.py: Fetching and drafting the conversational weather report.src/tts.py: Audio generation via Inworld AI.src/audio_mixer.py: Splicing news, weather, and commercials.frontend/: The glassmorphism vanilla CSS/JS web interface.
MIT