DEV Community

Bala Sai Kalepu
Bala Sai Kalepu

Posted on

SmartMail: Your Intelligent Inbox Assistant

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

  1. Clone repo
  2. 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.
Enter fullscreen mode Exit fullscreen mode

πŸ”§ 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)