Skip to main content
Back to Prompt Library
implementation

Build the application

Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.

Linked challenge: Build a Sparkplug B Industrial Energy Demand Shifting Planner

Format
Code-aware
Lines
97
Sections
11
Linked challenge
Build a Sparkplug B Industrial Energy Demand Shifting Planner

Prompt source

Original prompt text with formatting preserved for inspection.

97 lines
11 sections
No variables
1 code block
## Build
Parse electrical telemetry and plant operational state messages encoded in Sparkplug B payloads. Synthesize off-peak batch rescheduling proposals to avoid peak tariff surcharges.

## User
Plant Energy and Utilities Manager

## Workflow
1. Collect power consumption metrics and operational states published across Sparkplug B topic trees.
2. Cross-reference real-time aggregate power draw against utility peak tariff schedule windows.
3. Identify flexible batch process units such as wash tanks and heat treat ovens currently active in peak hours.
4. Formulate non-binding schedule shift recommendations to move energy-intensive steps to off-peak periods.

## Interface
Terminal and web interface presenting load demand curves, tariff brackets, and shift proposals.

## Data
Create synthetic MQTT Sparkplug B payloads containing kilowatt demand metrics and batch unit state updates.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Eclipse Sparkplug](https://raw.githubusercontent.com/eclipse-sparkplug/sparkplug/master/README.md)
Extracts Sparkplug B metric datasets and time-series telemetry properties according to Eclipse Tahu standards.

## Tools
agno, pydantic, pytest.
Agno provides lightweight structured agent flows for energy data processing and advisory schedule drafting.
Requires standard text reasoning LLM via hosted API or local inference server.

## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.

## Acceptance
- Parses Sparkplug B power metric payloads and computes aggregate line consumption.
- Identifies process units operating during defined high-tariff windows.
- Generates rescheduling proposals that maintain daily throughput targets.
- Flags incomplete telemetry feeds when power readings fail to report.

## Starter Examples
```json
[
  {
    "input": {
      "current_time": "2025-05-15T14:15:00Z",
      "peak_window": {
        "start": "14:00:00Z",
        "end": "18:00:00Z"
      },
      "devices": [
        {
          "device_id": "Oven_HT01",
          "kw_draw": 145,
          "batch_id": "B-912",
          "can_pause": true
        },
        {
          "device_id": "Conveyor_CV01",
          "kw_draw": 12,
          "batch_id": "B-912",
          "can_pause": false
        }
      ],
      "max_allowed_peak_kw": 120
    },
    "expected_output": {
      "alert": "PEAK_DEMAND_EXCEEDED",
      "total_kw": 157,
      "recommended_shifts": [
        {
          "device_id": "Oven_HT01",
          "batch_id": "B-912",
          "suggested_start": "2025-05-15T18:05:00Z",
          "estimated_kw_reduction": 145
        }
      ],
      "projected_kw_after_shift": 12
    }
  },
  {
    "input": {
      "current_time": "2025-05-15T10:00:00Z",
      "peak_window": {
        "start": "14:00:00Z",
        "end": "18:00:00Z"
      },
      "devices": [
        {
          "device_id": "Oven_HT01",
          "kw_draw": 145,
          "batch_id": "B-910",
          "can_pause": true
        }
      ],
      "max_allowed_peak_kw": 120
    },
    "expected_output": {
      "alert": "NORMAL_OPERATION",
      "total_kw": 145,
      "recommended_shifts": [],
      "projected_kw_after_shift": 145
    }
  }
]
```

## Safety
Strictly advisory schedule recommendations; does not alter PLC registers, breakers, or batch timers.
Use mock external writes. Require human review before any real deployment.

Adaptation plan

Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.

Keep stable

Hold the task contract and output shape stable so generated implementations remain comparable.

Tune next

Update libraries, interfaces, and environment assumptions to match the stack you actually run.

Verify after

Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.