Skip to main content
Shift supervisors need accurate performance data the moment a shift ends, not the next morning after someone manually pulls numbers from three different systems. Delays in reporting mean delays in corrective action — a line running at 60% OEE for an entire second shift because nobody caught the first shift’s downtime event. This use case connects your production database to a Wayak agent that answers shift performance questions on demand and a playbook that automatically generates an OEE report at every shift change. The playbook uses Python to calculate OEE components and compare them against targets.

What you need

Data sources

  • Production database — Output logs (units produced, units scrapped per line per shift), downtime event records with cause codes and durations
  • ERP system — Production schedule with planned output targets per line

Knowledge spaces

  • OEE reference guide — Upload your OEE calculation methodology and target definitions
  • Downtime cause code manual — Standard cause codes and their categories (planned, unplanned, changeover)
Semantic layer: Define these in your ontology before setting up the agent.
ComponentNameDefinition
ObjectProduction RunMaps to the production output log. Represents a single line’s output during one shift
ObjectDowntime EventMaps to the downtime records table. Represents one stoppage with cause, duration, and line
MetricOEEAvailability x Performance x Quality, expressed as a percentage per line per shift
MetricScrap RateUnits scrapped divided by total units produced, as a percentage
DimensionShiftCategorizes data by shift period (Day, Swing, Night)
DimensionProduction LineGroups data by physical production line identifier
See building a semantic layer for a step-by-step guide.

Agent setup

1

Create the agent

Go to Agent Space > New agent.
FieldValue
NameShift Performance Analyst
RoleProduction performance analyst
GoalProvide real-time shift performance insights and OEE analysis
2

Set the description

You are a production performance analyst. When asked about shift performance, always start with the OEE number and whether it met the target. Break OEE into its three components (availability, performance, quality) so the user can see which factor drove the result. List downtime events in order of duration, longest first. Use precise numbers and avoid vague language like “approximately.” If a line underperformed its target, recommend checking the longest downtime event first.
3

Scope data access

Grant access to:
  • Production database data source (output logs and downtime records)
  • ERP system data source (production schedule and targets)
  • OEE reference guide knowledge space
  • Production Run and Downtime Event objects in the semantic layer
4

Add skills

Trigger: End of shift or user asks about shift performance
  1. Pull production output for the specified shift, including units produced and units scrapped for each line.
  2. Retrieve the planned output target for each line from the production schedule.
  3. Calculate OEE for each line: availability multiplied by performance multiplied by quality.
  4. Compare each line’s actual OEE against its target OEE.
  5. List any unplanned downtime events with duration, cause code, and affected line.
  6. Summarize in a table: line, target OEE, actual OEE, units produced, scrap count, and top downtime cause.

Automation

Playbook: End-of-shift OEE report

1

Set the trigger

Schedule the playbook to run three times daily at shift change times: 6:00 AM, 2:00 PM, and 10:00 PM.
2

Build the workflow

The playbook pulls the last 8 hours of production data, calculates OEE for every line, and delivers a formatted report.
  1. Query step — Pull all production output records and downtime events for the shift that just ended.
  2. Python code step — Calculate OEE components for each line using the standard formula.
  3. Condition step — Flag any line where OEE fell below the target threshold.
  4. Format step — Build the report with a summary table and a downtime breakdown section.
The Python code step uses a Python code block to compute availability (run time / planned production time), performance (actual output / theoretical output), and quality (good units / total units). It multiplies the three to produce OEE. You can customize target thresholds per line.
3

Configure delivery

Send the report via email to the shift supervisor and plant manager. For any line below target, also send a Slack message to the #production-alerts channel.
4

Test and activate

Click Run now to test with live data, then toggle to Active.

What’s next

Quality defect analysis

Identify defect patterns across lines, shifts, and operators to reduce scrap.

All manufacturing use cases

See the full list.