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)