Sign inSign up

thngbk/driftmind-edge

By thngbk

Updated 16 days ago

Lightweight time-series forecasting and anomaly detection engine for real-time environments

Image
Internet of things
Machine learning & AI
Developer tools
0

490

thngbk/driftmind-edge repository overview

DriftMind Edge

Real-time time-series intelligence — forecasting, anomaly detection, and pattern matching — running entirely on your machine.

DriftMind is a self-adaptive engine for multivariate time-series data. It learns continuously from the first data point, detects anomalies automatically, and recognises known failure signatures in real time. No training, no GPU, no retraining cycles.

As of v1.1, the edge runtime ships three complementary capabilities in a single ~70 MB native binary:

CapabilityWhat it answersOutput
ForecastingWhat comes next?One-step-ahead prediction + confidence bounds per feature
Anomaly detectionIs this unusual given what I've learned?Continuous anomaly score [0, 1]
Echo — pattern matchingDoes this match a known failure signature?Per-pattern match score + severity (WARN / MAJOR / CRITICAL)

Two images available

ImageDescriptionSize
thngbk/driftmind-edgeNative binary only — HTTP server ready~70 MB
thngbk/driftmind-edge-labBinary + Jupyter Lab with validation notebooks~500 MB

Both images now run as a non-root user and include latest Ubuntu security patches applied at build time.


Quick start

Minimal image
docker run -p 8080:8080 thngbk/driftmind-edge:latest

The API is immediately available at http://localhost:8080. Open the root URL in a browser for an auto-generated documentation page covering architecture, endpoints, and examples.

docker run -p 8080:8080 -p 8888:8888 thngbk/driftmind-edge-lab:latest
  • http://localhost:8080 — REST API + self-hosted docs
  • http://localhost:8888 — Jupyter Lab with pre-loaded notebooks, including echo_validation.ipynb — four realistic scenarios (Industrial IoT, Telecom RAN) that walk through pattern detection end-to-end

API

The edge engine exposes the same API as the DriftMind Cloud service. All endpoints, request formats, and response formats are identical across every deployment tier.

Forecasters
MethodEndpointDescription
POST/forecastersCreate a new forecaster
GET/forecastersList all forecasters
GET/forecasters/{id}Get forecaster details
DELETE/forecasters/{id}Delete a forecaster
POST/forecasters/{id}/observationsFeed time-series data
GET/forecasters/{id}/predictionsForecast + anomaly score + Echo matches
GET/forecasters/{id}/recentGet recent observations
Patterns (Echo)
MethodEndpointDescription
POST/patternsCreate a reference pattern
GET/patternsList all patterns
GET/patterns/{id}Get pattern details with signal data
DELETE/patterns/{id}Delete a pattern
Attachments (Echo)
MethodEndpointDescription
GET/attachmentsList every attachment across all forecasters
POST/forecasters/{id}/attachmentsAttach a pattern with severity
GET/forecasters/{id}/attachmentsList patterns attached to a forecaster
PUT/forecasters/{id}/attachments/{patternId}Update severity
DELETE/forecasters/{id}/attachments/{patternId}Detach a pattern

Examples

1. Create a forecaster
curl -X POST http://localhost:8080/forecasters \
  -H "Content-Type: application/json" \
  -d '{
    "forecasterName": "pump-monitor",
    "features": ["temperature", "vibration"],
    "inputSize": 15,
    "outputSize": 1,
    "fitRate": 1
  }'
2. Feed data
curl -X POST http://localhost:8080/forecasters/{id}/observations \
  -H "Content-Type: application/json" \
  -d '{"temperature": [22.5, 22.7], "vibration": [0.5, 0.6]}'
3. Create an Echo pattern
curl -X POST http://localhost:8080/patterns \
  -H "Content-Type: application/json" \
  -d '{
    "patternName": "bearing-failure",
    "features": {
      "temperature": [22, 24, 28, 35, 44, 55, 68],
      "vibration":   [0.3, 0.5, 0.8, 1.2, 2.1, 3.0, 4.5]
    }
  }'
4. Attach the pattern
curl -X POST http://localhost:8080/forecasters/{forecasterId}/attachments \
  -H "Content-Type: application/json" \
  -d '{"patternId": "{patternId}", "severity": "CRITICAL"}'
5. Get predictions
curl http://localhost:8080/forecasters/{id}/predictions

Response includes DriftMind forecasts + anomaly score + per-pattern Echo matches:

{
  "anomalyScore": 0.18,
  "numberOfClusters": 4,
  "features": {
    "temperature": { "predictions": [22.34], "upperConfidence": [22.8], "lowerConfidence": [21.9], ... }
  },
  "echoPatterns": {
    "bearing-failure": { "score": 0.92, "severity": "CRITICAL" }
  }
}

CSV CLI (lab image)

The lab image ships a driftmind-benchmark CLI for offline datasets. Point it at a config JSON (with optional echoAttachments) and a CSV, get a per-row result file with forecasts, anomaly scores, and Echo pattern matches.

docker run --rm -v $(pwd):/data thngbk/driftmind-edge-lab:latest \
  ./driftmind-benchmark /data/config.json /data/data.csv

The output CSV now includes a {feature}_sequence column when outputSize > 1, containing the full predicted vector (pipe-separated). outputSize = 1 outputs remain byte-identical to earlier releases.


Python client

Use the official DriftMind Python client — no code changes beyond the base URL:

pip install driftmind
from driftmind import DriftMindClient

client = DriftMindClient(api_url="http://localhost:8080", api_key="")

forecaster = client.create_forecaster({
    "forecasterName": "My Forecaster",
    "features": ["y"],
    "inputSize": 15, "outputSize": 1, "fitRate": 2
})

client.add_observation(forecaster["id"], {"y": [42.0]})
predictions = client.get_predictions(forecaster["id"])
print(predictions["anomalyScore"])
print(predictions.get("echoPatterns"))

Full client docs: github.com/thngbk/driftmind


Free-tier limit

The community edition allows 100,000 API calls per container instance (raised from 20,000 in v1.1 — enough headroom for the full validation notebook, NAB benchmark, or multi-pattern demos). Once exhausted:

HTTP 429 — Credit exhausted. Upgrade at https://thingbook.io

Each response includes an X-Calls-Remaining header. Restart the container to reset the counter. For unlimited calls, upgrade at thingbook.io.


How it works

DriftMind uses online micro-clustering to model time-series behaviour continuously — no pre-training, no retraining cycles, instant adaptation to concept drift.

Echo detects known reference signatures via streaming Pearson correlation combined with magnitude filtering. Zero-allocation hot path, O(m) per point (m = pattern length), amplitude-sensitive, multivariate.

Both engines run in the same process, feed off the same data stream, and produce complementary signals. DriftMind catches the unknown; Echo names the known.

The edge binary is compiled natively with GraalVM — no JVM required, sub-second startup, minimal memory footprint.


What's new in v1.1

  • Echo — pattern-of-interest detection engine with multivariate matching, amplitude sensitivity, per-pattern severity (WARN / MAJOR / CRITICAL)
  • Pattern + Attachment APIs — create, attach, detach, update severity at runtime
  • Global /attachments endpoint — single view across all forecasters
  • CSV benchmark enhancement — optional {feature}_sequence column when outputSize > 1 (fully backward-compatible)
  • Self-documenting landing page at GET / — architecture, endpoints, and examples embedded in the binary
  • Validation notebookecho_validation.ipynb with four realistic Telecom and Industrial IoT scenarios
  • Free-tier limit raised to 100,000 calls per container instance
  • Hardened base image — non-root user, latest Ubuntu patches applied at build time, reduced CVE surface

Deployment tiers

Same engine, same API, every scale:

TierTargetImage
Cloud / SaaSManagedapi.thingbook.io
On-Prem / K8sEnterprise infraHelm chart
Edge / DockerSingle nodethngbk/driftmind-edge
On-DeviceRaspberry Pi, ARM gatewaysNative binary

Learn more


Real-time intelligence shouldn't require a GPU budget. It should require a CPU and a problem.

Tag summary

Content type

Image

Digest

sha256:1f55d50b3

Size

69.7 MB

Last updated

16 days ago

docker pull thngbk/driftmind-edge