An autonomous Python agent that scans the web daily for the latest LLM, AI tools, and agentic AI content, then sends a beautifully formatted email digest to your Gmail.
- 📰 Multi-Source Aggregation: ArXiv papers, NewsAPI, RSS feeds, Hacker News, Reddit, YouTube, Product Hunt, Hugging Face
- 🤖 AI-Powered Summaries: Uses LLM for intelligent content summarization
- 🔄 Smart Deduplication: Removes duplicate articles across sources
- 📧 Beautiful Email Digests: Mobile-responsive HTML emails
- ⏰ Daily Scheduling: Configurable send time (Default: 2-day lookback)
- 📡 Robust Source Support: Automated fetching from AI based YouTube channels
cd ai-news-agent
pip install -r requirements.txtcp .env.example .env
# Edit .env with your API keys- Enable 2-Factor Auth on your Google account (https://myaccount.google.com/security)
- Get an App Password:
- Go to: https://myaccount.google.com/apppasswords
- Select "Mail" and generate
- Copy the 16-character password
- Update
.env:RECIPIENT_EMAIL=your.email@gmail.com SMTP_EMAIL=your.email@gmail.com SMTP_PASSWORD=your-app-password
python agent.pyOption A: Using the built-in scheduler
python scheduler.pyOption B: Using system cron (Linux/Mac)
# Edit crontab
crontab -e
# Add this line for 8:00 AM daily
0 8 * * * cd /path/to/ai-news-agent && python agent.pyEdit .env file:
# Required
RECIPIENT_EMAIL=your.email@gmail.com
# Optional - for LLM summaries
OPENAI_API_KEY=sk-...
# OR
GEMINI_API_KEY=...
# Optional - for more news sources
NEWS_API_KEY=...
# Schedule (24-hour format)
SEND_TIME=08:00# Run once (sends email immediately)
python agent.py
# Dry run (preview without sending)
python agent.py --dry-run
# Run with scheduler (ongoing)
python scheduler.pyai-news-agent/
├── config/
│ ├── settings.py # Configuration management
│ └── credentials/ # OAuth tokens (gitignored)
├── sources/
│ ├── arxiv_source.py # ArXiv research papers
│ ├── newsapi_source.py # NewsAPI.org integration
│ ├── rss_source.py # RSS feed parser
│ └── hackernews_source.py # Hacker News API
├── processing/
│ ├── deduplicator.py # Remove duplicate articles
│ └── summarizer.py # AI-powered summarization
├── email_client/
│ ├── gmail_client.py # Gmail API OAuth2 client
│ └── templates/
│ └── digest.html # HTML email template
├── agent.py # Main orchestrator
├── scheduler.py # Daily scheduling
└── requirements.txt
The easiest way to run daily digests automatically is GitHub Actions - completely free!
cd /Applications/AntigravityProjects/ai-news-agent
git init
git add .
git commit -m "Initial commit"
gh repo create ai-news-agent --private --pushGo to your GitHub repo → Settings → Secrets and variables → Actions → New repository secret
Add these secrets:
| Secret Name | Value |
|---|---|
RECIPIENT_EMAIL |
your.email@gmail.com, friend@example.com |
SMTP_EMAIL |
your.email@gmail.com |
SMTP_PASSWORD |
your-app-password |
NEWS_API_KEY |
your-newsapi-key |
Note: To send to multiple people, just separate emails with commas in RECIPIENT_EMAIL.
The workflow runs daily at 8:00 AM IST. You can also trigger it manually from the Actions tab.
Error: refusing to allow a Personal Access Token to create or update workflow
This means your GitHub token is missing permissions.
- Go to Settings → Developer Settings → Personal access tokens (Tokens (classic))
- Generate new token
- Crucial: Check the
workflowcheckbox (andrepo) - Use this new token as your password when pushing
MIT