Waseem Alsayed logoBack to SingularityCase Study 01 / 05
2026 · Structured LLM Triage & Reporting Backend

AI Support Ticket Intelligence API

Production-ready Flask REST API powered by OpenRouter LLMs to automatically classify incoming support tickets, analyze customer sentiment, score priority, and generate actionable resolution steps.

Core Stack
Flask + OpenRouter
Test Harness
pytest Suite
Data Layer
SQLAlchemy / SQLite
01 · The Problem

Support teams spend hours manually reading, categorizing, and triaging unstructured tickets before an engineer ever looks at them — causing SLA misses on urgent outages.

02 · System Architecture

Designed a modular Flask REST API that accepts raw tickets, runs a schema-constrained OpenRouter LLM inference pass for category, sentiment, urgency, and recommended action, persists normalized records in SQLAlchemy, and exposes Pandas-powered analytics endpoints.

03 · Key Engineering Decisions

Deterministic JSON Triage Contract

Isolated LLM prompting behind a strict validator with fallback defaults so malformed model responses never break ticket ingestion.

SQLAlchemy + Pandas Reporting Split

Kept transactional CRUD lightweight in SQLite/SQLAlchemy while aggregating SLA metrics and category distributions cleanly via Pandas dataframes.

Automated Endpoint Verification

Covered ingestion, filtering, and analytics routes with pytest fixtures so schema regressions fail fast before deployment.

Technologies Used
PythonFlaskSQLAlchemyOpenRouterPandaspytest
Direct Contact · Jeddah, Saudi Arabia

Want to discuss this architecture or a software role?