AI Insights & Anomaly Detection
ProBeya's AI module provides statistical anomaly detection on KPI time series, trend forecasting, automated action suggestions, and AI-generated meeting summaries. These capabilities help operations teams catch deviations early, act on data-driven recommendations, and save time on administrative tasks.
Overview
Manufacturing and pharma operations generate vast amounts of KPI data daily. Without automated analysis, deviations go unnoticed until they become critical. ProBeya's AI features provide:
- Anomaly detection: Statistical analysis of KPI values to identify unusual deviations
- Trend forecasting: Time-series prediction showing where KPIs are heading
- Action suggestions: AI-generated recommendations based on anomaly patterns and historical resolution data
- Meeting summaries: Automatic generation of TIER meeting summaries with key decisions and action items
- Anomaly triage workflow: Full lifecycle from detection through acknowledgment to resolution or dismissal
Getting Started
Viewing Anomalies
- Navigate to any KPI board with historical data.
- Anomalies are automatically highlighted with markers on the chart.
- Click an anomaly marker to see details: severity, expected range, actual value.
- Acknowledge or investigate the anomaly from the detail panel.
Viewing Forecasts
- Open a KPI chart with sufficient historical data (minimum 30 data points).
- The forecast line extends beyond current data showing predicted values.
- Confidence intervals are displayed as a shaded band.
Board-Level Insights Dashboard
- Navigate to any board and open the AI Insights panel.
- The dashboard shows a summary across all KPIs on the board:
- Total anomalies detected (broken down by critical vs. warning)
- Number of improving, declining, and stable KPIs
- Per-KPI anomaly list and trend direction
How It Works
Anomaly Detection Algorithm
ProBeya uses pure statistical methods (z-score and moving average) rather than machine learning:
- Z-score detection: Computes a rolling mean and standard deviation over a configurable window (default: 7 periods). Flags values exceeding a configurable z-score threshold (default: 2.0 sigma).
- Moving average deviation: Calculates an exponentially weighted moving average and flags values deviating beyond a configurable threshold (default: 30%).
- Severity classification: Anomalies are classified based on the magnitude of deviation.
Configurable parameters per detection run:
| Parameter | Default | Range | Description |
|---|---|---|---|
windowSize | 7 | 2-90 | Rolling window for statistical calculations |
stdDevMultiplier | 2.0 | 0.5-5.0 | Z-score threshold for anomaly flagging |
deviationThreshold | 0.3 | 0.05-1.0 | Moving average deviation threshold |
This approach was chosen over ML models because:
- It requires no training data or model maintenance
- It is fully deterministic and auditable (critical for GxP environments)
- It performs well on the typical KPI patterns in manufacturing (trend + seasonality + noise)
- It runs in real-time without GPU infrastructure
See ADR-023: AI Anomaly Detection Algorithm for the full decision record.
Anomaly Severity Levels
| Severity | Criteria | Notification |
|---|---|---|
| Low | Minor deviation | No notification |
| Medium | Significant deviation (mapped from 0.3-0.5 deviation) | In-app notification to KPI owner |
| High | Large deviation (mapped from 0.5-1.0 deviation) | In-app notification to KPI owner |
| Critical | Extreme deviation (deviation >= 1.0) | In-app notification to KPI owner |
Anomaly Triage Workflow
Persisted anomalies follow a lifecycle:
new --> acknowledged --> dismissed (false positive)
\-> resolved (addressed)
| Status | Description |
|---|---|
| New | Just detected, awaiting operator review |
| Acknowledged | Operator has reviewed and is investigating |
| Dismissed | Operator determined it is a false positive or not actionable |
| Resolved | Root cause identified and corrective action taken |
Trend Prediction
The predictKpiTrend and getForecast procedures use simple linear regression to predict future values:
- Fits a line through historical data points using least-squares regression
- Computes slope, intercept, and confidence (R-squared)
- Generates predicted values for a configurable number of future periods (default: 7, max: 90)
- Classifies the trend direction as improving, declining, or stable
For KPIs where direction is lower_is_better, the trend direction is automatically inverted: a positive slope (values increasing) is classified as "declining" because higher values are worse.
Notification Integration
When runAnomalyDetection is called, anomalies with severity of medium or higher trigger in-app notifications. If the KPI definition has an ownerId set, that user receives a notification with:
- The KPI name and anomaly severity
- The observed vs. expected value
- The percentage deviation
- The date of the anomalous reading
Tenant Isolation
All AI computations are scoped to the requesting organization:
- KPI data is filtered by
organizationIdbefore any analysis - Anomaly records are stored with
organizationIdforeign key - The
verifyKpiOwnershiphelper ensures cross-tenant KPI access is impossible - Meeting summaries are generated from tenant-scoped meeting data
API Reference
| Procedure | Type | Description |
|---|---|---|
aiInsights.detectKpiAnomalies | Query | Run real-time anomaly detection on a KPI's time series |
aiInsights.predictKpiTrend | Query | Run linear regression trend prediction for a KPI |
aiInsights.getInsights | Query | Combined anomalies + trends for all KPIs on a board |
aiInsights.getAnomalies | Query | List persisted anomalies with optional status/severity filters |
aiInsights.getForecast | Query | Get trend prediction with predicted future values |
aiInsights.runAnomalyDetection | Mutation | Run detection, persist results, and trigger notifications |
aiInsights.acknowledgeAnomaly | Mutation | Mark an anomaly as acknowledged |
aiInsights.dismissAnomaly | Mutation | Mark an anomaly as dismissed (false positive) |
Permissions
| Action | Required Role |
|---|---|
| View anomalies and insights | Any board member |
| Run anomaly detection | Any board member |
| Acknowledge/dismiss anomalies | Any board member |
Related Features
- KPI Boards — Define and track KPIs with thresholds and targets
- Benchmarking — Compare KPIs across sites
- TIER Meeting — Daily standup routines with AI summary generation