SentriMail

An integrable, AI-powered complaint management system that automates customer ticket triage using local NLP and transcription models — translating, analyzing, and auto-resolving complaints in real time.

2026

Overview

SentriMail — Multi-Language AI Complaint Desk

SentriMail is a full-stack, role-based complaint management platform that uses local AI models to automatically analyze, classify, prioritize, and respond to customer complaints. It completely eliminates manual support bottlenecks while keeping operational costs to zero by running all intelligence models locally.

Stack

FastAPI, PyTorch, MongoDB, Whisper

Timeline

2026

GitHub Repository

Navin-665/SentriMail-MPW1 ↗

Interactive Analytics & Admin Dashboard

SentriMail Admin Analytics Dashboard

Real-time complaint tracking with automatic sentiment mapping, priority distribution graphs, average response time tracking, and automated responses.


The Problem

What problem does this solve?

In traditional customer support workflows, companies face severe manual bottlenecks. Critical complaints are often buried under noise, priority assignment is entirely subjective, non-English complaints are ignored or delayed, and agents waste hours drafting repetitive answers for simple issues.

Core Problem Statement

Traditional customer support suffers from slow response times, subjective prioritization, and multilingual communication barriers that lead to administrative fatigue and customer dissatisfaction.

Traditional Problem Workflow Impact
Manual Triaging Slow response times and human bottlenecks.
Subjective Prioritization Critical issues (e.g. system downtime, fraud) get buried under low-priority noise.
Multilingual Barriers Non-English complaints are delayed or ignored, alienating international users.
Admin Overload Support teams waste hours manually responding to simple, easily automated queries.
Lack of Emotional Context Distressed or angry customers do not receive immediate escalated care.

Handling Multilingual Barriers

Multi-language Support Dropdown

SentriMail's frontend supports direct language selection, automatically detecting and translating incoming texts and audio transcriptions from Arabic, Hindi, Tamil, French, Spanish, and more before running them through the English triaging pipeline.


Architecture

The Intelligent Pipeline

Every submitted complaint (text or voice) undergoes a fully automated, local pipeline from ingestion to resolution. The system translates text, transcribes audio, detects emotion, computes priority scores, and decides whether to auto-resolve or suggest a response to the admin.

1

Ingestion & Translation Layer

Detects customer language via langdetect, auto-translates to English via Google Translate API, and transcribes voice complaints locally via OpenAI Whisper.

2

AI Analysis Pipeline (Local ML Models)

Performs sentiment analysis (DistilBERT) and multi-emotion classification (DistilRoBERTa). Scans for critical urgency keywords to compute a priority score (0-100).

If Low Priority & Safe

Generates auto-replies locally via FLAN-T5 Small and auto-closes the ticket (e.g. gratitude, simple queries), notifying the customer by email.

If Medium / High / Critical

Routes ticket to the Admin Dashboard. Displays full sentiment metrics, emotional intensities, and draft suggested replies for 1-click administrative resolution.

Sentiment Donut Chart Piece

Sentiment Distribution Detail

Priority Severity Levels Detail

Priority Levels Detail

1. Language Detection & Transcription

Uses langdetect to identify the native tongue of the user. Audio files are processed locally using the OpenAI Whisper Base model (~140 MB), outputting English transcription via deep-translator wrappers.

2. Sentiment & Emotion Analysis

Complaints are fed into DistilBERT SST-2 (~268 MB) to evaluate positivity/negativity. Simultaneously, a DistilRoBERTa model (~329 MB) classifies the text into Anger, Fear, Sadness, Joy, Disgust, Surprise, or Neutral, capturing critical emotional nuances.

3. Dynamic Priority & Root Cause

Calculates a priority score (0–100) by combining sentiment confidence, emotional intensity (e.g. high weight on Anger/Fear), and keyword match triggers. Tickets are categorized as LOW, MEDIUM, HIGH, or CRITICAL.

4. Auto-Resolution vs Triage

Low-priority tickets receive an automated response generated locally via FLAN-T5 Small (~300 MB) and are auto-closed. Medium/High/Critical tickets are routed to the Admin Dashboard alongside an AI report and a pre-drafted suggested response.


Resilience

Graceful Degradation Design

In production and resource-constrained environments, machine learning pipelines can fail due to out-of-memory errors or network timeouts. SentriMail is built with a self-healing multi-layer fallback architecture to ensure the service never crashes.

System Component Primary Action Path Graceful Fallback Path
Sentiment & Emotion HuggingFace Transformer models Rule-based keyword/intensity matching
Response Generation FLAN-T5 generative models Pre-written professional template matching
Database Storage MongoDB (Local or Atlas Cloud) Local flat-file JSON storage (offline)
Email Delivery SMTP Server Mailgun/SES Silent failure with developer console logs
Voice Transcription OpenAI Whisper transcription Returns empty string (prompting text input fallback)

Technology Stack

Under the Hood

The tech stack was selected to maximize performance while keeping the deployment footprint minimal, fast, and entirely free of expensive third-party AI APIs.

AI & Cognitive Layer (100% Local)

Model / Library Task Resource Footprint
DistilBERT SST-2 Sentiment Analysis ~268 MB
DistilRoBERTa Emotion Emotion Classification ~329 MB
FLAN-T5 Model Response Text Generation ~300 MB
OpenAI Whisper Speech-to-Text Transcription ~140 MB
LangDetect & Translator Language Translation & Detection Lightweight API wrapper

Web, Data & DevOps

Technology Specific Role
Python 3.10 + FastAPI Asynchronous web and REST backend layers.
MongoDB & PyMongo Document store for tickets, user profiles, and activity logs.
HTML5 / CSS3 / Jinja2 Server-rendered frontends, custom charts, and responsive forms.
SHA-256 & Token Cookies Secure cookie sessions using cryptographically safe local keys.
Render Cloud & Git Procfile automation, version control, and web hosting.

Interface

Final Interfaces & Screens

SentriMail features a clean, responsive dark-themed dashboard. Admins can view aggregated analytics, priority distribution, and sentiment charts in real time, while users can track tickets in their custom portal.

User Ticket Portal

Customer Ticket Tracking Dashboard

The user portal lists the customer's submitted tickets, their current statuses (Resolved, Pending Admin, or Auto Replied), and lets them view administrative or auto-replied drafts.

Complaint Submission Desk

Submit Complaint Screen

Users can easily submit complaints by typing their issue or recording a voice message using the built-in mic recorder, specifying their native language.

Login Page

SentriMail Login Page

Secure portal page listing credentials for quick evaluation using different roles (Admin, Alice, Bob).


Takeaways

Key Architectural Decisions

Key Takeaways & Learnings

  • Zero-Cost Inference: Running models locally using HuggingFace Transformers removes API billing risk, ensuring the product scales without incurring per-request fees.
  • Lazy Model Ingestion: To speed up cold startup times, PyTorch models are loaded lazily on the first ticket submission rather than at server boot.
  • Data Integrity Fallbacks: Developing the JSON local file storage fallback ensured that database network losses never interrupted active complaint logs.
  • Security and Sessions: Cookie sessions utilize HttpOnly and SameSite flags to guarantee CSRF and session hijacking protection without complex JWT structures.

GitHub Project Repository: github.com/Navin-665/SentriMail-MPW1