Advanced Email Management with AI-Powered Classification
Transform your Gmail inbox into an organized, intelligent email management system! This powerful tool uses artificial intelligence to automatically classify, label, and organize your emails, saving you hours of manual work.
Imagine having a smart assistant that:
- 🤖 Reads your emails and understands what they're about
- 🏷️ Automatically labels them (Business, Freight, Important, etc.)
- 📁 Organizes your inbox by moving emails to appropriate folders
- ⭐ Learns from your starred emails to understand what's important to you
- 💬 Answers questions about your emails using AI
- 📊 Shows beautiful charts of your email patterns
- Business owners managing multiple types of emails
- Freight/logistics professionals dealing with shipping emails
- Anyone who gets overwhelmed by their Gmail inbox
- Students learning about AI and email automation
- Professionals who want to save time on email management
- Quick Start Guide
- Detailed Installation
- Setting Up Gmail
- First Time Setup
- How to Use
- Features Guide
- Troubleshooting
- Advanced Tips
- Click the green "Code" button at the top of this page
- Select "Download ZIP"
- Extract the ZIP file to your Desktop
- Go to python.org
- Download Python 3.11 or newer
- IMPORTANT: Check "Add Python to PATH" during installation
- Go to your Google Account Settings
- Enable 2-Factor Authentication
- Create an "App Password" for this tool
- Double-click
INSTALL_AND_RUN.bat - Follow the setup wizard
- Start organizing your emails!
- Windows 10/11 (Mac/Linux users see advanced section)
- Gmail Account with 2-Factor Authentication
- Internet Connection
- Basic computer skills (can download files, extract ZIP)
-
Download this project:
- Click "Code" → "Download ZIP"
- Extract to
C:\Users\YourName\Desktop\Email_Scraper
-
Run the installer:
- Double-click
INSTALL_AND_RUN.bat - Wait for installation to complete
- The program will launch automatically
- Double-click
-
Install Python:
# Download from python.org and install # Make sure to check "Add to PATH"
-
Install dependencies:
pip install -r requirements.txt
-
Run the application:
python gui/Ai_Gmail_ManagerV3_GUI.py
Gmail requires special permission for external apps to access your emails securely. Think of it like giving a house key to a trusted friend.
-
Enable 2-Factor Authentication:
- Go to Google Account Security
- Click "2-Step Verification"
- Follow the setup process
-
Create an App Password:
- In Google Account Security, find "App passwords"
- Select "Mail" and "Windows Computer"
- Google will generate a 16-character password
- SAVE THIS PASSWORD - you'll need it!
-
What NOT to use:
- ❌ Don't use your regular Gmail password
- ❌ Don't share your App Password with others
- ✅ Only use the App Password for this tool
-
Enter your credentials:
- Gmail Address: your.email@gmail.com
- App Password: the 16-character password from Google
- Email Count: start with "50" for testing
-
Choose your settings:
- Classification Mode: Select "AI" for best results
- Label Strategy: Choose "create_ai" to start
- Checkboxes: Leave defaults for now
-
Test the connection:
- Click "1. Test Gmail Connection"
- You should see "✅ Gmail connection successful!"
The app has several main areas:
-
Operation Mode (Top):
- 🔵 Demo Mode: Safe testing (no real changes)
- 🔴 Live Mode: Real email processing
-
Gmail Settings (Left):
- Your email credentials
- Processing options
-
AI Operations (Center):
- Main buttons for AI features
-
System Output (Bottom):
- Shows what the AI is doing
-
AI Chat (Right):
- Ask questions about your emails
-
Start in Demo Mode (Blue button - safe!):
- Click "🔵 DEMO MODE"
- This won't change your actual emails
-
Test the AI:
- Click "2. 📧 Preview Emails"
- See what emails the AI finds
-
Learn from your preferences:
- Click "3. ⭐ AI Learn from Starred"
- The AI studies your starred emails
-
Classify your emails:
- Click "5. 🤖 AI Classify Emails"
- Watch the AI organize your inbox!
-
Switch to Live Mode (when ready):
- Click "🔴 LIVE MODE"
- Now the AI will actually move your emails
What it does: The AI reads your emails and decides what category they belong to.
Categories include:
- 📧 Important: Starred emails, urgent messages
- 🚛 Freight/Logistics: Shipping, trucking, delivery emails
- 💼 Business: Work-related correspondence
- 💰 Financial: Banking, invoices, payments
- 👥 Social: LinkedIn, networking, personal
- 📰 Marketing: Newsletters, promotions
- 🗑️ Spam: Unwanted emails
What it does: The AI looks at emails you've starred and learns what's important to you.
How to use:
- Star important emails in Gmail (⭐ button)
- Click "AI Learn from Starred" in the app
- The AI studies your preferences
- Future classifications become more accurate
What it does: Ask questions about your emails and get instant answers!
Example questions:
- "Do I have emails from Apex?"
- "Show me emails with API"
- "What are my most important emails?"
- "How many unread emails do I have?"
- "Find freight emails from this week"
What it does: Beautiful charts showing your email patterns.
Charts include:
- 📈 Email volume by hour
- 🎯 Classification accuracy
- 📊 Email distribution
- 📅 Daily activity patterns
Label Strategies:
- create_ai: Creates new AI-powered labels
- use_existing: Uses your current Gmail labels
- both: Combines both approaches
How labels work:
- AI creates labels like "AI-Business", "AI-Freight"
- Emails are automatically tagged
- Easy to find emails later in Gmail
Problem: Can't connect to Gmail Solutions:
- Check your internet connection
- Verify your Gmail address is correct
- Make sure you're using the App Password (not regular password)
- Ensure 2-Factor Authentication is enabled
Problem: AI features not working Solutions:
- Make sure all files downloaded correctly
- Check that Python installed properly
- Try restarting the application
Problem: Application doesn't start Solutions:
- Right-click
Ai_Gmail_ManagerV3_GUI.py→ "Open with Python" - Check if Python is installed correctly
- Try running
INSTALL_AND_RUN.batas administrator
Problem: Classification runs but emails stay in inbox Solutions:
- Make sure you're in "Live Mode" (red button)
- Check "Process Emails (Real Actions)" is enabled
- Verify Gmail permissions are correct
- Check the console output for error messages
- Try Demo Mode first to test safely
- Restart the application if it seems stuck
- Check your internet connection
- Verify Gmail credentials are correct
You can modify the AI's classification logic by editing the code:
- Open
gui/Ai_Gmail_ManagerV3_GUI.py - Find the
classify_emailmethod - Add your custom rules
- Start with small email counts (50-100)
- Gradually increase as you gain confidence
- Use "All Available" only for final processing
- Close other applications while processing
- Use a stable internet connection
- Process emails during off-peak hours
Email_Scraper/
├── gui/
│ └── Ai_Gmail_ManagerV3_GUI.py # Main application
├── smart_learning_classifier.py # AI classification engine
├── requirements.txt # Dependencies
└── credentials/ # Your Gmail credentials
- GUI: Tkinter-based interface
- AI Engine: Scikit-learn classification
- Email Processing: IMAP protocol
- Data Storage: SQLite database
- No cloud storage: Everything runs on your computer
- No data sharing: Your emails never leave your machine
- Secure connection: Uses Gmail's official API
- Local processing: AI runs locally, not on external servers
- Email metadata: Subject lines, sender info, dates
- Classification results: What category each email belongs to
- User preferences: Your starred email patterns
- No email content: Full email text is not permanently stored
Want to help improve this tool?
- Report bugs: Create an issue on GitHub
- Suggest features: Tell us what you'd like to see
- Share feedback: How did this tool help you?
- Contribute code: Submit pull requests
This project is open source and available under the MIT License. Feel free to use, modify, and share!
- Built with Python, Tkinter, and Scikit-learn
- Uses Gmail's IMAP API for email access
- AI classification powered by machine learning
- Charts created with Matplotlib
Need help? Here's how to get support:
- Check this README for common solutions
- Look at the troubleshooting section
- Create an issue on GitHub with:
- Your operating system
- Python version
- Error messages (if any)
- What you were trying to do
Ready to transform your Gmail experience? Let's get started! 🚀
Remember: Start with Demo Mode to safely test everything before processing your real emails!






