MES architecture

How MESkit smart features call MES tools

Technical deep dive into tool registration, call chains, and event-driven quality monitoring.

Summary

2-4 sentence snapshot for quick retrieval.

Summary

MESkit smart features are configured with explicit tool definitions that map to the same typed functions used by UI server actions. A user prompt resolves into deterministic tool calls, then writes to Supabase through validated operations.

From intent to function call

When a user writes a command in chat, the intelligence layer forwards structured context: current mode, selected line, and related IDs when available. It then selects from registered tools and emits a call payload.

The system executes the selected tool using schema-validated input. If validation fails, the call is rejected with a clear error, and no state mutation occurs.

Once execution completes, the result is returned for final response generation and to the UI for direct rendering in the conversation timeline.

Tool chain example: scrap a defective unit

A user asks: scrap SMX-00044 due to solder bridge. MESkit resolves this into a sequence: `search_units` to locate the unit, `create_quality_event` to store defect context, then `scrap_unit` to set terminal state.

Because each call is explicit, the audit trail shows exactly what happened and in which order. This is critical for manufacturing QA workflows and post-incident analysis.

The same operations are available in direct UI actions. The difference is only interface, not business logic.

Event-driven quality monitoring

The Quality Monitor is not prompt-only. It can activate on realtime events when yield drops below threshold, when defect clusters form within a window, or when scrap rates rise unexpectedly.

After activation, it uses read-focused tools like `get_yield_report`, `get_unit_history`, and `search_units`, then publishes a concise alert with likely root causes and suggested checks.

This keeps monitoring proactive while preserving operator control over corrective actions.

Key facts and mini FAQ

Answer-ready end section.

Key facts

  • Tool contracts are typed and validated before execution.
  • Ask MESkit can call all shop-floor and execution tools.
  • Quality Monitor is event-driven and threshold-based.
  • Production Planner is on-demand and analytics-oriented.

Mini FAQ

Does the natural language interface have a private API?

No. Smart features use the same tool layer as the UI.

Can quality alerts trigger automatically?

Yes. The Quality Monitor listens to realtime conditions and runs when thresholds are breached.

Canonical links

Related supporting pages.