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)
| Component | Name | Definition |
|---|---|---|
| Object | Production Run | Maps to the production output log. Represents a single line’s output during one shift |
| Object | Downtime Event | Maps to the downtime records table. Represents one stoppage with cause, duration, and line |
| Metric | OEE | Availability x Performance x Quality, expressed as a percentage per line per shift |
| Metric | Scrap Rate | Units scrapped divided by total units produced, as a percentage |
| Dimension | Shift | Categorizes data by shift period (Day, Swing, Night) |
| Dimension | Production Line | Groups data by physical production line identifier |
Agent setup
Create the agent
Go to Agent Space > New agent.
| Field | Value |
|---|---|
| Name | Shift Performance Analyst |
| Role | Production performance analyst |
| Goal | Provide real-time shift performance insights and OEE analysis |
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.
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
Add skills
Generate shift performance summary
Generate shift performance summary
Trigger: End of shift or user asks about shift performance
- Pull production output for the specified shift, including units produced and units scrapped for each line.
- Retrieve the planned output target for each line from the production schedule.
- Calculate OEE for each line: availability multiplied by performance multiplied by quality.
- Compare each line’s actual OEE against its target OEE.
- List any unplanned downtime events with duration, cause code, and affected line.
- Summarize in a table: line, target OEE, actual OEE, units produced, scrap count, and top downtime cause.
Analyze downtime trends
Analyze downtime trends
Trigger: User asks about downtime patterns or recurring issues
- Pull downtime events for the specified time range, defaulting to the last 7 days.
- Group events by cause code and calculate total minutes lost per cause.
- Rank cause codes by total downtime, highest first.
- Identify any cause code that appeared on more than two consecutive shifts.
- Present a ranked table with cause code, occurrence count, total minutes, and affected lines.
Automation
Playbook: End-of-shift OEE report
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.
Build the workflow
The playbook pulls the last 8 hours of production data, calculates OEE for every line, and delivers a formatted report.
- Query step — Pull all production output records and downtime events for the shift that just ended.
- Python code step — Calculate OEE components for each line using the standard formula.
- Condition step — Flag any line where OEE fell below the target threshold.
- 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.
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.
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.

