FOOD MANUFACTURING INTELLIGENCE  ·  QUABOOK.COM/AI
AI Intelligence Layer
Technical Capabilities Brief
MAY 2026  ·  VERSION 2.0  ·  QUABOOK.COM/AI
8 AI Capabilities
Across QC, Maintenance, Traceability & Chat
90-Day Trial
Auto-starts on first AI call · No setup
Claude Sonnet 4.6
Anthropic · Streaming · Audit-logged
◆ 01  — OVERVIEW

Your factory has a nervous system now.

QuaBook AI is a reasoning layer woven directly into QC, CAPA, traceability, maintenance, and operations. It reads your live plant data, applies structured models, and produces auditable, human-review-required outputs — no hallucinated advice, no black boxes.

What it is
Context-aware plant intelligence
AI that knows your machines, your products, your open CAPAs, and your SPC state — not generic food safety advice.
How it works
Structured prompts + live data
Every AI call bundles 30–90 days of relevant plant data into a precise prompt. Outputs stream token-by-token. No waiting for a 3,000-token document.
What it needs
An Anthropic API key or trial
BYOK for production use. Platform-managed 90-day trial auto-starts on first call. No infrastructure to configure.
◆   ARCHITECTURE   ◆
API Key Resolution Stack
1
Tenant BYOK key
Always works · no expiry · your billing
2
Platform trial
90 days from first AI call · QuaBook billing
3
null
HTTP 402 TRIAL_EXPIRED

◆ TWO MODELS, RIGHT-SIZED PER TASK

claude-sonnet-4-6
Deep reasoning tasks
RCA with 5-Whys · Recall packages · Intelligence briefs · Fleet analysis · Factory Chat
claude-haiku-4-5
Fast response tasks
Summaries · Scoring · Quick alerts · Threshold evaluations

◆ 02  — ROOT CAUSE ANALYSIS
AI Root Cause Analysis
WHERE: CAPA Module → Open CAPA → "Generate RCA with AI"
Input Context — CAPA-2026-0047
capa CAPA-2026-0047 · Priority: HIGH · Type: CORRECTIVE
variable Net Weight · Spec: 498–510g · Failing value: 493g
machine PKG-002 · Product: Roasted Cashews 500g
spc_state CRITICAL · Slope: −0.8g/check · Breach in: 2 checks
history 3 similar deviations in last 90 days (PKG-002)
AI Output
claude-sonnet-4-6 · streamed · ~1,840 tokens
HIGH PRIORITY
◆ Root Cause Analysis — 5 Whys

1. Net weight on PKG-002 is drifting below spec (493g vs 498g minimum).

2. Because the weighing head calibration offset has drifted — consistent with the −0.8g/check slope observed over the last 6 readings.

3. Because calibration was last verified 47 days ago, exceeding the 30-day PM schedule. The last 3 deviations in 90 days occurred at 35, 42, and now 47 days post-calibration.

4. Because the PM reminder for PKG-002 weigher calibration was not escalated when overdue by >7 days.

5. Because there is no automated work order creation when a scheduled PM is overdue — only a passive alert.

◆ Corrective Action
  1. Immediately halt production on PKG-002. Place under "Calibration Hold" status.
  2. Perform full weigher calibration using NIST-traceable weights. Target: within 2 hours.
  3. Re-inspect last 2 production batches (LOT-2026-0411, LOT-2026-0412) — 100% weight check on retained samples.
  4. If re-check fails spec, initiate disposition process. Document outcome in this CAPA.
◆ Preventive Action

Configure a maintenance work order auto-trigger rule: if weigher calibration PM is overdue by >5 days, auto-create Critical MWO and notify Line Supervisor and QC Manager. Review PM schedule across all packaging lines for same gap.

◆ Suggested Investigation Method

Pull the last 10 weigher calibration records for PKG-002. Plot actual vs target weight over time. Correlate calibration dates with deviation dates. If pattern holds (>30 days → drift), reduce calibration interval to 21 days and reassess in 60 days.

Technical Details

Data sources: CAPA metadata, all QCValues for the failing variable (last 90 days), SPC analysis (OLS slope + state), machine maintenance history, 90-day deviation frequency. SPC context is injected as structured JSON — model sees slope, direction, breach estimate, and historical baseline. Output requires human review and sign-off before CAPA can be closed.


◆ 03  — RECALL PACKAGE
AI Recall Package Generator
WHERE: Traceability → Lots → Select Lot → "Generate Recall Package"
Input Lot
lot_id LOT-RM-2026-0412 · Roasted Cashews · Raw Material
supplier Al-Nasser Foods · Saudi Arabia · COA verified
received Mar 4, 2026 · 6,000 kg · Warehouse Bay C-3
trace_fwd 14 production lots · 3 distribution channels · ~4,200 kg at risk
AI Output
claude-sonnet-4-6 · ~3,100 tokens
RECALL PACKAGE
◆ Executive Summary

Raw material lot LOT-RM-2026-0412 (Roasted Cashews, 6,000 kg, received Mar 4 from Al-Nasser Foods) has been implicated in 14 downstream production lots across 3 distribution channels. Estimated 4,200 kg of finished product is at risk. This package initiates Class II voluntary recall procedures per SFDA and FSMA 204 requirements.

◆ Scope & Affected Lots

Production lots: FG-2026-0441 through FG-2026-0454 (inclusive). Finished product: Roasted Cashews 500g (SKU RCK-500), Mixed Nuts 250g (SKU MXN-250). Distribution: Retail Channel A (6 customers), Retail Channel B (3 customers), Export — UAE (1 customer). Lot status: 9 fully distributed, 3 in transit, 2 in finished goods warehouse (immediate hold recommended).

◆ Customer Notification Template

Subject: Voluntary Product Recall Notice — {{CUSTOMER_NAME}}
Dear {{CONTACT_NAME}},
We are initiating a voluntary recall of {{PRODUCT_NAME}} (Lot: {{LOT_NUMBERS}}, Qty: {{QUANTITY_KG}} kg) received on {{DELIVERY_DATE}}. Please quarantine stock immediately and contact {{QC_MANAGER_EMAIL}} within 24 hours. Return instructions follow…

◆ Regulatory Actions — SFDA / FSMA 204

SFDA notification required within 48 hours (Class II). FSMA 204 traceability records: KDE documentation complete for receiving (CTE-1) through shipping (CTE-4). Key Data Elements available for all 14 production lots. Electronic records export available from Traceability module.

◆ Containment Timeline

T+0: Place 2 warehouse lots on immediate hold. T+4h: Notify all 10 distribution customers. T+24h: SFDA notification filed. T+48h: Confirm all in-transit lots located and quarantined. T+7d: Disposition report filed.

Technical Details

Uses traceForward() engine for full BOM/lot chain traversal — follows ingredient lots through all production steps, blends, and sub-assemblies. Merges supplier data, QC inspection results, and distribution records. FSMA 204 KDE mapping is pre-configured per product category. Full audit trail attached to generated document.


◆ 04  — SUPPLIER INTELLIGENCE
Supplier Intelligence Brief
WHERE: Suppliers → Supplier Profile → "Generate Intelligence Brief"
Supplier Profile — Al-Nasser Foods
country Saudi Arabia · Medium-risk jurisdiction
risk_level MEDIUM · Last qualification: Nov 2025
inspections 47 total · Pass rate 91.4% · 2 open SCARs
data_sources Inspections · SCARs · Qualifications · Fraud assessments · Rejected lots
AI Output
claude-sonnet-4-6 · ~2,200 tokens
MEDIUM RISK
◆ Executive Summary

Al-Nasser Foods is an approved raw cashew and mixed nut supplier with a generally acceptable 90-day performance record. However, a declining pass rate trend (97% → 91.4% over 6 months) and 2 open SCARs — both related to moisture control — warrant escalated monitoring. Country-level food fraud risk (nut adulteration) is categorized as moderate per SSAFE/EMA assessment.

◆ Risk Assessment

Country risk: Saudi Arabia — moderate. Category risk: Tree nuts — elevated (adulteration, mycotoxin). Fraud risk flags: 2 lots in past 18 months required aflatoxin re-testing; both passed. SCAR-1: Moisture OOS on raw cashews (open 34 days, no CAPA response received). SCAR-2: Labelling non-conformance (closed, 11 days).

◆ Performance Analytics

Pass rate: 91.4% (last 90 days) vs 97.0% (prior 90 days). Trend: declining. Rejected lots: 4 (moisture: 3, foreign matter: 1). On-time delivery: 94%. Average lead time: 18 days. Critical finding: 3 of last 5 moisture failures occurred on the same SKU (Roasted Cashews, natural humidity pack).

◆ Recommended Actions
  1. Escalate SCAR-1 — 34 days without supplier response exceeds the 14-day SLA. Initiate formal supplier escalation.
  2. Increase incoming inspection frequency to 100% for Roasted Cashews SKU until SCAR-1 is resolved.
  3. Request updated moisture control documentation and equipment calibration records.
  4. Schedule virtual audit within 60 days if pass rate does not recover to >95%.
Technical Details — 5 Data Sources Merged

Inspection results (pass/fail/partial, variable-level data) · SCAR records with aging and response status · Qualification documents and expiry dates · Food fraud vulnerability assessments · Rejected lot history with root cause codes. Quick summary variant: <200 words for QC managers to act fast without reading the full brief.


◆ 05  — PREDICTIVE MAINTENANCE
AI Fleet Intelligence Brief
WHERE: Maintenance → "AI Fleet Analysis"
Fleet Snapshot — May 7, 2026
fleet 12 machines total · 3 critical alerts · 2 overdue PM
Mixer-01 CRITICAL — 8 unplanned stops / 30d · Downtime: 14h
PKG-003 WARNING — bearing temp rising +2°C/week · 5 stops/30d
Oven-02 STABLE — PM compliance 100% · 0 unplanned stops
AI Output
claude-sonnet-4-6 · ~2,600 tokens
FLEET BRIEF
◆ Machine Health Overview

3 of 12 machines require immediate attention. Mixer-01 is the highest priority — 8 unplanned stops in 30 days with 14 cumulative downtime hours represents a significant reliability failure. PKG-003 thermal trend is a predictive concern requiring intervention before failure. Remaining 10 machines are operating within acceptable parameters.

◆ Predictive Alerts

Mixer-01: Based on stop frequency trend (2 stops/week → 4 stops/week), projected total failure probability within 10–14 days: HIGH. Recommend immediate inspection of drive belt and motor bearings. Estimated repair window: 4–6 hours.

PKG-003: Bearing temperature rising at +2°C/week. At current rate, will exceed 85°C (critical threshold) in 3–4 weeks. Recommend bearing replacement during next scheduled PM slot. If temperature exceeds 78°C before then, treat as emergency.

◆ PM Compliance Report

Fleet PM compliance: 83% (10/12 machines on schedule). Overdue: Mixer-01 belt tensioner (9 days overdue), PKG-003 blade inspection (7 days overdue). 2 PM tasks scheduled this week — confirm technician availability.

◆ Priority Action List
  1. Create Critical MWO for Mixer-01 — belt and bearing inspection. Assign to Senior Technician. Due: today.
  2. Create High-priority MWO for PKG-003 — bearing replacement. Target: within 7 days.
  3. Clear overdue PM tasks for both machines. Block production on Mixer-01 until MWO is closed.
  4. Reduce Mixer-01 PM interval from 30 to 21 days for next 3 cycles.
Trigger Rules & Automation

Configurable thresholds fire the analysis automatically: unplanned_stops > 5/30d, downtime_hours > 8/30d, pm_overdue_days > 7. When a rule fires, the fleet brief is generated and a maintenance work order is auto-created with the recommended action pre-populated. Human approval required before work order is dispatched.


◆ 06  — STATISTICAL PROCESS CONTROL
SPC Trend Engine
WHERE: Embedded in RCA, QC Dashboard, Deviation Alerts

OLS linear regression on the last 4–8 readings, projecting the value N checks ahead and flagging the breach window. This context is injected directly into every RCA and deviation alert prompt — the AI sees your trend before it reasons about your problem.

Example: Moisture % — Spec max 4.0% — CRITICAL
Check 1
3.2%
STABLE
Check 2
3.4%
STABLE
Check 3
3.7%
WARNING
Check 4
4.0%
AT LIMIT
Check 5 ▶
4.27%
BREACH
Slope: +0.27%/check  ·  Direction: RISING  ·  State: CRITICAL  ·  Projected breach: Check 5 (next inspection)
INSUFFICIENT_DATA
Fewer than 4 readings
No regression run. Awaiting sufficient data points. Displayed as neutral state.
WARNING
Slope heading toward limit
Projected breach in 3–5 checks. Alert sent. Operator prompted to investigate at next check.
CRITICAL
Breach within 1–2 checks
CAPA auto-suggested. SPC state injected into AI prompt as high-priority context. Supervisor notified.

◆ 07  — FACTORY CHAT
Factory Chat · Ask Your Plant
WHERE: Sidebar → Factory Chat

Multi-turn conversation with full plant context — active work orders, open CAPAs, recent rejections, overdue maintenance, SPC alerts. Every answer is grounded in your live data, not generic food safety knowledge.

Factory Chat — Line A Quality Review
session_2026_0507_line-a
A
Ahmad Al-Farsi · QC Manager · 09:14
What's our biggest QC problem this week?
Q
QuaBook AI · claude-sonnet-4-6 · 09:14
Your top issue is moisture drift on Line A — 3 deviations since Monday, all on the same variable (spec 2.5–4.0%, product: Roasted Cashews 500g). CAPA-2026-0047 is open and assigned to you. The SPC trend is CRITICAL with a projected breach in 1–2 checks at the current +0.27%/check slope.

Recommend pausing WO-2026-147 for calibration review. The last calibration on the Line A humidity sensor was 51 days ago (PM schedule: 30 days).
A
Ahmad Al-Farsi · 09:16
Are there any overdue maintenance items?
Q
QuaBook AI · claude-sonnet-4-6 · 09:16
Yes — 2 items overdue:

1. Mixer-01 belt tensioner PM — was due Apr 28, now 9 days overdue. No MWO has been created. Last maintenance was by Technician Khalid (Dec 2025).
2. PKG-003 blade inspection — was due Apr 30, 7 days overdue. Both have passive alerts but no escalation has fired.

Want me to draft the work order details for both so you can create them?
Technical Architecture

Sessions stored in FactoryChatSession table, messages as JSON array. Auto-title generated from first user message. Up to 50 sessions per user, configurable. Each message includes the full plant context snapshot at time of query — work orders, CAPAs, SPC states, maintenance alerts. Context window managed to stay within model limits.


◆ 08  — QC THRESHOLD RULES
Adaptive QC Alert Rules
WHERE: Settings → AI & Intelligence → QC Thresholds

Configurable rule engine: 5 metrics, 5 operators, 4 scopes, 3 severities. Rules fire in real time and push alerts to dashboard, email, and WhatsApp. Rules are created by QC Managers without code.

Rule Name Metric Condition Scope Severity Action
Weight Drift spec_failure > 15% in 10 inspections Machine: PKG-002 CRITICAL Alert + auto-CAPA
Moisture Trend deviation_rate > 3 in 5 days Product: Cashews 500g WARNING Alert + notify QC Mgr
Lab Failure Spike rejection_rate > 20% in 24h Global CRITICAL Alert + escalate
PM Overdue pm_overdue_days > 7 days Machine: All WARNING Auto-create MWO
Supplier Pass Rate supplier_pass_rate < 85% in 30 days Supplier: All WARNING Alert + SCAR prompt
5 Metrics
spec_failure_rate
deviation_rate
rejection_rate
pm_overdue_days
supplier_pass_rate
4 Scopes
Global · Per Machine
Per Product · Per Supplier
Alert Channels
In-app Dashboard
Email · WhatsApp · SMS
◆ 09  — TRIAL & BYOK MODEL

No AI setup required to start.

The 90-day trial auto-starts on your first AI call. Bring your own Anthropic API key any time to continue without expiry — and keep your billing separate.

TRIAL
90 days · auto-starts
BYOK
Settings → AI & Intelligence
AUDIT
Every call logged · token count
EXPIRED
HTTP 402 TRIAL_EXPIRED
API Key Resolution — Full Stack
1
Tenant BYOK key
Always works · no expiry · billed to your Anthropic account
2
Platform trial key
90 days from first AI call · QuaBook billing · no configuration
3
null → HTTP 402
TRIAL_EXPIRED · UI prompts BYOK setup
Audit Logging
Every AI call recorded
Who triggered it · which CAPA / lot / supplier / machine · model used · token count · timestamp · output reference ID
BYOK Setup
Settings → AI & Intelligence → API Key
Encrypted at rest · never exposed in logs · team-level scope · can be rotated without service disruption
◆ 10  — COMPLIANCE & AUDIT

Advisory outputs. Human decisions.

Every AI-generated document is traceable, attributed, and requires human sign-off before it affects any record. QuaBook AI is designed to meet HACCP, FSMA 204, BRC, SQF, and ISO 22000 audit expectations.

Timestamped & Attributed
Every output records generating user, timestamp, AI model version, token count, and source record ID (CAPA, lot, supplier, machine).
Audit Trail
Written to the AuditLog table immediately. Immutable. Accessible from the Audit module with full filter and export capability.
Human Review Required
AI outputs are marked "AI-assisted — Pending Review." No CAPA, recall package, or work order is created or closed without explicit human sign-off.
COMPLIANCE POSTURE
◆ AI Governance Statement

AI outputs are advisory. Operators, QC managers, and supervisors retain full authority over all quality, safety, and regulatory decisions. QuaBook AI surfaces patterns, drafts documents, and projects trends — it does not make or execute decisions autonomously.

All generated documents are clearly labeled as AI-assisted in the UI and in exported PDFs. The generating user's identity and the AI model version are attached to every document for auditor review.

◆ Standards Alignment

Designed to support documentary requirements under: HACCP (hazard analysis records), FSMA 204 (traceability records, KDE mapping), BRC Global Standard (CAPA documentation), SQF Code (supplier management records), ISO 22000 (food safety management system documentation).

HACCP FSMA 204 BRC SQF ISO 22000 AI-ASSISTED · HUMAN APPROVED