Mail2ScheduleAI is an AI-powered automation system that reads Gmail messages and converts them into structured scheduled tasks using LangChain and Google Gemini.
The project demonstrates how Large Language Models (LLMs) can automate real-world workflows by transforming unstructured email content into actionable schedules.
- 📧 Read emails using the Gmail API
- 🤖 Extract tasks using Gemini LLM
- 🧠 Intelligent message understanding
- 📅 Convert messages into structured schedule tasks
- ⚡ Built with LangChain agents
- 🔐 Secure API keys using
.env
Gmail Inbox
│
▼
Gmail API Reader
│
▼
LangChain Agent
│
▼
Gemini LLM
│
▼
Task Extraction
│
▼
Structured Schedule Tasks
Mail2ScheduleAI/
│
├── agents/
│ └── schedule_agent.py
│
├── models/
│ └── task_model.py
│
├── utils/
│ ├── gemini_client.py
│ └── gmail_reader.py
│
├── app.py
├── .env
├── requirements.txt
└── README.md
git clone https://github.com/pq36/Mail2ScheduleAI.git
cd Mail2ScheduleAI
python -m venv venv
Activate:
Windows
venv\Scripts\activate
Mac/Linux
source venv/bin/activate
pip install -r requirements.txt
Create .env file in the root folder.
GOOGLE_API_KEY=your_gemini_api_key
- Open Google Cloud Console
- Enable Gmail API
- Create OAuth credentials
- Download
credentials.json - Place it in the project root
python app.py
The program will:
- Authenticate Gmail
- Fetch recent emails
- Send messages to Gemini
- Extract tasks and scheduling information
Hi Meghana,
Please finish the Azure pipeline report by tomorrow at 5 PM.
Also schedule a team meeting on Friday at 10 AM.
[
{
"task": "Finish Azure pipeline report",
"date": "Tomorrow",
"time": "5 PM"
},
{
"task": "Team meeting",
"date": "Friday",
"time": "10 AM"
}
]
- Python
- LangChain
- Google Gemini API
- Gmail API
- Pydantic
- python-dotenv
- Google Calendar event creation
- Real-time email monitoring
- Task dashboard UI
- MongoDB task storage
- Notification system
Meghana AI / ML and Full Stack Developer interested in building AI agents and automation systems.