SmartMail: Intelligent Email Inbox with RAG Search
📂 Project Structure
- attachments/ — Stores email attachments
- backend/ — FastAPI backend handling webhook, MongoDB storage, and RAG search
- frontend/ — React app for inbox UI and chat interface
- .gitignore
- postmark-structure.json — Sample email payload structure
- requirements.txt — Python dependencies
🚀 What I Built
SmartMail is a smart email inbox system that:
- Receives emails via Postmark inbound webhook
- Stores emails and attachments with MongoDB integration
- Auto-classifies emails into categories like inbox, promotions, spam, etc.
- Enables chat-style querying over emails using Retrieval-Augmented Generation (RAG) with FAISS vector search
- Provides a React-based UI with an inbox and a conversational chat interface to ask questions about your emails
🎬 Demo & Usage
- Clone repo
- Run backend:
pip install -r requirements.txt
uvicorn backend.webhook:app --reload
Run frontend:
bash
Copy
Edit
cd frontend
npm install
npm run dev
Configure Postmark inbound webhook to point to your backend /postmark-webhook endpoint.
🔧 Tech Stack
Backend: FastAPI, Pydantic, MongoDB, FAISS, Sentence Transformers
Frontend: React
Email Handling: Postmark inbound webhook, JSON email parsing
Search: Vector search with FAISS for semantic email content querying
🧠 Challenges & Learnings
Handling complex email JSON structures and attachments
Implementing fast and accurate RAG search on email content
Designing a simple but powerful chat UI for email queries
Managing local storage for attachments and efficient DB indexing
📁 Code Repository
https://github.com/balasaiofficial/Postmark-Challenge.git
Top comments (0)