A smart AI-powered Personal Email Assistant built as part of the Wasserstoff AI Internship Task.
It fetches unread emails, summarizes them using LLMs, detects calendar intent, sends Slack notifications, and drafts replies β showcasing AI integration and automation skills.
- β Fetch unread emails via Gmail API
- π§ Summarize email content using Hugging Faceβs BART model
- ποΈ Detect scheduling intent and create Google Calendar events
- π Thread-aware context gathering for smart replies
- π¨ Auto-generate reply drafts with option to confirm
- π Send Slack notifications for each processed email
- πΎ Store and update email data in SQLite using SQLAlchemy
- π§° Modular and extensible project structure
AiInternTask/
βββ app.py
βββ check.py
βββ credentials.json
βββ emails.db
βββ requirements.txt
βββ .env
β
βββ database/
β βββ __init__.py
β βββ db_connector.py
β βββ models.py
β
βββ email_integration/
β βββ __init__.py
β βββ credentials.json
β βββ email_fetcher.py
β βββ email_parser.py
β βββ email_sender.py
β βββ threading_utils.py
β βββ token.json
β βββ utils.py
β
βββ email_integration/utils/
β βββ __init__.py
β βββ reply_utils.py
β βββ summarizer.py
β
βββ tool_integrations/
βββ __init__.py
βββ calendar_integration.py
βββ credential.json
βββ search_utils.py
βββ slack_integration.py
βββ web_search.py
git clone https://github.com/aditya-gupta/wasserstoff/AiInternTask.git
cd AiInternTask
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install -r requirements.txt
- Visit Google Cloud Console
- Enable Gmail & Calendar APIs
- Create OAuth client ID and download the
credentials.json
- Place it in the
credentials/
directory
- Go to Slack Incoming Webhooks
- Create a new webhook and copy the URL
- Add it to your
.env
file asSLACK_WEBHOOK_URL=your_webhook_url
python app.py
- Emails are fetched via Gmail API
- Each email is parsed and stored in SQLite
- Email body is passed to the BART LLM for summarization
- Context-aware reply is generated
- If scheduling intent is detected, a calendar event is created
- A Slack notification is sent for every processed email
- Gmail API β Email fetching
- Hugging Face BART β Summarization & reply generation
- Google Calendar API β Schedule meeting slots
- Slack API β Notify updates
- SQLite β Store email history and summaries
A short demo video is included demonstrating:
- Running the app
- Fetching and summarizing emails
- Detecting scheduling intent
- Sending Slack notifications and replies
Windows pip install -r requirements.txt
### 3. Setup Gmail API Credentials
- Visit [Google Cloud Console](https://console.cloud.google.com/)
- Enable **Gmail** & **Calendar** APIs
- Create OAuth client ID and download the `credentials.json`
- Place it in the `email_integration/` directory
### 4. Setup Slack Webhook
- Go to [Slack Incoming Webhooks](https://api.slack.com/messaging/webhooks)
- Create a new webhook and copy the URL
- Add it to your `.env` file or directly in `slack_integration.py` (for testing only)
### 5. Run the App
```bash
python app.py
- Emails are fetched via Gmail API
- Each email is parsed and stored in SQLite
- Email body is passed to the BART LLM for summarization
- Context-aware reply is generated
- If scheduling intent is detected, a calendar event is created
- A Slack notification is sent for every processed email
- Gmail API β Email fetching
- Hugging Face BART β Summarization & reply generation
- Google Calendar API β Schedule meeting slots
- Slack API β Notify updates
- SQLite β Store email history and summaries
A short demo video is included (or to be provided via link) demonstrating:
- Running the app
- Fetching and summarizing emails
- Detecting scheduling intent
- Sending Slack notifications and replies
This project was created as part of an internship assessment task and is free for non-commercial educational use.