Deviation triage for QA
Prepared for Jane Doe · Pharmaceutical manufacturing · December 3, 2026
Sample data for illustration.Targets
| Target | Area | Batch | Days open | Status |
|---|---|---|---|---|
| DEV-2026-0412 | Fill-Finish | B24-1187 | 1 | Active |
| DEV-2026-0415 | Granulation | B24-1192 | 1 | Active |
| DEV-2026-0418 | Packaging | B24-1175 | 2 | Active |
| DEV-2026-0409 | QC Lab | B24-1180 | 4 | Watching |
Target detail
Room 214 Grade B counts (7 days)
| Date | Location | CFU/plate | Limit | Result |
|---|---|---|---|---|
| Nov 20 | Room 214 floor | 7 | 5 | Excursion |
| Nov 19 | Room 214 floor | 3 | 5 | Pass |
| Nov 18 | Room 214 floor | 2 | 5 | Pass |
| Nov 17 | Room 214 floor | 1 | 5 | Pass |
| Nov 16 | Room 214 floor | 0 | 5 | Pass |
| Nov 15 | Room 214 floor | 1 | 5 | Pass |
| Nov 14 | Room 214 floor | 0 | 5 | Pass |
Deviation context
Alerts: what the system watches for
Edit alert
Configured alerts
Decision logic: alerts, conditions, plays and rules
Play: Classify each new deviation by risk
- Count above action limit
- Equipment alarm during batch
- Batch filled or released
- Same issue in last 12 months
- Open CAPA on same equipment
Rules
Policy gate
Live feed
Escalate (1)
Grade B count 7 CFU, batch filled, repeat issue; open CAPA
Close (1)
Label roll change logged late; no batch impact, no repeat
Investigate (2)
Granulator alarm mid-batch; no repeat; batch still in process
HPLC alarm during assay run; no repeat; day 4 of 30
Audit trail: one recommendation, start to finish
Data received
Play evaluated → rule fired
Decision
Outcome
Daily flags
ROI scoring and baseline
| Target | Decisions | Right tier first time (%) | Baseline | Best possible | Captured | Result vs baseline |
|---|---|---|---|---|---|---|
| Fill-Finish | 42 | 91 | 82 | 100 | 50% | +9 pts |
| Granulation | 36 | 88 | 81 | 100 | 37% | +7 pts |
| Packaging | 58 | 94 | 90 | 100 | 40% | +4 pts |
| QC Lab | 27 | 85 | 74 | 100 | 42% | +11 pts |
Baseline: Specialist's manual classification. Best possible: Tier confirmed after full review. Sample figures; in a live installation, these come from the organization’s own decisions and data.
AI Agent Decision Data
Reads each new deviation in the QMS and proposes a tier, Minor, Major or Critical, before QA triage.
When it acts: When a deviation is logged; QA confirms or changes the tier.
Agent feed: sample records
| Time | Target | Proposed tier | Model | Agent’s reason |
|---|---|---|---|---|
| 11/20 09:44 AM | DEV-2026-0412 | Major | v3.1 | Grade B excursion with a repeat in the last 12 months |
| 11/20 10:10 AM | DEV-2026-0415 | Minor | v3.1 | HPLC alarm during an assay run; no repeat |
| 11/19 03:30 PM | DEV-2026-0418 | Critical | v3.1 | Page missing from an executed batch record |
| 11/18 08:20 AM | DEV-2026-0409 | Major | v3.0 | Same label defect seen on the previous lot |
Policy breaches flagged
Checked against the policy gate the moment each output arrives.
Agent's tier against the final tier after QA review, last 90 days
| Agent | Minor | Major | Critical |
|---|---|---|---|
| Minor | 38 | 4 | 0 |
| Major | 3 | 17 | 1 |
| Critical | 0 | 2 | 3 |
Rows are the agent's tier, columns the final tier. The agent under-tiers more than it over-tiers: 4 deviations it called Minor were classed Major. Shaded cells are agreement.
Disagreements, graded on the outcome
| Target | Agent | Rules | Decision makers | What followed | Better call |
|---|---|---|---|---|---|
| DEV-2026-0409 | Major | Minor | Minor | Defect recurred on the next lot; reopened as Major | Agent |
| DEV-2026-0415 | Minor | Major | Major | Investigation found a failing detector; Major was right | Rules |
| DEV-2026-0418 | Critical | Major | Major | No product impact; Major confirmed | Decision makers |
Drift
| Period | Model | Agreement |
|---|---|---|
| Aug | v3.0 | 86% |
| Sep | v3.0 | 87% |
| Oct | v3.1new | 83% |
| Nov | v3.1 | 85% |
Agreement dropped after the v3.1 update, mostly from packaging deviations tiered too low. That is the kind of shift the drift view is there to catch.
Fit and next steps
What we’d check first
- A daily, repeated classification with structured QMS, batch and monitoring data and clear tiers
- Whether QMS data can be exported or read by API
- How the SOP defines minor, major and critical
- Validation and audit-trail needs for a regulated system
- Reading deviation narratives to suggest root causes and similar past cases
Next step: a formal proposal
For IT and data teams: an AI data pipeline
Stockurai is licensed to researchers and institutions for real-time analysis of equity markets, with AI and machine learning built into the process. The same AI data pipeline can be built for this decision.
- It runs entirely in the organization’s own AWS account, and all data stays there.
- Every recommendation is stored with the full data behind it: labeled records data teams can use to train and test models.
- Built with AI in mind, making maintenance and extension simple for a single technical resource.
Design prototype prepared by Stockurai · Sample data for illustration only · stockurai.com