AI & Machine Learning20244 min readNLP & Microservice Developer● Open Source

Laundry AI Conversational Assistant

Fine-Tuned FLAN-T5 NLP Model and Flask REST Microservice for Conversational Campus Laundry Customer Support

LanguagePython 3.9+
Model ArchitectureGoogle FLAN-T5 Base
NLP LibraryHuggingFace Transformers
Backend APIFlask REST
Client BridgeFlutter (connect.dart)
Dataset Size500+ Dialogues
Model BaseFLAN-T5 Base
API ProtocolFlask HTTP POST
Tunnelingngrok Integration
Laundry AI Conversational Assistant
System Preview
Laundry AI Conversational Assistant Interface Screenshot
01. Overview & Problem Solved

System Context & Value Proposition

The Laundry AI Conversational Assistant is an NLP-powered microservice built to handle 24/7 student laundry inquiries within the campus Laundry App ecosystem. Powered by a fine-tuned Google FLAN-T5 sequence-to-sequence model served through Flask, the assistant provides immediate contextual guidance on garment washing temperatures, fabric care instructions, stain diagnosis remedies, cycle turnaround times, and refund inquiries.

Core Problem Statement:

Hostel laundry support staff are overwhelmed by repetitive daily student questions regarding order delays, delicate garment rules, and pricing policies.

✕Hostel students frequently damage delicate garments through improper water temperature or detergent selection.
✕Laundry helpdesks receive hundreds of repetitive queries regarding pricing, pickup delays, and lost coupon policies.
✕General-purpose chatbots (like unconditioned LLMs) hallucinate incorrect garment handling steps and provide verbose non-actionable advice.
💡 Engineered Solution:Fine-tuned Google's FLAN-T5 model on 500+ curated domain QA dialogue pairs and served the model via a lightweight Flask REST endpoint integrated with the student Flutter client.
02. Engineering Blueprint

System Architecture & Execution Flow

Architecture Data FlowASCII Topology
Flutter Mobile Client
      ↓ (HTTP POST via connect.dart)
ngrok / Cloud Gateway
      ↓
Flask API Server (/get-response)
      ↓
Prompt Formatting & Tokenizer
      ↓
FLAN-T5 Base Transformer (PyTorch Weights)
      ↓
Response Decoding & Safety Guardrails
      ↓
JSON Response Streamed to Mobile Chat UI

Multi-Tier Architectural Layers

Layer 01 • Mobile Integration Layer

Flutter, Dart (connect.dart)

Custom chat UI with quick-prompt chips, message bubble animations, and JSON HTTP POST client communicating with the Flask backend.

Layer 02 • API Microservice

Python, Flask, CORS

Lightweight REST endpoint (/get-response) managing request parsing, rate limiting, and output serialization.

Layer 03 • Transformer NLP Model

HuggingFace, PyTorch, FLAN-T5 Base

Sequence-to-sequence instruction-tuned model conditioned on garment care taxonomies, pricing matrices, and hostel service guidelines.

03. Key Capabilities

Core Engineering Modules & Workflows

✓Garment Care & Stain Diagnostics

Provides step-by-step chemical and temperature remedies for coffee, ink, grease, and oil stains across cottons, wools, and synthetics.

✓Pricing & Service Policy FAQ

Instantly quotes accurate laundry charges, turn-around timelines, weight limits, and delivery schedules.

✓Flutter Connector Bridge

Dart client module (connect.dart) enabling seamless embedding of chat assistant within the mobile laundry client.

✓Safety Guardrails

Mitigates hallucinations by bounding model generation within verified laundry care and chemical safety boundaries.

04. Data Modeling & Interfaces

Persistence Schemas & Execution Contracts

Database Schema & Entity Structure

Schema RepresentationValidated DDL
Datasets:
  ├── Datasets/laundry_dataset.json (Domain QA pairs)
  └── Datasets/laundry_faq_500_basic.json (FAQ dialogue corpus)
Trained Checkpoints:
  └── flan_laundry_bot1_8_lr5e-05.pth (PyTorch Model via Git LFS)

Key Endpoints & Query Interfaces

POST/get-response
Accepts JSON: { query: 'How do I remove ink stains?' } and returns answer string.
05. Implementation & Retrospective

Engineering Challenges & Specifications

Technical Obstacles Solved

⚡ Challenge:Inference Latency on Low-Resource Servers

Resolution: Quantized FLAN-T5 weights and implemented query response caching for top-50 high-frequency student questions.

Technology Stack Matrix

CategoryTooling & Frameworks
NLP ModelGoogle FLAN-T5 Base
Deep Learning LibraryHuggingFace Transformers, PyTorch
Web ServerPython Flask
Mobile ConnectorFlutter Dart (connect.dart)
Tunneling Protocolngrok Reverse Proxy

Local Execution Commands

TerminalBash
$git clone https://github.com/KESHAV-26-2004/laundry_ai_bot.git
$pip install -r requirements.txt
$python flask_app.py (Runs server on http://localhost:5000)

Future Roadmap & Upcoming Milestones

→Multimodal vision recognition identifying fabric care symbol tags via mobile camera photos.
→Redis memory cache providing sub-25ms responses for common FAQs.