https://github.com/literalkrishu/ai-powered-email-assistant
AI-Powered-Email-Assistant is designed to help support teams manage hundreds (or thousands) of daily emails efficiently. It automatically retrieves support emails, analyzes sentiment, assigns priority, extracts key details, and generates context-aware replies using LLMs.
https://github.com/literalkrishu/ai-powered-email-assistant
docker docker-compose faiss fastapi huggingface nodejs postgresql python-3 rag reactjs recharts tailwindcss uvicorn
Last synced: 2 months ago
JSON representation
AI-Powered-Email-Assistant is designed to help support teams manage hundreds (or thousands) of daily emails efficiently. It automatically retrieves support emails, analyzes sentiment, assigns priority, extracts key details, and generates context-aware replies using LLMs.
- Host: GitHub
- URL: https://github.com/literalkrishu/ai-powered-email-assistant
- Owner: LiteralKrishu
- License: mit
- Created: 2025-09-04T12:10:30.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-09-04T17:54:57.000Z (9 months ago)
- Last Synced: 2025-09-04T19:32:56.989Z (9 months ago)
- Topics: docker, docker-compose, faiss, fastapi, huggingface, nodejs, postgresql, python-3, rag, reactjs, recharts, tailwindcss, uvicorn
- Language: Python
- Homepage:
- Size: 26.4 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π§ AI-Powered-Email-Assistant
> π€ Intelligent email management system for modern organizations.
> Fetches, categorizes, prioritizes, and drafts AI-powered responses to customer support emails.



---
## π Project Objective
**AI-Powered-Email-Assistant** is designed to help support teams manage **hundreds (or thousands) of daily emails** efficiently.
It automatically **retrieves support emails, analyzes sentiment, assigns priority, extracts key details, and generates context-aware replies** using LLMs.
This ensures **faster, empathetic, and accurate responses**, reducing manual effort while boosting customer satisfaction.
---
## π§± Architecture & Workflow
```text
β βββββββββββββββββββββ β
β Email Server β
β (Gmail/Outlook/IMAP) β
β βββββββββββββββββββββ β
β
βββββββββββββΌββββββββββββ
β Email Retrieval Layer β
β (IMAP/Gmail API) β
βββββββββββββ¬ββββββββββββ
β
Raw Emails
β
βββββββββββββΌββββββββββββ
β Preprocessing & NLP β
β - Filtering β
β - Sentiment Analysis β
β - Priority Detection β
β - Info Extraction β
βββββββββββββ¬ββββββββββββ
β
βββββββββββββΌββββββββββββ
β AI Response Generator β
β - Context Embedding β
β - RAG (Knowledge Base)β
β - LLM Draft Replies β
βββββββββββββ¬ββββββββββββ
β
βββββββββββββΌββββββββββββ
β Database (Postgres) β
β Emails + Metadata β
βββββββββββββ¬ββββββββββββ
β
βββββββββββββΌββββββββββββ
β Dashboard (React/Next)β
β - Email List + Detailsβ
β - Analytics & Stats β
β - Draft Reply Review β
βββββββββββββββββββββββββ
```
---
## π¦ Tech Stack
| Layer | Technology |
|-------------|---------------------------------------|
| Backend | Python, FastAPI, Uvicorn |
| NLP / AI | Hugging Face (DistilBERT, RoBERTa), OpenAI GPT, FAISS for RAG |
| Database | PostgreSQL |
| Frontend | React / Next.js, TailwindCSS, Recharts |
| Deployment | Docker, docker-compose |
---
## π Project Phases & Deliverables
### Phase 1: Planning & Setup
- Define requirements
- Setup repo, `.env`, base project structure
π Deliverables:
`README.md`, base FastAPI app, frontend scaffold
---
### Phase 2: Email Retrieval & Storage
- Connect to Gmail/Outlook IMAP API
- Filter subjects: *Support, Query, Request, Help*
- Store raw + metadata in PostgreSQL
π Deliverables:
`/backend/email_service.py`, database schema
---
### Phase 3: NLP Processing
- Sentiment classification (Positive/Negative/Neutral)
- Urgency detection (keywords: *immediately, critical, cannot access*)
- Information extraction (phone, product, requirements)
π Deliverables:
`/backend/nlp_pipeline.py`, test data runs
---
### Phase 4: AI-Powered Responses
- RAG layer for contextual replies (knowledge base + embeddings)
- LLM draft reply generation (empathetic + product-aware)
π Deliverables:
`/backend/ai_responder.py`, OpenAI integration
---
### Phase 5: Dashboard Development
- List emails (sortable by priority)
- Email detail view (raw + extracted info + AI draft)
- Analytics: total emails, sentiment breakdown, pending vs resolved
π Deliverables:
`/frontend/pages/*.tsx`, `Recharts` graphs
---
### Phase 6: Final Integration & Testing
- SMTP/Gmail API for sending replies
- Docker-compose setup for full stack
π Deliverables:
Working end-to-end MVP
---
## βοΈ Setup Instructions
### Backend Setup
1. Navigate to project:
```bash
cd AI-Powered-Email-Assistant
```
2. Create virtual environment:
```bash
python -m venv venv
```
3. Activate environment:
- Windows: `venv\Scripts\activate`
- macOS/Linux: `source venv/bin/activate`
4. Install dependencies:
```bash
pip install -r requirements.txt
```
5. Update `.env` with actual credentials.
6. Run app:
```bash
uvicorn app.main:app --reload
```
### Frontend Setup
1. Navigate to frontend:
```bash
cd frontend
```
2. Install dependencies:
```bash
npm install
```
3. Install Recharts:
```bash
npm install recharts
```
4. Start dev server:
```bash
npm run dev
```
### Docker Setup (Optional)
1. Update `.env` with credentials.
2. Run:
```bash
docker-compose up
```
---
## π Access the Application
- Backend API β [http://localhost:8000](http://localhost:8000)
- Frontend β [http://localhost:3000](http://localhost:3000)
- API Docs β [http://localhost:8000/docs](http://localhost:8000/docs)
---
## β οΈ Notes
- Enable **IMAP** and generate an **App Password** for Gmail.
- Requires **OpenAI API key** (or custom LLM endpoint).
- Ensure **PostgreSQL** is running and accessible.
---
## π§ Example Email Flow
**Raw Email**
```
From: diana@client.co
Subject: URGENT - General query about subscription
Body: Hi team, I am unable to log into my account since yesterday. Please fix this immediately. My phone number is 9876543210.
```
**Extracted Info**
- Sender: `diana@client.co`
- Subject: "URGENT - General query about subscription"
- Sentiment: Negative
- Priority: Urgent
- Phone: 9876543210
- Requirement: Account recovery
**AI Draft Response**
```
Hi [Customer Name],
I understand how frustrating it must be to be locked out of your account, and I sincerely apologize for the inconvenience.
Our support team is already looking into this issue, and we will help restore your account access as quickly as possible.
I will personally ensure this case is treated with top priority. Meanwhile, could you please confirm the last login attempt (date/time) for verification?
Thank you for your patience.
Best regards,
[Your Support Team]
```
---