Blueprint

System Data Flow

Entry Point
Process Node
Data Store
Output
Productionv1.0.0

Clinical Compass

AI / Observability

A TensorFlow-backed anomaly scoring model that monitors distributed infrastructure signals and predicts service degradation before thresholds are breached — resolving 94% of incidents automatically.

Logic Breakdown

The Clinical Compass ingests a continuous stream of infrastructure telemetry — CPU, memory, error rate, P95 latency, and request volume — and scores each signal against a trained weight matrix. When the composite score crosses a configurable risk threshold, the model fires an auto-remediation playbook: scaling up Kubernetes pods, flushing edge caches, or triggering an alert runbook, depending on the anomaly class.

Architecture Decisions

  • 01Datadog metrics API feeds a 6-signal telemetry stream into the scoring pipeline every 30 seconds.
  • 02TensorFlow Sequential model applies learned weight matrix to the signal vector and outputs a risk score (0–1).
  • 03Risk score > 0.72 triggers auto-remediation: HPA scale-up, cache flush, or PagerDuty alert depending on anomaly class.
  • 04All scoring events written to a persistent audit log for model retraining and post-incident review.

Code Snippet

typescript
clinical-compass.ts
// Clinical Compass — risk scoring pipeline
import * as tf from "@tensorflow/tfjs-node";

const WEIGHTS = [0.35, 0.25, 0.18, 0.12, 0.07, 0.03];
const RISK_THRESHOLD = 0.72;

export async function scoreSignals(signals: number[]): Promise<number> {
  const input  = tf.tensor2d([signals]);
  const result = model.predict(input) as tf.Tensor;
  const score  = (await result.data())[0];
  input.dispose();
  result.dispose();
  return score;
}

export async function evaluate(telemetry: TelemetrySnapshot) {
  const signals = [
    telemetry.cpuUsage,
    telemetry.memoryUsage,
    telemetry.errorRate,
    telemetry.p95Latency,
    telemetry.requestVolumeDelta,
    telemetry.cacheHitRate,
  ];
  const score = await scoreSignals(signals);
  if (score > RISK_THRESHOLD) {
    await triggerRemediation(score, telemetry);
  }
  return { score, signals, threshold: RISK_THRESHOLD };
}

Key Dependencies

tensorflow^2.15.0Model training and inference
@datadog/datadog-api-client^1.18.0Real-time telemetry ingestion
kubernetes-client^10.0.0Autoscaling API integration
zod^3.22.0Signal schema validation

Known Limitations

  • Model accuracy degrades on traffic patterns outside the training distribution — requires monthly retraining.
  • Kubernetes HPA scale-up has a 90-second warm-up window; very rapid spikes may breach SLA before pods are ready.

Technical Spec

Model
TensorFlow 2.x Sequential
Accuracy
94.2% (test set)
Latency
<8ms inference
Signals
6 weighted inputs
Infra
Kubernetes + Datadog
Retraining
Monthly cadence
Status
Production

Tags

TensorFlowKubernetesDatadogAnomaly Detection

Live Sandbox

Interactive runtime environment — Clinical Compass v1.0.0

Production
clinical-compass-sandbox

$ npm run sandbox

> Initialising Clinical Compass v1.0.0

> Status: Production

// Live iframe mounted once sandboxUrl is configured.