Embedded time-series anomaly detection engine. Dual-runtime (Node.js + Browser). Zero-config startup — one line to production-grade anomaly detection with forecast-enhanced calibration.
npm install @agentix-e/anomaly-detector-coreimport { createDetector } from '@agentix-e/anomaly-detector-core'
const detector = createDetector()
for (const point of stream) {
const result = await detector.analyze(point, history)
if (result.jointConfidence > 0.95) {
// Your alert logic — library outputs confidence, you decide the threshold
fireAlert(result)
}
}- Streaming anomaly detection — RRCF via trcf-ts, < 1ms per point
- Multivariate attribution — leave-one-out Shapley decomposition
- Concept drift detection — ADWIN / KSWIN with adaptive thresholds
- 40+ forecasting models — ARIMA, ETS, Theta, TBATS, GARCH, VAR via anofox-forecast
- Three calibration modes — Forecast-Guided, Anomaly-Guided, Joint Confidence
- Framework-agnostic charts —
ChartDataoutput compatible with any visualization library - TimesFM (optional) — Google Research's foundation model for zero-shot forecasting
- State persistence — versioned serialization for hot-reload
The library outputs confidence — you decide. No hardcoded alert levels.
No opinionated notification pipelines. Just a jointConfidence number and
rich diagnostic data (attribution, drift, predictions, residuals).
anomaly-detector/
├── packages/
│ ├── anomaly-detector-core/ # Core analysis engine
│ │ ├── src/
│ │ │ ├── detect/ # TrcfDetector + Attribution + Drift
│ │ │ ├── forecast/ # AnofoxForecaster + AutoModelSelector
│ │ │ ├── calibrate/ # 3 calibration modes
│ │ │ ├── visualize/ # Framework-agnostic ChartData
│ │ │ ├── utils/ # classifyByLevels + suppressFlapping
│ │ │ ├── engine.ts # createDetector() factory
│ │ │ └── types.ts # All DI interfaces
│ │ └── test/
│ ├── anomaly-detector-node/ # TimesFM Node.js adapter
│ └── anomaly-detector-web/ # TimesFM Browser adapter
├── docs/
│ ├── ARCHITECTURE.md
│ └── index.html # GitHub Pages landing
└── .github/workflows/
├── _quality.yml # Reusable lint + typecheck + test
├── ci.yml # CI + GitHub Pages
└── release.yml # npm publish (OIDC)
| Resource | Link |
|---|---|
| Architecture | docs/ARCHITECTURE.md |
| Coverage Report | agentix-e.github.io/anomaly-detector/coverage/ |
| GitHub Pages | agentix-e.github.io/anomaly-detector/ |
pnpm install
pnpm -r lint # ESLint across all packages
pnpm -r typecheck # TypeScript type checking
pnpm -r test # Run all tests
pnpm -r test:coverage # Tests with coverage reportsMIT