# 📧 Gmail → AI → WhatsApp Automation Bot
A Python-based automation project that **reads Gmail emails, analyzes them using AI, and forwards important ones to WhatsApp via Twilio** — running continuously in the cloud.
---
## 🚀 What This Project Does
This bot:
1. **Monitors your Gmail inbox automatically**
2. Reads the latest email
3. Uses **OpenAI (GPT-4o-mini)** to decide whether the email is important
4. If important → Sends a WhatsApp message via **Twilio**
5. Avoids sending the same email twice
---
## 🛠️ Tech Stack Used
- **Python**
- **Google Gmail API**
- **OpenAI API**
- **Twilio WhatsApp API**
- **Google Cloud (for deployment)**
- **dotenv (.env) for secure credentials**
---
## 📂 Project Structure
gmail_ai_whatsapp/ │── gmail_ai_whatsapp.py # Main program │── .env # API keys (NOT pushed to GitHub) │── .gitignore # Prevents secret files from uploading │── processed_ids.txt # Stores processed email IDs │── README.md # This file
---
## 🔐 Environment Variables (.env)
Create a `.env` file and add:
OPENAI_API_KEY=your_openai_key TWILIO_SID=your_twilio_sid TWILIO_TOKEN=your_twilio_token
⚠️ **DO NOT push this file to GitHub.** It is already ignored via `.gitignore`.
---
## ▶️ How to Run Locally
1. Install dependencies:
```bash
pip install google-api-python-client google-auth google-auth-oauthlib twilio openai python-dotenv
python gmail_ai_whatsapp.py
You can run this 24×7 on Google Cloud (free-tier e2-micro VM).
Steps:
screen or a background processUseful for:
Sarvesh Karthik
$ claude mcp add gmail-ai-whatsapp-v2 \
-- python -m otcore.mcp_server <graph>