Skip to content

Functional models and agentic AI data requirements in UNS

by Kudzai Manditereza
18 min read

The difference between an AI agent that generates plausible-sounding recommendations and one that generates correct recommendations for your plant floor comes down to how well your data infrastructure encodes operational behavior. 

Functional modeling is the practice of formally representing how systems behave, how entities interact and what state transitions are valid within a domain. When applied to a Unified Namespace (UNS), functional models give agents the grounded reasoning context they need to operate safely in industrial environments.

Why are data models necessary but insufficient for agentic reasoning?

A data model defines the entities in your UNS and their attributes: what a CNC machine is (its properties, its telemetry points, its location in the ISA-95 hierarchy). A well-structured data model answers questions like "What is the current spindle temperature of Machine 4?" or "Which assets are in Area 2, Line 3?"

This is table stakes. Without a coherent data model, your UNS is an unstructured stream of topic-value pairs. But a data model alone captures structure, not behavior. It tells an agent what exists; it does not tell the agent what those things do, how they relate dynamically or what operational constraints govern their interactions.

Consider a practical scenario. Your data model defines:

Entity

Attributes

CNC Machine

spindle_speed, coolant_temp, vibration_rms, state

Coolant System

flow_rate, reservoir_level, filter_pressure_delta

Work Order

part_number, quantity_target, quantity_complete, priority

An agent consuming this data can report values. It can threshold-check. But when spindle vibration increases by 18% mid-cycle, the agent has no basis for determining whether this correlates with the coolant system's declining flow rate, whether the current part geometry normally produces higher vibration, or whether the machine's state transition from "roughing" to "finishing" explains the change.

A functional model encodes exactly these relationships. It captures that the CNC machine depends on the coolant system, that vibration profiles vary by machining operation type and that valid state transitions follow a defined sequence. This is the difference between an agent that fires a generic vibration alert and one that says: "Vibration increase correlates with coolant flow degradation; filter pressure delta suggests a clogged filter. Recommend maintenance before next shift. Current work order can complete within tolerance."

Functional models turn your UNS from a data lake with an event bus into a reasoning substrate.

What does a functional model actually contain?

A functional model in a UNS context formalizes three categories of operational knowledge that data models omit: behavioral specifications, relationship semantics and state machines.

Behavioral specifications

Behavioral specs define how an entity acts under given conditions, not just what it is. For a conveyor system, the data model captures speed, motor_current and belt_tension. The behavioral spec adds:

  • Operating envelope: speed must be between 0.2 m/s and 1.8 m/s when state = RUNNING; motor_current above 12A at speeds below 0.5 m/s indicates a jam condition

  • Derived behaviors: throughput is a function of speed, product spacing and reject rate; effective_throughput = (speed / product_spacing) * (1 - reject_rate)

  • Temporal patterns: motor_current typically ramps over 3 seconds during startup; current spikes shorter than 200ms during RUNNING are normal load variations; sustained current above baseline + 15% for more than 5 seconds is anomalous

These specifications are not alert thresholds (though alerts can be derived from them). They are operational truths that an agent needs to reason correctly about what constitutes normal, degraded and faulty behavior.

Relationship semantics

Data models capture containment hierarchies (Line contains Stations; Station contains Machines). Functional models capture operational relationships with semantic meaning:

  • depends_on: CNC Machine depends_on Coolant System (functional dependency; coolant failure constrains machine operation)

  • feeds: Conveyor_A feeds Buffer_B feeds Station_C (material flow; upstream failures propagate downstream)

  • shares_resource: Machine_1 shares_resource Compressed_Air_Supply with Machine_2 (contention relationship; simultaneous peak demand may starve one machine)

  • produces / consumes: Station_C produces Part_X; Assembly_D consumes Part_X (value stream linkage)

  • inhibits: Safety_Gate_Open inhibits Robot_Arm_Motion (safety interlock; not just a data correlation but a causal constraint)

Each relationship type carries reasoning implications. A depends_on relationship tells an agent to check upstream dependencies when diagnosing a downstream anomaly. A shares_resource relationship tells the agent to consider contention when two entities degrade simultaneously. A feeds relationship enables the agent to predict downstream impact when an upstream process fails.

In the HiveMQ Semantic Graph, these relationships are represented as typed edges between entities, making them traversable by both human operators and software agents. The Semantic Graph provides the machine-readable structure that turns informal tribal knowledge ("oh, those two machines share the same air compressor, that's probably why") into formal, queryable operational context.

State machines

Every non-trivial industrial asset has operational states and valid transitions between them. A functional model encodes these explicitly:

CNC_Machine_States:
  IDLE -> SETUP [trigger: work_order_assigned]
  SETUP -> RUNNING [trigger: program_loaded AND tool_verified AND material_present]
  RUNNING -> PAUSED [trigger: operator_pause OR feed_hold]
  RUNNING -> FAULTED [trigger: protection_trip OR e_stop]
  PAUSED -> RUNNING [trigger: cycle_resume AND no_active_alarms]
  FAULTED -> IDLE [trigger: fault_acknowledged AND fault_cleared]
  RUNNING -> IDLE [trigger: cycle_complete AND part_unloaded]
  INVALID: FAULTED -> RUNNING  # Must clear through IDLE
  INVALID: IDLE -> RUNNING     # Must go through SETUP

State machines are critical for agent safety. Without them, an agent reasoning about production optimization might recommend resuming a machine that is in a FAULTED state, bypassing the fault-acknowledgment sequence. With the state machine encoded in the UNS information model, the agent's action space is constrained to valid transitions. This is a concrete implementation of the trusted delegation principle: domain experts encode operational rules into the model, and agents operate within those rules.

How do you encode functional models in an MQTT-based UNS?

Encoding functional models in a UNS requires decisions at three levels: topic structure, payload schema and metadata layer. Here are patterns that work in production MQTT architectures on HiveMQ Broker.

Pattern 1: Relationship topics

Publish relationship declarations as retained messages on dedicated relationship topics:

uns/enterprise/site-1/area-2/line-3/_meta/relationships
{
  "entity": "CNC-Machine-04",
  "relationships": [
    {
      "type": "depends_on",
      "target": "uns/enterprise/site-1/area-2/utilities/coolant-system-02",
      "criticality": "high",
      "failure_mode": "degraded_operation"
    },
    {
      "type": "shares_resource",
      "target": "uns/enterprise/site-1/area-2/utilities/compressed-air-main",
      "contention_threshold_psi": 85
    }
  ]
}

The meta topic prefix convention separates model metadata from telemetry data. Agents subscribe to both the telemetry topics and the meta/# wildcard to build their operational context at startup.

Pattern 2: State machine definitions via Data Hub

HiveMQ Data Hub policies can enforce state machine transitions at the broker level. Define a schema that validates state transitions against the allowed set, rejecting invalid transitions before they propagate through the namespace:

{
  "stateMachine": "CNC-Machine",
  "validTransitions": [
    {"from": "IDLE", "to": "SETUP", "requiredConditions": ["work_order_assigned"]},
    {"from": "SETUP", "to": "RUNNING", "requiredConditions": ["program_loaded", "tool_verified", "material_present"]},
    {"from": "RUNNING", "to": "FAULTED", "requiredConditions": ["protection_trip OR e_stop"]},
    {"from": "FAULTED", "to": "IDLE", "requiredConditions": ["fault_acknowledged", "fault_cleared"]}
  ]
}

This gives you broker-enforced behavioral constraints, not just documentation. An agent (or any client) publishing an invalid state transition gets rejected by the Data Hub policy. This is infrastructure-level safety, not application-level hope.

Pattern 3: Behavioral envelopes as contextual metadata

Publish operating envelopes alongside telemetry so agents can self-contextualize:

uns/enterprise/site-1/area-2/line-3/cnc-04/_meta/envelope
{
  "spindle_speed": {"min": 500, "max": 12000, "unit": "rpm", "context": "varies_by_program"},
  "vibration_rms": {
    "nominal": {"roughing": 2.8, "finishing": 0.9, "unit": "mm/s"},
    "alert": {"roughing": 4.2, "finishing": 1.5},
    "critical": {"roughing": 6.0, "finishing": 2.5}
  },
  "coolant_dependency": {
    "min_flow_rate_lpm": 15,
    "correlation": "vibration_rms increases ~0.3mm/s per 5lpm flow reduction below nominal"
  }
}

Notice the coolant_dependency field: this encodes a quantitative relationship between two entities. An agent consuming this envelope can calculate expected vibration given current coolant flow, compare against actual vibration and isolate whether a vibration anomaly is coolant-related or tool-related. This is grounded reasoning, not pattern matching.

How does HiveMQ make functional models queryable?

Publishing behavioral metadata to MQTT topics is the streaming-layer foundation. HiveMQ Data Intelligence capabilities elevate this by making the functional model discoverable, governed and traversable as a Semantic Graph.

Discovery: Pulse automatically catalogs entities, their attributes and their relationships as they appear in the namespace. When a new CNC machine comes online and publishes its meta/relationships and meta/envelope topics, Pulse registers it in the data catalog with its full context, no manual registration required.

Governance: Pulse enforces policies on the functional model itself. You can define rules like "every entity of type CNC_Machine must have a depends_on relationship to a coolant system" or "state machine definitions must include a FAULTED state with valid exit transitions." This prevents incomplete functional models from entering production, which is critical because an agent reasoning over an incomplete model is worse than an agent with no model at all.

Semantic Graph traversal: The Semantic Graph represents all entities, relationships and behavioral metadata as a connected graph. An agent performing root-cause analysis on a production anomaly can traverse the graph: starting from the anomalous entity, following depends_on edges to upstream dependencies, checking shares_resource edges for contention and following feeds edges to assess downstream impact. This traversal is the computational equivalent of an experienced operator's mental model, except it scales across thousands of entities and never forgets a relationship.

For a related, narrower example of encoding behavioral definitions into Pulse, see How to Compute MTBF, MTTR, and Availability in Real-Time Without a Separate Data Stack.

How does this ground agent logic in practice?

Consider a concrete manufacturing scenario. An AI agent monitoring a packaging line receives a signal: throughput at Station 7 has dropped 12% over the past 20 minutes. Without a functional model, the agent can only report the drop and maybe correlate it with local sensor readings.

With a functional model encoded in the UNS and indexed in the Semantic Graph, the agent executes a structured reasoning chain:

  1. Identify entity: Station 7, type = Packaging_Station

  2. Check state: State = RUNNING (valid; no state anomaly)

  3. Traverse dependencies: Station 7 depends_on Glue_Applicator_7A; feeds from Conveyor_6B

  4. Check upstream: Conveyor_6B throughput is normal; material supply is not the constraint

  5. Check dependency: Glue_Applicator_7A temperature is 3°C below operating envelope minimum. Behavioral spec indicates adhesive viscosity increases below this temperature, causing slower application cycles.

  6. Check root cause: Glue_Applicator_7A depends_on Hot_Water_Loop_2. Hot_Water_Loop_2 flow rate dropped 22% at 14:37; this timestamp precedes the throughput decline by approximately the thermal lag specified in the behavioral model (8-12 minutes).

  7. Recommendation: "Station 7 throughput decline is caused by reduced hot water flow to Glue Applicator 7A. Investigate Hot Water Loop 2. Estimated throughput recovery: 15-25 minutes after flow restoration, based on thermal recovery profile."

Every step in this chain relies on the functional model. The depends_on relationships, the operating envelopes, the temporal behavioral specs and the feeds topology are all encoded in the UNS and traversable through the Semantic Graph. The agent's reasoning is grounded in the operational reality defined by domain experts, not in statistical correlations that may or may not reflect causal relationships.

This is what makes industrial agentic AI fundamentally different from enterprise chatbots. The agent is not generating text; it is traversing a formally specified operational model and producing conclusions that are traceable back to explicit, human-defined relationships and constraints.

Conclusion

Functional modeling transforms a UNS from a well-organized data bus into an operational reasoning infrastructure. The investment in encoding relationships, behaviors and constraints into your information model pays compound returns as you move from dashboards and alerts toward agents that can diagnose, predict and recommend with genuine operational understanding.

Start by mapping the functional dependencies for one production line in your existing Unified Namespace. Identify the depends_on, feeds and shares_resource relationships. Encode them as retained messages on _meta topics. Then watch how quickly even simple correlation logic improves when it has behavioral context to work with.

Try HiveMQ Cloud free to build and test functional models on a managed MQTT broker, or explore the documentation for Data Hub policy configuration and topic design patterns.

Kudzai Manditereza

Kudzai is a tech influencer and electronic engineer based in Germany. As a Senior Industrial Solutions Advocate at HiveMQ, he helps developers and architects adopt MQTT, Unified Namespace (UNS), IIoT solutions, and HiveMQ for their IIoT projects. Kudzai runs a popular YouTube channel focused on IIoT and Smart Manufacturing technologies and he has been recognized as one of the Top 100 global influencers talking about Industry 4.0 online.

  • Kudzai Manditereza on LinkedIn
  • Contact Kudzai Manditereza via e-mail
HiveMQ logo
Review HiveMQ on G2