|
1 | 1 | # Intelligence Pipeline |
2 | 2 |
|
3 | | -This document explains how SentraCore transforms raw system telemetry into actionable, explainable intelligence across its ten processing stages. |
| 3 | +This document explains how SentraCore transforms raw system telemetry into structured, explainable system intelligence through a multi-stage processing pipeline. |
| 4 | + |
| 5 | +Rather than relying on isolated system snapshots, SentraCore continuously analyzes behavior over time to detect anomalies, estimate degradation risk, and identify likely causes of system slowdowns. |
4 | 6 |
|
5 | 7 | --- |
6 | 8 |
|
7 | | -## Overview |
| 9 | +# Overview |
8 | 10 |
|
9 | | -Raw telemetry alone is insufficient for meaningful system monitoring. A CPU reading of 95% could be normal during a scheduled batch job, or it could indicate a runaway process. SentraCore resolves this ambiguity through a sequential intelligence pipeline that layers context, statistics, and forecasting on top of raw data. |
| 11 | +Raw telemetry alone rarely provides meaningful context. |
10 | 12 |
|
11 | | -``` |
| 13 | +For example: |
| 14 | +- High CPU usage may be expected during compilation or rendering workloads |
| 15 | +- Elevated memory usage may indicate either normal caching behavior or sustained resource pressure |
| 16 | +- Temporary disk spikes may be harmless, while prolonged saturation may degrade responsiveness |
| 17 | + |
| 18 | +SentraCore addresses this by processing telemetry through multiple intelligence layers that progressively add context, statistical interpretation, behavioral analysis, and forecasting. |
| 19 | + |
| 20 | +--- |
| 21 | + |
| 22 | +# Pipeline Flow |
| 23 | + |
| 24 | +```text |
12 | 25 | SystemCollector |
13 | | - → Normalizer (EMA smoothing, spike detection) |
14 | | - → TimeSeriesBuffer (ring buffers for historical context) |
15 | | - → BaselineModel (per-segment adaptive learning) |
16 | | - → TrendAnalyzer (linear regression, slope, volatility) |
17 | | - → AnomalyDetector (Z-score deviation from baseline) |
18 | | - → StressEngine (multi-state composite score) |
19 | | - → PredictionEngine (ETA forecasting, risk scoring) |
20 | | - → StabilityCalculator (global health index) |
21 | | - → CorrelationEngine (root cause analysis, triggered on alert) |
22 | | - → AlertManager (threshold evaluation, RCA attachment) |
| 26 | + → SignalNormalizer |
| 27 | + → TimeSeriesBuffer |
| 28 | + → BaselineModel |
| 29 | + → TrendAnalyzer |
| 30 | + → AnomalyDetector |
| 31 | + → StressEngine |
| 32 | + → PredictionEngine |
| 33 | + → StabilityCalculator |
| 34 | + → CorrelationEngine |
| 35 | + → AlertManager |
23 | 36 | ``` |
24 | 37 |
|
25 | 38 | --- |
26 | 39 |
|
27 | | -## Stage 1: System Collection |
| 40 | +# Stage 1 — System Collection |
28 | 41 |
|
29 | 42 | **Module:** `engine/collector/system_collector.py` |
30 | 43 |
|
31 | | -The `SystemCollector` samples system telemetry at a configurable interval (default: 2 seconds) using `psutil`. Each sample is a `SystemSnapshot` containing CPU percent, memory usage, disk I/O rates, and a UNIX timestamp. |
| 44 | +The `SystemCollector` gathers real-time system telemetry at a configurable interval using `psutil`. |
| 45 | + |
| 46 | +Collected metrics include: |
| 47 | +- CPU utilization |
| 48 | +- memory usage |
| 49 | +- disk activity |
| 50 | +- process statistics |
| 51 | +- system timestamps |
| 52 | + |
| 53 | +Each cycle produces a structured `SystemSnapshot` used throughout the pipeline. |
32 | 54 |
|
33 | 55 | --- |
34 | 56 |
|
35 | | -## Stage 2: Normalization |
| 57 | +# Stage 2 — Signal Normalization |
36 | 58 |
|
37 | 59 | **Module:** `engine/normalization/normalizer.py` |
38 | 60 |
|
39 | | -The `Normalizer` applies an **Exponential Moving Average (EMA)** to each metric, reducing the impact of instantaneous spikes on downstream analysis. It also independently detects spikes by comparing raw values against the rolling average. |
| 61 | +Raw system telemetry often contains short-lived spikes and noisy fluctuations. |
| 62 | + |
| 63 | +The `SignalNormalizer` applies smoothing techniques such as: |
| 64 | +- Exponential Moving Average (EMA) |
| 65 | +- rolling averages |
| 66 | +- spike filtering |
| 67 | + |
| 68 | +This improves downstream stability while still preserving meaningful trend changes. |
| 69 | + |
| 70 | +The normalization layer also detects sudden metric spikes separately from sustained behavior changes. |
40 | 71 |
|
41 | 72 | --- |
42 | 73 |
|
43 | | -## Stage 3: Time-Series Buffering |
| 74 | +# Stage 3 — Time-Series Buffering |
44 | 75 |
|
45 | 76 | **Module:** `engine/buffer/time_series_buffer.py` |
46 | 77 |
|
47 | | -Normalized snapshots are pushed into two ring buffers: |
48 | | -- **Short-window buffer:** Last ~60 seconds, used for trend analysis. |
49 | | -- **Long-window buffer:** Last ~30 minutes, used for baseline learning. |
| 78 | +Normalized snapshots are stored in rolling time-series buffers. |
| 79 | + |
| 80 | +SentraCore maintains: |
| 81 | +- short-term buffers for real-time analysis |
| 82 | +- long-term buffers for behavioral modeling |
| 83 | + |
| 84 | +These buffers provide historical context for: |
| 85 | +- trend analysis |
| 86 | +- baseline learning |
| 87 | +- anomaly detection |
| 88 | +- forecasting |
50 | 89 |
|
51 | 90 | --- |
52 | 91 |
|
53 | | -## Stage 4: Baseline Learning |
| 92 | +# Stage 4 — Baseline Learning |
54 | 93 |
|
55 | 94 | **Module:** `engine/baseline/baseline_model.py` |
56 | 95 |
|
57 | | -The `BaselineModel` learns what is *normal* for the specific machine. It segments the day into four time-of-day windows (Night, Morning, Afternoon, Evening) and maintains a running mean and standard deviation per metric per segment. Static thresholds are never used. |
| 96 | +The `BaselineModel` learns what is considered normal for the current machine. |
| 97 | + |
| 98 | +Instead of relying on static thresholds, SentraCore continuously adapts to: |
| 99 | +- workload patterns |
| 100 | +- hardware capabilities |
| 101 | +- time-of-day behavior |
| 102 | +- sustained usage characteristics |
| 103 | + |
| 104 | +The baseline model tracks: |
| 105 | +- average resource behavior |
| 106 | +- deviation ranges |
| 107 | +- historical variability |
| 108 | + |
| 109 | +This reduces false positives and improves anomaly accuracy. |
58 | 110 |
|
59 | 111 | --- |
60 | 112 |
|
61 | | -## Stage 5: Trend Analysis |
| 113 | +# Stage 5 — Trend Analysis |
62 | 114 |
|
63 | 115 | **Module:** `engine/intelligence/trend_analyzer.py` |
64 | 116 |
|
65 | | -The `TrendAnalyzer` performs **linear regression** over the short-window buffer to compute CPU and Memory slope (% change per second) and volatility (short-term standard deviation). A positive, sustained memory slope can indicate a memory leak. |
| 117 | +The `TrendAnalyzer` evaluates how system behavior changes over time. |
| 118 | + |
| 119 | +Analysis includes: |
| 120 | +- slope calculation |
| 121 | +- growth rate estimation |
| 122 | +- short-term volatility |
| 123 | +- sustained trend direction |
| 124 | + |
| 125 | +Examples: |
| 126 | +- continuously rising memory usage |
| 127 | +- sustained CPU growth |
| 128 | +- increasing disk saturation |
| 129 | + |
| 130 | +Trend analysis provides early indicators of degradation before hard limits are reached. |
66 | 131 |
|
67 | 132 | --- |
68 | 133 |
|
69 | | -## Stage 6: Anomaly Detection |
| 134 | +# Stage 6 — Anomaly Detection |
70 | 135 |
|
71 | 136 | **Module:** `engine/intelligence/anomaly_detector.py` |
72 | 137 |
|
73 | | -The `AnomalyDetector` calculates a Z-Score for each metric against the active time-of-day baseline: |
| 138 | +The `AnomalyDetector` compares current behavior against the learned baseline. |
74 | 139 |
|
75 | | -``` |
76 | | -Z = (Current Value - Baseline Mean) / Baseline Standard Deviation |
77 | | -``` |
| 140 | +Detection methods include: |
| 141 | +- Z-score deviation analysis |
| 142 | +- sustained abnormality detection |
| 143 | +- volatility analysis |
| 144 | +- multi-metric deviation scoring |
| 145 | + |
| 146 | +SentraCore avoids reacting to isolated spikes by requiring anomalies to persist across multiple cycles before escalation. |
78 | 147 |
|
79 | | -Anomalies must be sustained over multiple consecutive cycles before being classified as elevated or severe, preventing transient micro-spikes from generating false alerts. |
| 148 | +Anomalies are categorized into severity bands such as: |
| 149 | +- normal |
| 150 | +- elevated |
| 151 | +- high |
| 152 | +- severe |
80 | 153 |
|
81 | 154 | --- |
82 | 155 |
|
83 | | -## Stage 7: Multi-State Stress Engine |
| 156 | +# Stage 7 — Stress Engine |
84 | 157 |
|
85 | 158 | **Module:** `engine/stress/stress_engine.py` |
86 | 159 |
|
87 | | -The `StressEngine` consolidates upstream analysis into a single **Stress Score (0–100)** weighted across three dimensions: |
88 | | -1. Instantaneous resource pressure (CPU, Memory, Disk). |
89 | | -2. Trend modifiers (growing slopes add a forward-looking penalty). |
90 | | -3. Anomaly modifiers (sustained z-score deviations multiply the base pressure). |
| 160 | +The `StressEngine` consolidates multiple system signals into a unified stress representation. |
| 161 | + |
| 162 | +Inputs include: |
| 163 | +- instantaneous resource pressure |
| 164 | +- anomaly severity |
| 165 | +- trend acceleration |
| 166 | +- sustained instability |
| 167 | + |
| 168 | +The resulting stress score reflects both current pressure and ongoing degradation patterns. |
91 | 169 |
|
92 | 170 | --- |
93 | 171 |
|
94 | | -## Stage 8: Prediction & Risk Engine |
| 172 | +# Stage 8 — Prediction & Risk Analysis |
95 | 173 |
|
96 | 174 | **Module:** `engine/intelligence/prediction_engine.py` |
97 | 175 |
|
98 | | -The `PredictionEngine` uses EMA-smoothed trend slopes to forecast: |
99 | | -- **Time-to-Exhaustion (ETA):** Seconds until Memory hits 98% or CPU hits 95%. |
100 | | -- **Risk Score (0–100%):** Probabilistic assessment of severe degradation within the next 5 minutes. |
| 176 | +The `PredictionEngine` estimates future degradation risk using trend-based forecasting. |
| 177 | + |
| 178 | +Forecasting includes: |
| 179 | +- memory saturation estimation |
| 180 | +- CPU trend projection |
| 181 | +- disk pressure forecasting |
| 182 | +- time-to-exhaustion (ETA) |
| 183 | + |
| 184 | +The engine also produces a probabilistic degradation risk score representing the likelihood of severe instability within a future time window. |
| 185 | + |
| 186 | +Predictions are probabilistic rather than deterministic. |
101 | 187 |
|
102 | 188 | --- |
103 | 189 |
|
104 | | -## Stage 9: System Stability Index |
| 190 | +# Stage 9 — System Stability Calculation |
105 | 191 |
|
106 | 192 | **Module:** `engine/intelligence/stability_index.py` |
107 | 193 |
|
108 | | -The `StabilityCalculator` synthesises all upstream signals into a **System Stability Index (1–100)**. The index is a weighted composite of: |
109 | | -- **50%** Instantaneous Stress Score |
110 | | -- **30%** Predictive Risk Score |
111 | | -- **20%** Anomaly Score |
| 194 | +The `StabilityCalculator` generates the final System Stability Index. |
| 195 | + |
| 196 | +The index combines: |
| 197 | +- current stress state |
| 198 | +- predictive risk |
| 199 | +- anomaly severity |
| 200 | +- sustained trend behavior |
| 201 | + |
| 202 | +The resulting score provides a high-level representation of overall system responsiveness and health. |
112 | 203 |
|
113 | 204 | --- |
114 | 205 |
|
115 | | -## Stage 10: Correlation & Root Cause Analysis |
| 206 | +# Stage 10 — Correlation & Root Cause Analysis |
116 | 207 |
|
117 | 208 | **Module:** `engine/intelligence/correlation_engine.py` |
118 | 209 |
|
119 | | -Invoked lazily only when an alert fires, the `CorrelationEngine` cross-references three data sources: |
120 | | -1. **Bottleneck Identification:** Determines whether CPU, Memory, or Disk is the primary stressor. |
121 | | -2. **Suspect Identification:** Cross-references against the `ProcessTracker` to find the top-impact process. |
122 | | -3. **Trigger Identification:** Cross-references against the `EventLogger` to find the causal system event. |
| 210 | +The `CorrelationEngine` attempts to explain why degradation is occurring. |
| 211 | + |
| 212 | +When alerts are triggered, the engine correlates: |
| 213 | +- process activity |
| 214 | +- resource contention |
| 215 | +- event timing |
| 216 | +- system pressure changes |
| 217 | + |
| 218 | +The engine identifies: |
| 219 | +- likely bottlenecks |
| 220 | +- high-impact processes |
| 221 | +- correlated system events |
| 222 | + |
| 223 | +Outputs are probability-based explanations rather than absolute causality claims. |
| 224 | + |
| 225 | +--- |
| 226 | + |
| 227 | +# Alert Pipeline |
| 228 | + |
| 229 | +**Module:** `engine/alerts/alert_manager.py` |
| 230 | + |
| 231 | +The `AlertManager` evaluates: |
| 232 | +- sustained stress conditions |
| 233 | +- anomaly escalation |
| 234 | +- predictive risk thresholds |
| 235 | + |
| 236 | +When thresholds are exceeded: |
| 237 | +- alerts are generated |
| 238 | +- root cause summaries are attached |
| 239 | +- dashboard notifications are triggered |
| 240 | +- events are stored in alert history |
| 241 | + |
| 242 | +--- |
| 243 | + |
| 244 | +# Design Principles |
| 245 | + |
| 246 | +The intelligence pipeline is designed around several core principles: |
| 247 | + |
| 248 | +1. Time-Based Understanding |
| 249 | + System behavior is analyzed over time rather than through isolated snapshots. |
| 250 | + |
| 251 | +2. Adaptive Modeling |
| 252 | + Behavior is evaluated relative to machine-specific baselines. |
| 253 | + |
| 254 | +3. Statistical Interpretation |
| 255 | + Signals are interpreted probabilistically rather than through fixed assumptions. |
| 256 | + |
| 257 | +4. Explainability |
| 258 | + Outputs prioritize understandable diagnostics instead of opaque scoring. |
| 259 | + |
| 260 | +5. Predictive Awareness |
| 261 | + The system estimates future degradation risk before severe instability occurs. |
| 262 | + |
| 263 | +--- |
| 264 | + |
| 265 | +# Summary |
| 266 | + |
| 267 | +SentraCore transforms low-level telemetry into layered behavioral intelligence through: |
| 268 | + |
| 269 | +- normalization |
| 270 | +- historical modeling |
| 271 | +- anomaly detection |
| 272 | +- trend analysis |
| 273 | +- forecasting |
| 274 | +- correlation analysis |
| 275 | +- explainable diagnostics |
123 | 276 |
|
124 | | -The resulting `RootCauseAnalysis` is attached to the `Alert` and broadcast via WebSocket to the dashboard. |
| 277 | +This enables a deeper understanding of system behavior than traditional real-time monitoring alone. |
0 commit comments