Krishna-Modi12/RAI

Edge-native predictive maintenance intelligence for wind and solar assets

โ˜… 0Forks 0PythonGitHub โ†—Compare

README

Renewable Asset Intelligence (RAI)

Turn ambiguous renewable-asset anomalies into defensible intervention decisions.

Renewable Asset Intelligence (RAI) combines physics-grounded numerical prediction, atmospheric environmental context, fleet-peer isolation, audited historical failure precedent, techno-economic consequence modeling, and bounded local AI into an auditable, human-governed operational decision loop for wind and solar fleets.

Positioning: RAI is an extensively tested and evidence-bounded research/product prototype, with externally validated wind evidence and an end-to-end demonstrated operational decision loop. It maintains zero commercial plant connections and unclosed solar failure validation boundaries.

Tests Adversarial QA Scientific Evidence Benchmark Embargoed PR--AUC Audit Status Python FastAPI Next.js


RAI Fleet Operations Command Figure 1: RAI Fleet Operations Command displaying real-time asset health, total expected generation, modeled exposure, and an exposure-weighted priority queue.


๐Ÿ“– Table of Contents


๐Ÿ” The Problem vs. Our Solution

Traditional SCADA systems rely on fixed-threshold alarms (e.g., power < 80%), creating two critical failure modes:

  1. Alarm Fatigue: Harmless weather events trigger thousands of alerts.
  2. Forced Outages: Actual mechanical degradation hides within weather variance.

RAI replaces manual guesswork with a decision-intelligence loop: Instead of flooding operators with unranked alerts, RAI isolates true anomalies using physics models, filters out environmental noise, retrieves audited historical precedents, and calculates the exact financial exposure (Net Present Value) of fixing a component today vs. waiting.

Feature Conventional Systems RAI Platform
Trigger Mechanism Fixed static thresholds Physics + LightGBM models conditioned on real-time weather (rai/models/expected.py)
Environmental Context Ignored Incorporates CAMS dust integration, clear-sky models, and rain kinetics
Peer Isolation Alerts trigger farm-wide Distinguishes true physical defects from site-wide curtailment via feeder peer baselining
Urgency Framing High/Medium/Low tags Net Present Value ($\text{NPV}$) comparison under explicit cost assumptions (rai/economics/)
Plant Safety N/A Strictly read-only analysis with mandatory human-in-the-loop work order authorization

โš™๏ธ Core Architecture & Intelligence Pipeline

RAI processes data through a deterministic, auditable 10-stage pipeline running on a robust Python/DuckDB backend.

  1. Sense & Normalize: Ingest and clean SCADA, inverter, and met-mast data into partitioned windowed storage (rai/store/).
  2. Expect & Detect: Physics-grounded models compute expected power; anomalies are flagged using $z$-scores and Isolation Forests (rai/models/).
  3. Contextualize & Compare: Environmental attribution and fleet-peer isolation rule out weather or curtailment anomalies.
  4. Retrieve & Quantify: The system queries 14 external historical real cases and computes intervention NPV (rai/economics/).
  5. Prioritize & Act: Bounded local AI synthezises evidence into a work order proposal, governed strictly by a licensed human operator.
flowchart TD
    subgraph INGESTION["Telemetry & Environmental Ingestion"]
        A[Raw SCADA Telemetry] --> C[Data Quality & Alignment]
        B[CAMS Aerosols & Weather] --> C
    end

    subgraph MODELS["Physical & Statistical Inference"]
        C --> D[Physics + Expected Behavior]
        C --> E[Fleet Peer Isolation]
        D --> G[Conditioned Residuals]
        E --> G
    end

    subgraph SYNTHESIS["Precedent & Economic Quantification"]
        G --> I[Precedent Retrieval]
        I --> J[NPV Trade-Off Engine]
        J --> K[Structured Evidence]
    end

    subgraph REASONING["Bounded AI & Human Governance"]
        K --> M[Needle 2 Local AI / Fallback]
        M --> O[Work Order Proposal]
        O --> P[Human Operator Authorization]
        P -- Approved --> Q[Meteorological Crew Dispatch]
    end

    style INGESTION fill:#1e293b,stroke:#475569,stroke-width:1px,color:#f8fafc
    style MODELS fill:#0f172a,stroke:#3b82f6,stroke-width:1px,color:#f8fafc
    style SYNTHESIS fill:#0f172a,stroke:#6366f1,stroke-width:1px,color:#f8fafc
    style REASONING fill:#064e3b,stroke:#10b981,stroke-width:1px,color:#f8fafc
Loading

(Critical Invariant: Zero math occurs in the LLM. All hazard rates, percentiles, and NPVs are computed deterministically in Python before the reasoning layer is invoked.)


๐Ÿ”ฌ Scientific Evidence & Validation

RAI adheres to a strict scientific evidence freeze, categorizing capabilities into transparent tiers. Full evidence scorecards can be found in docs/evaluation/.

  • Wind Anomaly Detection (VALIDATED): Out-of-sample accuracy > 0.995 on the CARE Benchmark (Zenodo 10958775).
  • Precedent Retrieval (DEMONSTRATED): High-precision vector retrieval over 14 external historical real cases (CARE, Kelmarsh, PVDAQ).
  • Local AI Reasoning (DEMONSTRATED): 100% tool boundary adherence and zero direct control actuation across 47 hostile stress tests.
  • Solar Failure Prediction (NOT_VALIDATED): Gate 5.6C remains unclosed. Solar models ingest valid telemetry but claim no validated predictive capability.

For deep-dive methodology, mathematical proofs, and adversarial QA results, review the Audit Report and the Scientific Evidence Freeze.


๐Ÿš€ Quick Start: Run Locally in Under 3 Minutes

Prerequisites: Python 3.11+, Node.js 20+

# 1. Clone & Setup Environment
git clone https://github.com/Krishna-Modi12/RAI.git
cd RAI
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -e ".[dev]"

# Install frontend dependencies
cd web && npm install && cd ..

# 2. Generate Data & Build Knowledge Indexes
python scripts/generate.py
python scripts/train.py
python scripts/build_index.py

# 3. Launch Services
# Terminal 1:
uvicorn services.api.main:app --port 8000
# Terminal 2:
cd web && npm run dev

Navigate to http://localhost:3000 to view the Fleet Operations Command.


๐Ÿ“‚ Repository Map

  • rai/: Core domain logic, including modeling (models/), environmental context (environment/), memory and retrieval (memory/), techno-economics (economics/), and bounded local AI agents (agent/).
  • services/api/: FastAPI REST service implementing the core API endpoints.
  • web/: Next.js App Router views for the Operations Command dashboard.
  • docs/: Comprehensive research documentation, benchmark runs, mathematical proofs, and audit logs.
  • scripts/: Utilities for synthetic data generation, model training, and indexing.

For a complete walkthrough of the evaluation interface and capabilities, see the 5-Minute Evaluator Demo Script.

Contributors

Krishna-Modi12

Issues