Design prototype · Built on Stockurai

Deviation triage for QA

Prepared for Jane Doe · Pharmaceutical manufacturing · December 3, 2026

Sample data for illustration.
DecisionHow to handle each new deviation: close, investigate or escalate
OptionsEscalate · Investigate · Close
Data sourcesQMS, Batch record system export, Equipment and EM data
PolicyCritical needs Head of QA; investigations per 21 CFR 211.192, 30-day SOP target
Does this design prototype fit your needs? Complete the form to receive a formal proposal. Or answer a few questions to create a custom design prototype.
STEP 01

Targets

Targets are what the system watches. Here, they are the deviations logged in the QMS, each with its area, batch and how many days it has been open.
TargetAreaBatchDays openStatus
DEV-2026-0412Fill-FinishB24-11871Active
DEV-2026-0415GranulationB24-11921Active
DEV-2026-0418PackagingB24-11752Active
DEV-2026-0409QC LabB24-11804Watching
STEP 02

Target detail

Where the feeds meet: the QMS (the deviation, prior investigations and CAPAs), batch records (what was made and where it is) and monitoring (equipment and environmental readings). Every signal is weighed against all three.

Room 214 Grade B counts (7 days)

DateLocationCFU/plateLimitResult
Nov 20Room 214 floor75Excursion
Nov 19Room 214 floor35Pass
Nov 18Room 214 floor25Pass
Nov 17Room 214 floor15Pass
Nov 16Room 214 floor05Pass
Nov 15Room 214 floor15Pass
Nov 14Room 214 floor05Pass

Deviation context

BatchB24-1187 · filled Nov 19, in quarantine
Prior history2 similar deviations in 12 months
Open CAPACAPA-2026-031 on filler RABS
Investigation dueDec 20, 2026 (day 30)
Feeds
QMSDeviations, CAPAs and prior investigation history · Every 15 minutes
BatchesBatch status, steps run and release holds · Daily
MonitoringEquipment alarms and environmental counts · Hourly
STEP 03

Alerts: what the system watches for

Alerts are code-free. Pick a field, an operator and a value. Each alert watches one thing, such as a count over its action limit or a repeat of an earlier deviation, and fires when it happens.

Edit alert

Grade B count above action limit
CFU per plate
Above
Action limit (5 CFU per plate)
1 Day
PreviewCFU per plate above action limit

Configured alerts

Count above action limitMonitoring
Equipment alarm during batchMonitoring
Batch filled or releasedBatches
Same issue in last 12 monthsQMS
Open CAPA on same equipmentQMS
Investigation past day 25 of 30QMS
STEP 04

Decision logic: alerts, conditions, plays and rules

Alerts evaluate data in real time. Conditions add triggered alerts up to a score, and plays organize the conditions. Rules turn a play’s score into a real-time recommendation on the live feed. The policy gate stops any recommendation the procedures don't allow: critical classifications wait for the head of QA, and every investigation carries its 30-day clock. Rules drive the recommendations, not AI.

Play: Classify each new deviation by risk

+15Product quality at risk
  • Count above action limit
  • Equipment alarm during batch
+10Batch already filled
  • Batch filled or released
+10Repeat issue
  • Same issue in last 12 months
  • Open CAPA on same equipment

Rules

Score ≥ 30ESCALATE
Score 15–29INVESTIGATE
Score < 15CLOSE

Policy gate

Critical classHead of QA approves
InvestigationPer 21 CFR 211.192
Close within30 days unless extended
ExtensionQA manager sign-off
STEP 05

Live feed

This is the screen the decision team watches. Each card is a proposed classification for one deviation, printed the moment its rule is met, with the score and time it fired.

Escalate (1)

DEV-2026-0412  Score 35 · Major + CAPA
Grade B count 7 CFU, batch filled, repeat issue; open CAPA
11/20 09:46 AM

Close (1)

DEV-2026-0418  Score 0 · Minor
Label roll change logged late; no batch impact, no repeat
11/20 11:02 AM

Investigate (2)

DEV-2026-0415  Score 15 · Full investigation
Granulator alarm mid-batch; no repeat; batch still in process
11/20 10:12 AM
DEV-2026-0409  Score 15 · Full investigation
HPLC alarm during assay run; no repeat; day 4 of 30
11/20 08:15 AM
STEP 06

Audit trail: one recommendation, start to finish

Every recommendation is logged and traceable. Anyone can see which records and readings arrived, which conditions were met, who approved the classification and how it compared with a manual classification.
DEV-2026-0412 — Audit trail

Data received

QMS feedDEV-2026-0412 logged 2026-11-20 08:30; 2 similar in 12 months
Monitoring feedRoom 214 floor plate 7 CFU, action limit 5
Batches feedB24-1187 filled Nov 19, in quarantine

Play evaluated → rule fired

✓ Product quality at risk (+15)
✓ Batch already filled (+10)
✓ Repeat issue (+10)
Score35 → ESCALATE
Policy gatePassed: major class, 30-day clock set

Decision

ActionEscalated as major, CAPA opened
Approved byHead of QA, 10:12

Outcome

Similar past case, manual classificationMinor, reopened as major on day 9
ResultRight tier on day 1, not day 9
STEP 07

Daily flags

A short daily list of things worth a look, separate from the live feed. Investigations nearing day 30, adverse trends in monitoring data, clusters of similar deviations and batches held up by open deviations.
QMS3 investigations past day 25 of 30
Extension or closure needed before day 30
MonitoringRoom 214 counts up 3 days running
Floor plates 2, 3, then 7 CFU; action limit is 5
QMS4 Fill-Finish deviations in 30 days
Usual rate is 1 a month; repeat condition armed
BatchesB24-1187 awaiting release review
Open deviation blocks batch disposition
STEP 08

ROI scoring and baseline

The optimization engine scores every decision. Every classification is measured against the specialist's manual classification, and against the tier confirmed after full review, closure and any repeat. The gap is the ROI you can measure.
TargetDecisionsRight tier first time (%)BaselineBest possibleCapturedResult vs baseline
Fill-Finish42918210050%+9 pts
Granulation36888110037%+7 pts
Packaging58949010040%+4 pts
QC Lab27857410042%+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.

STEP 09

Fit and next steps

What we’d check first

Why
  • A daily, repeated classification with structured QMS, batch and monitoring data and clear tiers
To verify
  • 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
Extend with AI
  • Reading deviation narratives to suggest root causes and similar past cases

Next step: a formal proposal

ScopeThe decision, targets and data feeds
RulesRules and policy gate, written out
ROIHow ROI is measured against the current process
TermsSetup estimate, timeline and license terms
Where it runsThe organization’s own AWS account
Request a formal proposal Create a custom decision design prototype

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.

Deploying AI agents for decisions like this?

Stockurai runs in shadow alongside the agent, on the same data feeds and business rules. Every recommendation is checked against the rules and policy as it arrives, then scored against what actually happened.

See the AI agent prototype for this decision

Design prototype prepared by Stockurai · Sample data for illustration only · stockurai.com