Saltar al contenido principal

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​

  1. Navigate to any KPI board with historical data.
  2. Anomalies are automatically highlighted with markers on the chart.
  3. Click an anomaly marker to see details: severity, expected range, actual value.
  4. Acknowledge or investigate the anomaly from the detail panel.

Viewing Forecasts​

  1. Open a KPI chart with sufficient historical data (minimum 30 data points).
  2. The forecast line extends beyond current data showing predicted values.
  3. Confidence intervals are displayed as a shaded band.

Board-Level Insights Dashboard​

  1. Navigate to any board and open the AI Insights panel.
  2. 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:

ParameterDefaultRangeDescription
windowSize72-90Rolling window for statistical calculations
stdDevMultiplier2.00.5-5.0Z-score threshold for anomaly flagging
deviationThreshold0.30.05-1.0Moving 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​

SeverityCriteriaNotification
LowMinor deviationNo notification
MediumSignificant deviation (mapped from 0.3-0.5 deviation)In-app notification to KPI owner
HighLarge deviation (mapped from 0.5-1.0 deviation)In-app notification to KPI owner
CriticalExtreme 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)
StatusDescription
NewJust detected, awaiting operator review
AcknowledgedOperator has reviewed and is investigating
DismissedOperator determined it is a false positive or not actionable
ResolvedRoot 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 organizationId before any analysis
  • Anomaly records are stored with organizationId foreign key
  • The verifyKpiOwnership helper ensures cross-tenant KPI access is impossible
  • Meeting summaries are generated from tenant-scoped meeting data

API Reference​

ProcedureTypeDescription
aiInsights.detectKpiAnomaliesQueryRun real-time anomaly detection on a KPI's time series
aiInsights.predictKpiTrendQueryRun linear regression trend prediction for a KPI
aiInsights.getInsightsQueryCombined anomalies + trends for all KPIs on a board
aiInsights.getAnomaliesQueryList persisted anomalies with optional status/severity filters
aiInsights.getForecastQueryGet trend prediction with predicted future values
aiInsights.runAnomalyDetectionMutationRun detection, persist results, and trigger notifications
aiInsights.acknowledgeAnomalyMutationMark an anomaly as acknowledged
aiInsights.dismissAnomalyMutationMark an anomaly as dismissed (false positive)

Permissions​

ActionRequired Role
View anomalies and insightsAny board member
Run anomaly detectionAny board member
Acknowledge/dismiss anomaliesAny board member
  • KPI Boards — Define and track KPIs with thresholds and targets
  • Benchmarking — Compare KPIs across sites
  • TIER Meeting — Daily standup routines with AI summary generation