An AI-powered email management tool that automatically categorizes emails, flags important messages, and saves summaries to Notion.
- 📧 Email Reading: Connects to Gmail via API
- 🏷️ Auto Categorization: Sorts emails into Work, Personal, Promotions, Updates
- ⚡ Important Email Detection: Flags urgent/important emails
- 📝 AI Summarization: Generates concise summaries using OpenAI
- 📊 Notion Integration: Saves important emails to Notion database
- 🖥️ Web Interface: User-friendly Streamlit dashboard
-
Install dependencies:
pip install -r requirements.txt
-
Configure environment:
cp .env.example .env # Edit .env with your API keys
-
Gmail Setup:
- Go to Google Cloud Console
- Enable Gmail API
- Download credentials.json
- Place in project root
-
Notion Setup:
- Create integration at notion.so/my-integrations
- Create database with properties: Subject (Title), Sender (Text), Category (Select), Date (Text), Summary (Text), Important (Checkbox)
- Get database ID from URL
-
Run the app:
streamlit run app.py
- Open the web interface:
streamlit run app.py
- Click "Process Emails" to analyze recent emails
- View categorization results and important emails saved to Notion
Option 1: Simple Scheduler
python run_scheduler.py # Runs 3x daily (9AM, 2PM, 6PM)
Option 2: Daemon Service (Recommended for hosting)
python daemon.py start # Start background service
python daemon.py stop # Stop background service
- Processes emails 3 times daily automatically
- Runs independently even when app is closed
- Check logs in
email_processing_log.json
- Perfect for server deployment
Edit config.py
to customize:
- Email categories
- Important keywords
- Processing parameters
- Processes recent emails only (not historical)
- Basic categorization (4 categories)
- Simple importance detection
- No email actions (mark as read, archive, etc.)
- Add more sophisticated categorization
- Implement email actions
- Add scheduling/automation
- Improve error handling
- Add user feedback loop