Skopx Insights Engine: Detecting Revenue Anomalies Before Your Dashboard Can
Skopx Insights Engine: Detecting Revenue Anomalies Before Your Dashboard Can
Dashboards show you what happened. The Skopx Insights Engine tells you what is about to happen.
Traditional BI tools are reactive. You check a dashboard, notice a metric is down, investigate why, and respond. By the time you notice, the damage is done. The Insights Engine flips this: it continuously monitors your data and alerts you when something deviates from the expected pattern.
How Anomaly Detection Works
The Insights Engine uses a three-phase approach:
Phase 1: Metric Collection
Every time the engine runs (triggered manually or by a daily cron), it collects metrics from all connected sources:
- Database metrics: Row counts, aggregates (revenue, orders, users), table growth rates
- Integration metrics: Email volume, Slack activity, Jira ticket counts, GitHub PR velocity, calendar density
- Derived metrics: Week-over-week change rates, rolling averages, ratios
These metrics are stored as time-series snapshots in the metric_snapshots table.
Phase 2: Statistical Analysis
With historical data (minimum 2 data points, though 7+ days produces better results), the engine applies:
- Z-score anomaly detection: Each new metric is compared against its historical mean and standard deviation. A z-score above 2.0 (configurable, adaptive per user) triggers an anomaly alert.
- Linear regression trend detection: The engine fits a linear regression to the time series and reports trends with slope greater than 5% per period.
- Cross-source correlation: If email volume spikes at the same time as support tickets, the engine flags the correlation.
Phase 3: AI Analysis
For users with sufficient historical data, Claude Haiku analyzes the metrics in context:
- What does this anomaly mean for the business?
- Is it a seasonal pattern or a genuine deviation?
- What should the user investigate first?
This AI layer costs approximately $0.001 per analysis cycle, making it economical even for daily runs.
Adaptive Thresholds
The anomaly threshold is not static. It adapts based on user feedback:
- If a user dismisses an anomaly (false positive), the threshold tightens, requiring a larger deviation to trigger future alerts.
- If a user acknowledges an anomaly (true positive), the threshold stays or loosens slightly.
This is the "keep/discard" mechanism from autoresearch applied to detection thresholds.
The Daily Brief
The Insights Engine feeds into the Daily Brief, a newspaper-style summary that appears on the Insights Hub each morning. The brief uses Claude Haiku to synthesize all collected data into a narrative:
"You have 3 meetings today, 12 unread emails (2 flagged), and your Jira sprint is 60% complete with 2 days left. Email volume is up 40% compared to last week, which correlates with the product launch announcement."
What Is Next
We are working on:
- Predictive alerts: Instead of detecting anomalies after they happen, predict them 24-48 hours in advance based on leading indicators.
- Custom alert rules: Let users define their own thresholds and conditions (e.g., "alert me if daily revenue drops below $10K").
- Integration with Slack/Email: Push alerts to the user's preferred channel instead of requiring them to check the Insights Hub.
Skopx Team
The Skopx engineering and product team