React client
Captures customer text and displays the category with a visual confidence score.
AI engineering case study
A full-stack classification service that turns unstructured customer text into a reliable category and confidence score through a clean REST API.

01 / The challenge
Support teams receive complaints, questions, feedback and unrelated messages in the same stream. Manual triage slows response time and creates inconsistent routing. This project provides a small, integration-ready service that applies one shared classification policy to every message.
02 / Architecture
Captures customer text and displays the category with a visual confidence score.
Validates requests and exposes a focused POST /api/classify endpoint.
Uses llama3.2:3b with a deterministic prompt and strict JSON output.
Optionally stores successful classifications through Mongoose.
{
"text": "My order arrived damaged."
}
{
"category": "Complaint",
"confidence": 0.96
}03 / API design
The API accepts a text string, validates it, invokes the model service and normalizes the response. Consumers always receive an allowed category and a confidence value between zero and one.
Check API health04 / Engineering decisions
Model output is matched case-insensitively against Complaint, Query, Feedback and Other.
Numeric confidence is clamped to the valid 0-1 range, with a documented fallback.
Empty text and payloads over 5,000 characters return clear HTTP 400 responses.
The classifier remains available when MongoDB is not configured or connected.
05 / Technology
06 / Delivered
Responsive React testing interface
Layered controller, route and service structure
Automated API and normalization tests
Postman collection and environment examples
Vercel serverless deployment configuration
Detailed local and production setup guide
Explore the working product