A practical demo showing how AI can analyze pharmaceutical product complaints from text or photos, identify potential defects, and flag urgent cases for QA review. Built with decision models like Jev that return structured decisions and confidence scores.

Handling pharmaceutical product complaints, from broken tablets and leaking bottles to incorrect labels and potential contamination, can be a time-consuming process for Quality Assurance (QA) teams.
Each complaint needs to be reviewed, classified, and routed appropriately, while ensuring that potentially critical issues receive timely attention.
AI-assisted complaint triage can help streamline this process by analyzing complaint descriptions and photos, identifying potential defects, and suggesting the appropriate review path.
By combining AI-based classification with predefined business rules and human oversight, organizations can:
Reduce manual effort in initial complaint classification and triage.
Improve consistency in how complaints are categorized and routed.
Identify potentially urgent cases earlier for prioritized QA review.
Support faster decision-making while keeping quality professionals in control.
This project demonstrates how such a workflow can be built using AI decision models like TypeSafe Jev, which return structured classifications and probabilities rather than free-form text.

The application accepts a complaint description, a product photo, or both, and processes the information through three main steps:
AI Classification: A decision model analyzes the complaint and returns structured categories, subcategories, and probabilities rather than free-form text.
Rule-Based Routing: Fixed business rules and model signals determine whether the complaint should be routed to Urgent QA, Human Review, or standard QA Review.
Human Confirmation: A QA reviewer confirms every classification and routing result before further action.
For example, a complaint about broken tablets might be categorized as a physical defect, while a complaint mentioning foreign particles or incorrect product strength could trigger urgent QA escalation.
The AI assists with classification, but it does not make final product safety or regulatory decisions.
Traditional LLM applications often generate natural-language responses that require additional parsing and validation.
Decision models, such as TypeSafe Jev, are designed to return structured outputs, including predefined choices, scores, and probabilities.
This project demonstrates how to use these capabilities for:
Structured classification: Assign complaints to predefined categories and subcategories.
Confidence-aware routing: Flag uncertain classifications for additional human review.
Multi-label detection: Identify complaints involving multiple types of defects.
Rule-based escalation: Combine AI predictions with deterministic rules for urgent cases.
Human-in-the-loop decisions: Keep quality professionals responsible for confirming results.
This demo illustrates how AI-assisted classification could support the initial stages of pharmaceutical complaint management.
Organizations could adapt the approach to:
Automate initial complaint categorization: Reduce repetitive manual classification of incoming complaints.
Prioritize QA review: Flag potentially urgent cases for earlier attention.
Standardize complaint intake: Apply consistent categories and predefined routing rules.
Support human decision-making: Help QA professionals review structured information while retaining control over final decisions.
The same approach could also be extended to customer support triage, incident classification, and other workflows that require structured decisions and human oversight.
The goal is not to replace QA professionals, but to help them focus their attention where it matters most.
Are you exploring how AI could improve complaint handling, automate initial classification, or help your QA team identify and prioritize critical issues?
I'd be happy to discuss how a similar AI-powered solution could be adapted to your organization's quality management processes, with the right balance of automation, business rules, and human oversight.
Book a Demo or AI Strategy Call
If you are interested in building a similar AI-powered classification and routing application, this open-source project provides a practical starting point for experimenting with AI decision models, structured outputs, confidence-based routing, and deterministic business rules.
The repository includes:
Python source code for classification, decision model integration, and routing.
40 synthetic pharmaceutical complaints with reference labels for testing.
Model benchmarks comparing classification accuracy and routing behavior across six decision models.
Sample images for testing photo-based complaint classification.
A lightweight web interface for running and exploring the demo locally.
You can experiment with different decision models, customize complaint categories, adjust confidence thresholds, and extend the routing logic to fit other business use cases.
The main application requires Python 3.10+, with no additional Python packages. An OpenRouter API key is needed for AI-powered classification.
Have a question or an idea? Leave a comment below! I'd love to hear how you're exploring AI in quality management.