🤖 Your AI-Powered News Assistant — Stay informed with automated, personalized AI news digests delivered daily
| ✨ Features | 🚀 Quick Start | ⚙️ Configuration | 🤖 LLM Providers |
|---|---|---|---|
| 🌍 Languages | 📧 Email Setup | 🔗 Webhooks | 🔧 Troubleshooting |
- Multi-Provider LLM Support: Choose between Claude, DeepSeek, Gemini, Grok, or OpenAI for news generation
- Real-Time News Fetching: Fetches actual news from RSS feeds for accurate, up-to-date content
- AI-Powered News Generation: Generate comprehensive AI news digests using your preferred LLM provider
- Web Search Integration: Optional DuckDuckGo web search for additional news sources
- Beautiful Email Formatting: Automatically converts AI content to stunning HTML emails - no markdown, just clean professional design
- Customizable Prompts: 9 pre-built templates (comprehensive, research, business, technical, etc.) or create your own
- Multilingual Support: Generate news in 13+ languages including English, Chinese, Spanish, French, Japanese, and more
- Chinese News Sources: Built-in support for Chinese AI news sources (36Kr, JiQiZhiXin, etc.)
- Multiple Notification Channels: Supports email (Gmail SMTP), webhook, Slack, Telegram, and Discord notifications
- Flexible Configuration: Easy-to-customize topics and notification settings via YAML config
- Automated Scheduling: GitHub Actions workflow for daily automated execution
- Robust Error Handling: Comprehensive logging and retry logic
- Email Client Compatible: Works perfectly in Gmail, Outlook, Apple Mail, and mobile email apps
- Simple Email Setup: Just use your Gmail account with App Password - no third-party email service needed
Choose your deployment method:
| Method | Configuration | When to Use |
|---|---|---|
| GitHub Actions | Repository Secrets | Automated daily runs (recommended) |
| Local Development | .env file |
Testing locally or manual runs on your computer |
💡 Recommended: Use GitHub Actions for automated daily news delivery. Use local development for testing or customization.
GitHub Actions provides automated daily news delivery without any server setup. Configure once and receive news digests automatically.
Fork this repository to your GitHub account, or clone it:
git clone <your-repo-url>
cd ai-news-botNavigate to your GitHub repository:
Repository → Settings → Secrets and variables → Actions → Repository secrets → New repository secret
Add the following secrets:
| Secret Name | Example Value | Description |
|---|---|---|
LLM_PROVIDER |
claude, deepseek, gemini, grok, or openai |
LLM provider to use (default: claude) |
ANTHROPIC_API_KEY |
sk-ant-api03-xxx... |
Your Anthropic API key (if using Claude) |
DEEPSEEK_API_KEY |
sk-xxx... |
Your DeepSeek API key (if using DeepSeek) |
GOOGLE_API_KEY |
AIza... |
Your Google API key (if using Gemini) |
XAI_API_KEY |
xai-... |
Your xAI API key (if using Grok) |
OPENAI_API_KEY |
sk-... |
Your OpenAI API key (if using OpenAI) |
NOTIFICATION_METHODS |
email |
Notification channels (comma-separated) |
| Secret Name | Example Value | Description |
|---|---|---|
GMAIL_ADDRESS |
you@gmail.com |
Your Gmail address |
GMAIL_APP_PASSWORD |
xxxx xxxx xxxx xxxx |
Gmail App Password (Get one here) |
EMAIL_TO |
recipient@example.com |
Recipient email address |
See Email Setup Guide for detailed Gmail configuration instructions.
| Secret Name | Example Value | Description |
|---|---|---|
AI_RESPONSE_LANGUAGE |
zh or es or en,zh,ja |
Language code(s) (defaults to en). Use commas for multiple languages |
ENABLE_WEB_SEARCH |
true or false |
Enable web search for news (defaults to false) |
For other notification channels (Webhook, Slack, Telegram, Discord), see the full configuration table.
Ensure GitHub Actions are enabled:
Repository → Settings → Actions → General → Allow all actions and reusable workflows
Manually trigger the workflow to verify everything works:
Repository → Actions tab → Daily AI News Digest → Run workflow button
The workflow runs automatically every day at midnight UTC (8:00 AM Beijing time). To customize the schedule, edit .github/workflows/daily-news.yml:
schedule:
- cron: "0 0 * * *" # Midnight UTC (current)
- cron: "0 9 * * *" # 9:00 AM UTC
- cron: "0 */12 * * *" # Every 12 hours🎉 Done! You'll now receive automated AI news digests daily.
For testing or running manually on your computer:
git clone <your-repo-url>
cd ai-news-botpip install -r requirements.txtCopy the example file and fill in your credentials:
cp .env.example .envEdit .env with your actual values:
# LLM Provider Configuration
LLM_PROVIDER=claude # Options: 'claude' or 'deepseek'
# API Keys (provide the one you're using)
ANTHROPIC_API_KEY=your_api_key_here # For Claude
DEEPSEEK_API_KEY=your_deepseek_api_key # For DeepSeek
# Gmail Configuration (easy setup!)
GMAIL_ADDRESS=your_email@gmail.com
GMAIL_APP_PASSWORD=xxxx xxxx xxxx xxxx # 16-char App Password (NOT your Gmail password)
EMAIL_TO=recipient@example.com
# Optional: Webhook Configuration
WEBHOOK_URL=https://your-webhook-url.com/endpoint
# Notification Methods (comma-separated)
# Available: email, webhook, slack, telegram, discord
NOTIFICATION_METHODS=email,webhook
# Language Settings (optional, defaults to 'en')
# Single language:
AI_RESPONSE_LANGUAGE=zh
# Multiple languages (comma-separated):
# AI_RESPONSE_LANGUAGE=en,zh,ja
# Web Search (optional, defaults to false)
ENABLE_WEB_SEARCH=falseNote: The
.envfile is only for local development. For GitHub Actions automation, you'll configure these as GitHub Secrets (see GitHub Actions Setup below).
The bot uses an optimized, concise prompt (15 lines vs 50+ in typical systems) that generates high-quality news digests.
Default Prompt (in config.yaml):
Summarize 10 recent AI news items (5 international + 5 domestic) covering: {topics}
Format:
International News:
1. [Headline]
[2-3 sentence summary]
Source: [Name]
Domestic News:
1. [Headline]
...
Rules: Recent news, no markdown, clear languageWhy it's concise:
- ✅ Faster processing
- ✅ Lower cost
- ✅ Easier to maintain
- ✅ No redundancy
Multi-Language Support:
Prompts are in English (best for Claude), but output can be in 13+ languages:
# In .env file - Single language
AI_RESPONSE_LANGUAGE=zh # Chinese output only
AI_RESPONSE_LANGUAGE=es # Spanish output only
AI_RESPONSE_LANGUAGE=ja # Japanese output only
# Multiple languages (comma-separated)
AI_RESPONSE_LANGUAGE=en,zh,ja # English, Chinese, and Japanese
AI_RESPONSE_LANGUAGE=en,es,fr # English, Spanish, and French
# Supports: en, zh, es, fr, ja, de, ko, pt, ru, ar, hi, it, nlPre-built Templates (config.examples.yaml):
- Comprehensive (default) - Balanced coverage
- Research - Academic focus
- Business - Industry & funding
- Technical - Engineering depth
- Startup - Early-stage companies
- Policy - Regulations
- Weekly - Top stories
- Concise - Ultra-brief
- Chinese - 中文示例
📖 Full Guide: See config.examples.yaml for customization and multi-language details.
python main.pyThe bot requires the following configuration. How you set them depends on your deployment:
- Local Development: Use
.envfile (see Quick Start) - GitHub Actions: Use GitHub Repository Secrets (see GitHub Actions Setup)
| Variable | Required | Description |
|---|---|---|
LLM_PROVIDER |
Optional | LLM provider: claude, deepseek, gemini, grok, or openai (default: claude) |
ANTHROPIC_API_KEY |
If using Claude | Your Anthropic API key (Get it here) |
DEEPSEEK_API_KEY |
If using DeepSeek | Your DeepSeek API key (Get it here) |
GOOGLE_API_KEY |
If using Gemini | Your Google API key (Get it here) |
XAI_API_KEY |
If using Grok | Your xAI API key (Get it here) |
OPENAI_API_KEY |
If using OpenAI | Your OpenAI API key (Get it here) |
NOTIFICATION_METHODS |
✅ Required | Comma-separated list: email, webhook, slack, telegram, discord, or any combination (e.g., email,slack,telegram) |
AI_RESPONSE_LANGUAGE |
Optional | Language code(s) for AI responses (default: en). Use commas for multiple (e.g., en,zh,ja). Supports: zh, es, fr, ja, de, ko, pt, ru, ar, hi, it, nl |
ENABLE_WEB_SEARCH |
Optional | Enable web search for news (default: false) |
GMAIL_ADDRESS |
If using Gmail | Your Gmail address |
GMAIL_APP_PASSWORD |
If using Gmail | Gmail App Password (16 characters, NOT regular password) |
EMAIL_TO |
If using email | Recipient email address |
WEBHOOK_URL |
If using webhook | Webhook endpoint URL |
SLACK_WEBHOOK_URL |
If using Slack | Slack Incoming Webhook URL |
SLACK_CHANNEL |
Optional | Override default Slack channel (e.g., #general) |
SLACK_USERNAME |
Optional | Override bot username for Slack (default: AI News Bot) |
TELEGRAM_BOT_TOKEN |
If using Telegram | Telegram Bot API token from @BotFather |
TELEGRAM_CHAT_ID |
If using Telegram | Telegram chat ID (user, group, or channel ID) |
DISCORD_WEBHOOK_URL |
If using Discord | Discord Webhook URL |
DISCORD_USERNAME |
Optional | Override bot username for Discord (default: AI News Bot) |
DISCORD_AVATAR_URL |
Optional | Custom avatar URL for Discord bot |
The config.yaml file allows you to customize the news digest behavior:
LLM Configuration:
- Provider: Choose between
claude,deepseek,gemini,grok, oropenai - Model: Optionally specify a specific model version
News Configuration:
- use_real_sources: Enable fetching news from RSS feeds (recommended, default: true)
- enable_web_search: Enable DuckDuckGo web search (default: false)
- max_items_per_source: Maximum news items per source (default: 10)
- Topics: Focus areas for news selection (optional, guides the AI)
- Prompt Template: The instruction template for the LLM
- Default: Comprehensive 15-20 item digest with category headers
- Fully customizable with your own prompts
- See
config.examples.yamlfor 9 pre-built templates
Logging Settings: Control log verbosity and format
Example Structure:
llm:
provider: claude # options: 'claude', 'deepseek', 'gemini', 'grok', 'openai'
# model: claude-sonnet-4-5-20250929 # optional
news:
use_real_sources: true
enable_web_search: false
max_items_per_source: 10
topics:
- "Large Language Models (LLM)"
- "AI Agents and Autonomous Systems"
- "Product launches"
prompt_template: |
Your custom prompt...
Focus: {topics}
logging:
level: INFO
format: "%(asctime)s - %(levelname)s - %(message)s"The bot supports 5 LLM providers. Configure in config.yaml or via environment variables:
llm:
provider: claude
model: claude-sonnet-4-5-20250929 # optional, uses default if not setAvailable Models:
claude-sonnet-4-5-20250929- Claude Sonnet 4.5 (default) - Most capable model with advanced reasoningclaude-3-5-sonnet-20241022- Previous Sonnet 3.5 version
Pricing: $3 input / $15 output per million tokens
llm:
provider: deepseek
model: deepseek-reasoner # optional, uses default if not setAvailable Models:
deepseek-reasoner- DeepSeek-R1 reasoning model (default) - Extended thinking capabilitiesdeepseek-chat- General chat model
Pricing: Extremely cost-effective with reasoning capabilities
llm:
provider: gemini
model: gemini-3-pro-preview # optional, uses default if not setAvailable Models:
gemini-3-pro-preview- Latest Gemini 3 Pro (default) - Next-gen multimodal AIgemini-2.0-flash-thinking-exp-01-21- Gemini 2.0 with thinking mode
Pricing: Free tier available, very cost-effective for production
llm:
provider: grok
model: grok-4-1-fast-reasoning # optional, uses default if not setAvailable Models:
grok-4-1-fast-reasoning- Grok 4.1 with fast reasoning (default) - Real-time updates & deep thinkinggrok-2-latest- Previous Grok 2 version
Pricing: Competitive pricing with real-time data access
llm:
provider: openai
model: gpt-5.1 # optional, uses default if not setAvailable Models:
gpt-5.1- GPT-5.1 (default) - Latest flagship model with enhanced capabilitieso1- O1 reasoning modelgpt-4o- GPT-4 Optimized
Pricing: Premium pricing for state-of-the-art performance
| Provider | Pros | Best For |
|---|---|---|
| Claude | Sonnet 4.5 - Top reasoning & quality | Production, complex analysis |
| DeepSeek | R1 reasoning model - Ultra low cost | Budget-conscious, extended reasoning |
| Gemini | Gemini 3 Pro - Fast & multimodal | High-volume, multimodal tasks |
| Grok | 4.1 Fast Reasoning - Real-time data | Up-to-date info, quick reasoning |
| OpenAI | GPT-5.1 - Latest flagship model | Cutting-edge performance, general use |
How It Works:
- Prompts are always in English (best for Claude understanding)
- Output can be in 13+ languages (automatic translation)
- Set
AI_RESPONSE_LANGUAGEin.envor GitHub Secrets
Supported Languages:
en (English) • zh (中文) • es (Español) • fr (Français) • ja (日本語) • de (Deutsch) • ko (한국어) • pt (Português) • ru (Русский) • ar (العربية) • hi (हिन्दी) • it (Italiano) • nl (Nederlands)
Usage:
# .env file - Single language
AI_RESPONSE_LANGUAGE=zh # Full Chinese output
# .env file - Multiple languages (comma-separated)
AI_RESPONSE_LANGUAGE=en,zh,ja # Generate news in English, Chinese, and Japanese
# GitHub Secret
# Add: AI_RESPONSE_LANGUAGE = zh
# Or for multiple: AI_RESPONSE_LANGUAGE = en,zh,jaMulti-Language Support:
When you specify multiple languages (e.g., en,zh,ja), the bot will:
- Generate separate news digests for each language
- Send individual notifications for each language
- Include the language code in the notification title (e.g., "AI News Digest - 2024-12-03 [ZH]")
Example Output (Chinese):
国际新闻:
1. OpenAI发布GPT-5增强推理能力
OpenAI发布了GPT-5...
来源:OpenAI官方博客
The system automatically adds: "IMPORTANT: Please respond entirely in Chinese (中文)" to the prompt.
The project includes a GitHub Actions workflow that runs daily at midnight UTC (00:00).
Important: GitHub Actions uses Repository Secrets for configuration (NOT environment variables). All settings must be added as secrets.
Navigate to your GitHub repository:
Repository → Settings → Secrets and variables → Actions → Repository secrets → New repository secret
Add the following secrets one by one:
| Secret Name | Example Value | Description |
|---|---|---|
LLM_PROVIDER |
claude or deepseek |
LLM provider to use (default: claude) |
ANTHROPIC_API_KEY |
sk-ant-api03-xxx... |
Your Anthropic API key (if using Claude) |
DEEPSEEK_API_KEY |
sk-xxx... |
Your DeepSeek API key (if using DeepSeek) |
NOTIFICATION_METHODS |
email,slack,telegram |
Notification channels (comma-separated) |
| Secret Name | Example Value | Description |
|---|---|---|
GMAIL_ADDRESS |
you@gmail.com |
Your Gmail address |
GMAIL_APP_PASSWORD |
xxxx xxxx xxxx xxxx |
Gmail App Password (Get one here) |
EMAIL_TO |
recipient@example.com |
Recipient email address |
| Secret Name | Example Value | Description |
|---|---|---|
WEBHOOK_URL |
https://example.com/webhook |
Your webhook endpoint URL |
| Secret Name | Example Value | Description |
|---|---|---|
SLACK_WEBHOOK_URL |
https://hooks.slack.com/services/... |
Slack Incoming Webhook URL |
SLACK_CHANNEL |
#ai-news |
(Optional) Override default channel |
SLACK_USERNAME |
AI News Bot |
(Optional) Override bot username |
| Secret Name | Example Value | Description |
|---|---|---|
TELEGRAM_BOT_TOKEN |
123456:ABC-DEF... |
Telegram Bot API token from @BotFather |
TELEGRAM_CHAT_ID |
123456789 |
Chat ID (use @userinfobot to get your ID) |
| Secret Name | Example Value | Description |
|---|---|---|
DISCORD_WEBHOOK_URL |
https://discord.com/api/webhooks/... |
Discord Webhook URL |
DISCORD_USERNAME |
AI News Bot |
(Optional) Override bot username |
DISCORD_AVATAR_URL |
https://example.com/avatar.png |
(Optional) Custom avatar URL |
| Secret Name | Example Value | Description |
|---|---|---|
AI_RESPONSE_LANGUAGE |
zh or es or ja |
Language code (defaults to en if not set) |
ENABLE_WEB_SEARCH |
true or false |
Enable web search for news (defaults to false) |
Ensure GitHub Actions are enabled in your repository settings:
Repository → Settings → Actions → General → Allow all actions and reusable workflows
Once secrets are configured, test your setup:
Repository → Actions tab → Daily AI News Digest → Run workflow button
This will run the workflow immediately so you can verify everything is working.
The workflow runs daily at midnight UTC by default. To change the schedule, edit .github/workflows/daily-news.yml:
schedule:
- cron: "0 0 * * *" # Midnight UTC daily (current)
- cron: "0 9 * * *" # 9:00 AM UTC daily
- cron: "0 */6 * * *" # Every 6 hoursUse crontab.guru to create custom schedules.
ai-news-bot/
├── .github/
│ └── workflows/
│ └── daily-news.yml # GitHub Actions workflow
├── src/
│ ├── __init__.py
│ ├── config.py # Configuration management
│ ├── logger.py # Logging utilities
│ ├── news_generator.py # News generation orchestration
│ ├── news_fetcher.py # RSS feed news fetching
│ ├── web_search.py # DuckDuckGo web search integration
│ ├── llm_providers/
│ │ ├── __init__.py
│ │ ├── base_provider.py # Base LLM provider interface
│ │ ├── claude_provider.py # Anthropic Claude provider
│ │ └── deepseek_provider.py # DeepSeek provider
│ └── notifiers/
│ ├── __init__.py
│ ├── email_notifier.py # Email notification
│ └── webhook_notifier.py # Webhook notification
├── main.py # Main application entry point
├── config.yaml # Active configuration file
├── requirements.txt # Python dependencies
├── .env.example # Example environment variables
├── .gitignore
├── README.md
└── README.zh.md # Chinese documentation
NOTIFICATION_METHODS=emailNOTIFICATION_METHODS=slack
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK/URLNOTIFICATION_METHODS=telegram
TELEGRAM_BOT_TOKEN=your_bot_token_here
TELEGRAM_CHAT_ID=your_chat_id_hereNOTIFICATION_METHODS=discord
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/YOUR/WEBHOOK/URLNOTIFICATION_METHODS=email,slack,telegram,discordThe bot generates email-optimized content that looks stunning across all email clients:
Features:
- ✅ No markdown formatting (clean, professional appearance)
- ✅ Automatic HTML conversion with beautiful styling
- ✅ Numbered news cards with visual badges
- ✅ Color-coded sections and headers
- ✅ Mobile-responsive layout
- ✅ Works in Gmail, Outlook, Apple Mail, and all mobile apps
What recipients see:
- Clean white container with professional styling
- Blue section headers with subtle borders
- Numbered news items in styled cards
- Italicized source citations
- Comfortable reading experience on any device
Example Email Screenshots:
Preview your emails: Run the bot locally and check the generated HTML email content.
Gmail SMTP is the easiest way to send emails - just use your existing Gmail account!
- Go to your Google Account Security
- Click on 2-Step Verification
- Follow the prompts to enable it (required for App Passwords)
- Go to Google App Passwords
- Or: Google Account → Security → 2-Step Verification → App passwords
- Select app: Mail
- Select device: Other (enter "AI News Bot")
- Click Generate
- Copy the 16-character password (looks like:
xxxx xxxx xxxx xxxx)
⚠️ Important: This is NOT your regular Gmail password. Keep this App Password safe!
# Gmail Configuration
GMAIL_ADDRESS=your_email@gmail.com
GMAIL_APP_PASSWORD=xxxx xxxx xxxx xxxx
EMAIL_TO=recipient@example.com
NOTIFICATION_METHODS=emailThat's it! Your Gmail is ready to send news digests.
- "Authentication failed": Make sure you're using the App Password, not your regular password
- "Less secure apps": This is outdated. Use App Passwords instead
- Can't find App Passwords: You must enable 2-Step Verification first
The webhook sends a JSON payload:
{
"title": "AI News Digest - 2025-10-25",
"content": "... news digest content ...",
"timestamp": "2025-10-25T09:00:00",
"source": "AI News Bot"
}Compatible with:
- Microsoft Teams
- Custom webhook endpoints
- Any service that accepts JSON webhooks
-
Create a Slack App
- Go to https://api.slack.com/apps
- Click "Create New App" → "From scratch"
- Name your app (e.g., "AI News Bot") and select your workspace
-
Enable Incoming Webhooks
- In your app settings, go to "Incoming Webhooks"
- Toggle "Activate Incoming Webhooks" to On
- Click "Add New Webhook to Workspace"
- Select the channel where you want to receive news
- Copy the webhook URL
-
Configure in .env
NOTIFICATION_METHODS=slack SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK/URL SLACK_CHANNEL=#ai-news # Optional: override default channel
Features:
- Rich message formatting with blocks
- Color-coded attachments
- Mobile-friendly notifications
- Channel and username customization
-
Create a Telegram Bot
- Open Telegram and search for @BotFather
- Send
/newbotcommand - Follow the prompts to name your bot
- Copy the API token provided
-
Get Your Chat ID
- Start a chat with your new bot
- Send any message to the bot
- Search for @userinfobot and send it any message
- It will reply with your user ID (this is your chat_id)
- Alternatively, for groups: add your bot to a group and use @getidsbot
-
Configure in .env
NOTIFICATION_METHODS=telegram TELEGRAM_BOT_TOKEN=123456789:ABCdefGHIjklMNOpqrsTUVwxyz TELEGRAM_CHAT_ID=123456789
Features:
- HTML and Markdown formatting support
- Automatic message splitting for long content
- Works with users, groups, and channels
- Mobile and desktop notifications
For Channel/Group:
- Add your bot to the channel/group as an administrator
- Use the channel/group ID as TELEGRAM_CHAT_ID
- Channel IDs start with
-100(e.g.,-1001234567890)
-
Create a Webhook
- Open your Discord server
- Go to Server Settings → Integrations → Webhooks
- Click "New Webhook"
- Name it (e.g., "AI News Bot")
- Select the channel for news
- Copy the webhook URL
-
Configure in .env
NOTIFICATION_METHODS=discord DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/YOUR/WEBHOOK/URL DISCORD_USERNAME=AI News Bot # Optional
Features:
- Rich embed formatting with colors
- Automatic content splitting for long messages
- Custom bot name and avatar
- Works on desktop and mobile
Advanced Options:
- Set custom avatar:
DISCORD_AVATAR_URL=https://example.com/avatar.png - Multiple embeds for better organization
- Color-coded sections (default: blue #0366d6)
- Automatic Retries: The news generator retries up to 3 times on failure
- Graceful Degradation: If one notification method fails, others still execute
- Comprehensive Logging: All operations are logged with timestamps and context
- GitHub Actions Artifacts: Error logs are uploaded for debugging
Ensure config.yaml exists in the project root.
- Make sure you're using an App Password, not your regular Gmail password
- Verify 2-Step Verification is enabled on your Google account
- Check that
GMAIL_ADDRESSandGMAIL_APP_PASSWORDare set correctly - App Password should be 16 characters (with or without spaces)
- Verify webhook URL is accessible
- Check webhook endpoint accepts JSON POST requests
- Review webhook service logs
- Verify
ANTHROPIC_API_KEYis valid - Check API quota/rate limits
- Review Anthropic API status
pytest# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run the bot
python main.pyGPL-3.0 License - See LICENSE file for details
- Discord Community: Join our Discord server for discussions, support, and updates
- GitHub Issues: For bug reports and feature requests, use the GitHub issue tracker
Powered by:
Made with ❤️ by the open source community

