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 an Industrial WIP Bottleneck Tracker and Dispatch Planner

Format
Code-aware
Lines
112
Sections
11
Linked challenge
Build an Industrial WIP Bottleneck Tracker and Dispatch Planner

Prompt source

Original prompt text with formatting preserved for inspection.

112 lines
11 sections
No variables
1 code block
## Build
Track serialized work-in-progress pallets through simulated open62541 station buffers. Generate dynamic lot dispatch proposals to eliminate workstation starvation and line imbalances.

## User
Plant Production Dispatcher

## Workflow
1. Extract station buffer occupancy and machine operational states from open62541 snapshots.
2. Calculate queue dwelling times and upstream buffer accumulation rates.
3. Detect developing bottlenecks where buffer utilization exceeds operational safety margins.
4. Synthesize re-routing dispatch proposals for downstream work-in-progress lots.

## Interface
Kanban-style station queue visualization with queue latency heatmaps and dispatch action approvals.

## Data
Mock time-series data reflecting factory buffer capacities, lot arrival timestamps, and station processing rates.
Starter examples below are synthetic. They are not downloaded records.

## Source
[open62541 OPC UA](https://raw.githubusercontent.com/open62541/open62541/master/README.md)
Reads structured equipment state arrays and station buffer queues via open62541 data models.

## Tools
agno, pandas, fastapi.
Agno provides lightweight agent orchestration to monitor multiple station buffer queues and propose dispatch schedules.
Requires capability to evaluate mathematical constraints and schedule balancing heuristics.

## 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
- Identifies the primary bottleneck station based on queue dwell time.
- Proposes dispatch routing that diverts WIP to alternate available stations.
- Rejects dispatch reroutes when alternate buffers exceed 85% utilization.

## Starter Examples
```json
[
  {
    "input": {
      "line_id": "ASSEMBLY-02",
      "stations": [
        {
          "station_id": "ST-10",
          "buffer_capacity": 10,
          "current_wip": 9,
          "avg_dwell_min": 14.2,
          "status": "BLOCKED"
        },
        {
          "station_id": "ST-20A",
          "buffer_capacity": 10,
          "current_wip": 8,
          "avg_dwell_min": 12,
          "status": "RUNNING"
        },
        {
          "station_id": "ST-20B",
          "buffer_capacity": 10,
          "current_wip": 2,
          "avg_dwell_min": 3.1,
          "status": "RUNNING"
        }
      ],
      "pending_lots": [
        "LOT-881",
        "LOT-882"
      ]
    },
    "expected_output": {
      "bottleneck_station": "ST-10",
      "dispatch_action": "DIVERT_LOTS",
      "target_station": "ST-20B",
      "rebalanced_wip_projected": 4,
      "alert_level": "WARNING"
    }
  },
  {
    "input": {
      "line_id": "ASSEMBLY-02",
      "stations": [
        {
          "station_id": "ST-10",
          "buffer_capacity": 10,
          "current_wip": 3,
          "avg_dwell_min": 2,
          "status": "RUNNING"
        },
        {
          "station_id": "ST-20A",
          "buffer_capacity": 10,
          "current_wip": 4,
          "avg_dwell_min": 2.5,
          "status": "RUNNING"
        },
        {
          "station_id": "ST-20B",
          "buffer_capacity": 10,
          "current_wip": 3,
          "avg_dwell_min": 2.2,
          "status": "RUNNING"
        }
      ],
      "pending_lots": [
        "LOT-883"
      ]
    },
    "expected_output": {
      "bottleneck_station": "NONE",
      "dispatch_action": "PROCEED_STANDARD",
      "target_station": "ST-20A",
      "rebalanced_wip_projected": 5,
      "alert_level": "NOMINAL"
    }
  }
]
```

## Safety
Read-only simulation producing dispatch proposals; final dispatch decisions require human operator sign-off.
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.