An MES can tell you which order was running, which batch consumed a material lot, and what production result was recorded. An AI model may find patterns in those records. The difficult part is making sure the model sees the right context—and that a predicted pattern is translated into a controlled operational decision.
The data problem comes first
Production data is not automatically analysis-ready. A timestamp may use a different clock than the PLC. An equipment name may have changed. A short stop may be coded inconsistently by different shifts. A batch record may close after an equipment event because the integration is asynchronous. If the model learns that “night shift causes rejects”, it may actually be detecting a sensor reset that happens at shift handover or a difference in how records are entered.
Before modelling, establish a coherent event model: asset identity, order or batch context, operation, product variant, time basis, quality status and relevant process values. The MES provides some of that context, but controller and historian data may be needed for process dynamics. Define which source is authoritative for each field and how mismatches are resolved.
Start with a decision, not a model leaderboard
Useful questions are operational and measurable. Which production lots deserve earlier review? Which recurring minor stops are worth investigating first? Does a process drift pattern justify a quality check? Which maintenance cases are likely to recur and need better documentation? The intended action determines the required latency, acceptable error rate and evidence needed to justify the result.
For example, a risk score that prioritises a supervisor’s daily review can tolerate a different error profile than a model that automatically blocks a batch release. The same statistical model can be appropriate for one workflow and inappropriate for another because the consequence of the decision is different.
Preserve the record of the decision
Where a model supports an MES workflow, retain enough information to reconstruct its influence: input data window, data-quality flags, model and feature version, score, threshold, context presented to the user, human response and resulting state transition. If a user overrides the recommendation, record the reason where practical. An audit trail should describe what the system actually did, not merely that “AI was enabled”.
Do not overwrite the original production fact with a model inference. Keep “measured temperature was 82.4 °C”, “sensor quality was good”, “model estimated elevated risk” and “quality engineer dispositioned the lot” as distinct data items with distinct origins.
A small architecture that often works
- Collect validated MES and historian records into a versioned analytical dataset.
- Apply data-quality rules and explicitly exclude or mark incomplete time windows.
- Calculate features in a reproducible pipeline, with a defined training cutoff to prevent leakage.
- Score records in a separate analytical service or approved application component.
- Display the score with an explanation, source context and a clear next step.
- Keep the official production and quality state transitions within the existing authorised workflow.
This architecture is less dramatic than connecting a chatbot directly to the MES database and asking it to make decisions. It is also far easier to test, support and audit.
Evaluate in the language of manufacturing
Do not rely only on AUC, F1 or another isolated model metric. Measure whether the proposed decision improves a real process: earlier detection, lower repeat-failure rate, reduced time to investigate, better schedule stability or fewer unnecessary holds. Define a baseline and compare outcomes over a suitable period. Include the operational cost of false alerts and the review time required from engineers.
Use time-aware splits so future information does not leak into training. Validate across product types, shifts and equipment variants. If a model is trained on historical data gathered under a previous control strategy, its assumptions may no longer apply after a setpoint, supplier or process change.
Feedback without uncontrolled self-modification
Human decisions and subsequent quality outcomes can improve future models, but they must enter a governed learning process. A technician’s override is a useful label only after its meaning and reliability are understood. Periodically review the training set, retrain under change control where required, and compare candidate versions against a fixed regression suite before deployment.
Practical conclusion
MES provides production context; process systems provide dynamics; AI may provide prioritisation or prediction. The value lies in connecting those capabilities through a data contract, an explicit decision workflow and traceable evidence. A score without a responsible action is just another number on the screen—and factories already have several thousand of those.