(Agent Mate, which covers many different structures(gmail, calender, notion etc.), is coming soon)
MailMate is an AI-powered system that analyzes, classifies, and processes your emails. Integrated with the Gmail API, it detects important emails, performs sentiment analysis, and directs them to the Omi platform when necessary.
This project helps users avoid missing important emails and save time by filtering out spam, allowing for a more efficient communication process. 📩✨
| Technology | Description |
|---|---|
| Python 🐍 | Core development language |
| Flask 🌐 | Webhook and API management |
| OpenAI API 🤖 | AI-powered email classification |
| Gmail API 📬 | Fetching emails from Google accounts |
| SQLite 🗃️ | Database for user management |
| Threading 🔄 | Background email processing |
| Logging System 📜 | Advanced logging and error handling |
✅ Automated Email Classification
📌 Detects important emails (e.g., invoices, meetings, security alerts)
🚨 Assigns priority levels (High, Medium, Low)
📧 Identifies emails that require a response
✅ Omi Integration
✍️ Summarizes emails and analyzes sentiment
🔗 Suggests relevant actions (reply, schedule a meeting, make a payment, etc.)
✅ Real-time Tracking & Notifications
🕵️ Continuously monitors incoming emails
🔔 Notifies users about important emails
pip install -r requirements.txtCreate a .env file and populate it as follows:
# APP
APP_SECRET_KEY=your_app_secret_key
# OpenAI API Key
OPENAI_API_KEY=your_openai_api_key
# Omi API Key
OMI_API_KEY=your_omi_api_key
OMI_APP_ID=your_omi_app_id
# Google OAuth Configuration
GOOGLE_CLIENT_SECRET=path/to/google_client_secret.jsonpython Main.py📂 MailMate
├── 📜 Main.py # Main entry point of the application
├── 📜 Config.py # API keys and configurations
├── 📜 Database.py # SQLite database for user management
├── 📜 email_service.py # Gmail API integration
├── 📜 classification_service.py # AI-powered email classification
├── 📜 action_service.py # Omi API integration
├── 📜 new_emails_monitor.py # Email tracking system
├── 📜 thread_manager.py # Background process management
└── 📜 Logger.py # Logging and error handling
🔍 Uses OpenAI API to classify incoming emails based on priority, content, and importance.
📨 Fetches emails from the Gmail API, retrieves all/unread messages, and extracts content.
🛠️ Sends classified emails to the Omi system for further processing.
⏳ Manages multi-threaded email scanning operations to keep the system running smoothly.
📍 Enter
GET /?uid=your_user_id
📍 Login
POST /Login uid, hadling in session
📍 Logout
POST /logout?uid=your_user_id
📍 Get Settings
GET /get-settings?uid=your_user_id
📍 Update Settings
POST /update-settings?uid=your_user_id
📍 Setup Complete
GET /setup-complete?uid=your_user_id