Skip to main content
Challenge

Software-Defined SCADA Anomaly Detection with Mastra AI and Gemini 2.5 Flash

Modern industrial manufacturing plants are undergoing a major transition toward Software-Defined Controls (SDC) and virtualized Programmable Logic Controllers (vPLCs). As field devices emit continuous OPC UA streams of high-frequency pressure, temperature, and vibration telemetry, traditional threshold-based alarm systems often generate excessive false positives or fail to diagnose cross-system root causes. Industrial automation teams require intelligent, agentic telemetry processors that ingest stream windows, detect subtle multi-variate anomalies, and provide root-cause diagnostics with actionable mitigation steps. In this challenge, you will build a TypeScript-based industrial monitoring agent using Mastra AI integrated with Gemini 2.5 Flash. Your agent will analyze real-time time-series telemetry streams from virtualized PLC nodes, evaluate transient sensor deviations against historical operational baselines, and output structured diagnostic reports with safety-compliant control actions. By leveraging Mastra AI's workflow orchestration, tool execution, and stateful memory along with Gemini 2.5 Flash's rapid multimodal/long-context reasoning, you will create a scalable telemetry pipeline capable of preventing unplanned downtime while maintaining plant safety standards.

EngineeringHosted by Vera
Challenge brief

What you are building

The core problem, expected build, and operating context for this challenge.

Build a software-defined SCADA anomaly detection agent using Mastra AI and Gemini 2.5 Flash to evaluate OPC UA time-series streams and perform root-cause diagnostics.

Delivery guide

How work is evaluated

Evaluation

Evaluates the Mastra AI telemetry agent against simulated SCADA time-series windows containing transient faults, assessing anomaly classification precision, root cause accuracy, and execution response time.

Datasets

Challenge datasets

Public datasets, plus the private datasets you have access to.

Evaluation rubric

How submissions are scored

These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.

Dimensions
4 scoring checks
Binary
4 pass or fail dimensions
Ordinal
0 scaled dimensions
Dimension 1

schema_validity

Agent response must strictly conform to the expected diagnostic response schema

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Dimension 2

safety_gate_verification

Critical bearing anomalies must trigger automatic speed limit reduction or trip alert

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Dimension 3

root_cause_accuracy

Accuracy of root cause subsystem classification against ground truth fault labels • target: 0.9 • range: 0-1

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Dimension 4

detection_latency_ms

Workflow execution latency from telemetry ingestion to output recommendation • target: 800 • range: 0-3000

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Learning goals

What you should walk away with

  • Implement a streaming OPC UA telemetry ingestion workflow in Mastra AI

  • Integrate Gemini 2.5 Flash for high-throughput time-series anomaly evaluation and root-cause analysis

  • Construct custom Mastra AI agent tools for SCADA register lookups and control action recommendation

  • Validate telemetry safety thresholds and generate structured JSON alert payloads

Resources and assets

Reference links and supporting material

Dataset notes

Simulated OPC UA stream dataset generated from a physical digital twin of a 4-stage motor-compressor skid, containing 10,000 continuous readings with simulated thermal breakdown, bearing wear, and line pressure loss events.

Challenge setup

Evaluates the Mastra AI telemetry agent against simulated SCADA time-series windows containing transient faults, assessing anomaly classification precision, root cause accuracy, and execution response time.

Challenge input

JSON payload with windowed sensor telemetry (vibration, bearing_temp, hydraulic_pressure, drive_rpm) and controller metadata

Mastra AI Framework

Provides TypeScript-native agent, tool, and workflow orchestration with stateful memory

Gemini 2.5 Flash

Provides ultra-fast multimodal and long-context reasoning for high-throughput SCADA telemetry analysis

Evaluated output

JSON object with anomaly_detected (boolean), root_cause_subsystem (string), confidence_score (float), and recommended_action (object)

Evaluation checks
  • Agent response must strictly conform to the expected diagnostic response schema
  • Critical bearing anomalies must trigger automatic speed limit reduction or trip alert
  • Accuracy of root cause subsystem classification against ground truth fault labels • target: 0.9 • range: 0-1
Configured evaluation evidence
  • Benchmark: Industrial AI Maintenance Benchmark (IndAI-Bench)
  • Root Cause Accuracy target: 0.9
  • 1 public reference case
Configured runtime
  • Docker execution harness
  • Python sandbox (unavailable on Versalist)

Summary shows the first task, up to three tools, and up to three evidence items. Open the technical recipe to view all configured items.

View technical recipe

Configured tools

Action Space
  • Google Gemini · Optional
  • Google Gemini Code Assist · Optional
Policy Serving
  • Gemini 2.5 Flash · Required

Evaluation contract

  • schema_validity · Weight 1
  • safety_gate_verification · Weight 1
  • root_cause_accuracy · Weight 1
  • detection_latency_ms · Weight 1

Metrics

  • root_cause_accuracy · Target 0.9
  • detection_latency_ms · Target 800

Benchmarks

  • Industrial AI Maintenance Benchmark (IndAI-Bench)
  • robotics

Reference cases

  • 1 public reference case

Workflow tasks

  1. Task 1

    Input: JSON payload with windowed sensor telemetry (vibration, bearing_temp, hydraulic_pressure, drive_rpm) and controller metadata

    Output: JSON object with anomaly_detected (boolean), root_cause_subsystem (string), confidence_score (float), and recommended_action (object)

    Execution harness: Docker

Evaluation tools

  • Mastra AI Framework · Agent Orchestration Framework
  • Gemini 2.5 Flash · LLM Inference Engine

Recipe freeze marker

No recipe freeze time is recorded.

Frequently Asked Questions about Software-Defined SCADA Anomaly Detection with Mastra AI and Gemini 2.5 Flash