Smart Email Assistant
AI Email Automation

Overview
The Smart Email Assistant is a full-stack AI-powered email management platform. A fine-tuned DistilBERT classifies incoming emails into 6 categories (promotions, spam, social_media, forum, verify_code, updates). A fine-tuned T5-small model generates context-aware draft replies. A heuristic priority scoring engine (0.0–1.0) weighs category confidence, urgency keywords, sender reputation, Gmail labels, and read status. Sentence-BERT (all-MiniLM-L6-v2) embeddings indexed in FAISS enable natural-language semantic search over the Gmail inbox. The system integrates with Gmail via OAuth2 (PKCE) for inbox fetching, real-time classification, bulk analysis, and draft reply creation. Built with Next.js 16 + React 19 frontend, FastAPI backend, and trained on Google Colab (T4 GPU).
Problem & Solution
Repetitive email work — classification, prioritisation, drafting standard replies — consumes hours that could be spent on meaningful work.
Multi-model ML pipeline that classifies emails into 6 categories, generates context-aware draft replies, scores priority, and enables semantic search — all integrated with Gmail via OAuth2.
Architecture & Dataflow
Technical Stack & Implementation
AI / ML & Models
- DistilBERT (classification)
- T5-small (reply generation)
- Sentence-BERT/all-MiniLM-L6-v2 (embeddings)
- FAISS
- PyTorch
- HuggingFace Transformers
Backend & APIs
- FastAPI
- Python
- SQLAlchemy
- Pydantic
- JWT (python-jose)
Frontend & UI
- Next.js 16
- React 19
- TypeScript
- Tailwind CSS
Data & Storage
- SQLite (dev)
- PostgreSQL (Docker)
DevOps & Infra
- Docker
- Docker Compose
- Google OAuth2 (PKCE)
Technical Challenges & Solutions
Fine-tuning DistilBERT for 6-class email classification with limited labelled data
Building a priority scoring heuristic that balances multiple signal sources
Integrating Gmail OAuth2 (PKCE) flow with real-time classification pipeline
Key Highlights & Results
Training pipeline: DistilBERT (~20 min), FAISS index (~5 min), T5 (~15 min) on Google Colab T4
Full-stack integration: Next.js frontend → FastAPI backend → ML models → Gmail API
Comprehensive test coverage: 23 backend + 4 frontend tests