Skip to content

🧠 A smart AI-powered Personal Email Assistant built for the Wasserstoff AI Internship Task. It fetches emails, summarizes them using LLMs, detects calendar intent, sends Slack notifications, and drafts replies β€” showcasing AI integration and automation skills.

Notifications You must be signed in to change notification settings

A-A-D-I-C-O-D-E/AI-powered-Personal-Email-Assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 wasserstoff-AiInternTask

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.


πŸš€ Features

  • βœ… 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

πŸ—‚οΈ 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

βš™οΈ Setup Instructions

1. Clone the Repository

git clone https://github.com/aditya-gupta/wasserstoff/AiInternTask.git
cd AiInternTask

2. Create Virtual Environment & Install Dependencies

python -m venv venv
source venv/bin/activate  # or venv\Scripts\activate on Windows
pip install -r requirements.txt

3. Setup Gmail API Credentials

  • Visit Google Cloud Console
  • Enable Gmail & Calendar APIs
  • Create OAuth client ID and download the credentials.json
  • Place it in the credentials/ directory

4. Setup Slack Webhook

  • Go to Slack Incoming Webhooks
  • Create a new webhook and copy the URL
  • Add it to your .env file as SLACK_WEBHOOK_URL=your_webhook_url

5. Run the App

python app.py

🧠 Architecture Overview

⟲ Flow:

  1. Emails are fetched via Gmail API
  2. Each email is parsed and stored in SQLite
  3. Email body is passed to the BART LLM for summarization
  4. Context-aware reply is generated
  5. If scheduling intent is detected, a calendar event is created
  6. A Slack notification is sent for every processed email

πŸ—‚οΈ Components

  • 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

πŸ“½οΈ Video Walkthrough

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

🧠 Architecture Overview

⟲ Flow:

  1. Emails are fetched via Gmail API
  2. Each email is parsed and stored in SQLite
  3. Email body is passed to the BART LLM for summarization
  4. Context-aware reply is generated
  5. If scheduling intent is detected, a calendar event is created
  6. A Slack notification is sent for every processed email

πŸ—οΈ Components

  • 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

πŸ“ŸοΈ Video Walkthrough

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.


About

🧠 A smart AI-powered Personal Email Assistant built for the Wasserstoff AI Internship Task. It fetches emails, summarizes them using LLMs, detects calendar intent, sends Slack notifications, and drafts replies β€” showcasing AI integration and automation skills.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages