<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:discourse="http://discourse.org/rss/modules/discourse/">
<channel>
<title>AI Agents on Roque</title>
<link>https://j-roque.com/tags/ai-agents/</link>
<description>Recent content in AI Agents on Roque</description>
<generator>Hugo -- gohugo.io</generator>
<language>en</language>
<managingEditor>joao.roque.94@gmail.com (João Roque)</managingEditor>
<webMaster>joao.roque.94@gmail.com (João Roque)</webMaster>
<copyright>© 2026 João Roque</copyright>
<lastBuildDate>Wed, 18 Nov 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://j-roque.com/tags/ai-agents/index.xml" rel="self" type="application/rss+xml"/>
<item>
<title>One Agent Framework, Many Problems: Taming Multi-Format File Integrations with CM MES v12</title>
<link>https://j-roque.com/posts/20261118-agenticframework/</link>
<pubDate>Wed, 18 Nov 2026 00:00:00 +0000</pubDate>
<author>joao.roque.94@gmail.com (João Roque)</author>
<guid>https://j-roque.com/posts/20261118-agenticframework/</guid>
<description>Every plant has a folder full of files that nobody wants to write a parser for. MES v12 ships an agent framework where agents, tools and runtime are MES entities. This post wires an agent into Connect IoT to read CMM reports, German CSVs and XML gauge exports into the same Data Collection, and shows why the same centralized approach works for monitoring and control.</description>
<content:encoded>&lt;p&gt;&lt;img src="https://j-roque.com/posts/20261118-agenticframework/featured.png" alt="One Agent Framework, Many Problems: Taming Multi-Format File Integrations with CM MES v12" /&gt;&lt;/p&gt;&lt;p&gt;Every plant has a shared folder where equipment drops its results. Nobody owns it, every machine writes a different format, and the integration backlog has a ticket for each one.&lt;/p&gt;
&lt;p&gt;MES v12 changes how we attack that folder. Not with a smarter parser, but with an &lt;strong&gt;agent framework&lt;/strong&gt; built into the MES itself, where agents, their tools and their runtime are configured, secured and shipped like any other MES entity.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 class="relative group"&gt;Overview
&lt;/h2&gt;
&lt;p&gt;The v12 release introduced the &lt;a
href="https://help.criticalmanufacturing.com/12.0/userguide/administration/ai/ai_agent/"
target="_blank"
&gt;AI Agent&lt;/a&gt; and &lt;a
href="https://help.criticalmanufacturing.com/12.0/userguide/administration/ai/ai_mcp_server/"
target="_blank"
&gt;AI MCP Server&lt;/a&gt; entity types, system MCP servers that expose the MES to models, and a runtime (&lt;a
href="https://developer.criticalmanufacturing.com/12.0/learn/concepts/gen-ai/librechat_integration/"
target="_blank"
&gt;LibreChat&lt;/a&gt;) that the MES keeps in sync. Most people meet it through the chat panel. I want to show the other side: agents as building blocks that &lt;code&gt;Connect IoT&lt;/code&gt; workflows call, headless, in the middle of an integration.&lt;/p&gt;
&lt;p&gt;The case study is file-based data collection. One product, several measuring machines, and every one of them speaks its own dialect.&lt;/p&gt;
&lt;p&gt;In &lt;a
href="https://j-roque.com/posts/20260218-frominsighttoaction/"
target="_blank"
&gt;From Insight to Action&lt;/a&gt; I argued that AI only matters when it closes the loop into the MES. This is that argument with a working integration behind it.&lt;/p&gt;
&lt;h2 class="relative group"&gt;The Problem: One Part, Three Dialects
&lt;/h2&gt;
&lt;p&gt;Take a machined aluminum housing. Its final inspection produces data from three places:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Source&lt;/th&gt;
&lt;th&gt;Format&lt;/th&gt;
&lt;th&gt;Quirks&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CMM report&lt;/td&gt;
&lt;td&gt;Fixed-width text, several sections&lt;/td&gt;
&lt;td&gt;Nominal, tolerance and deviation columns next to the actual value; roughness traces in µm in a separate section&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Line QC station&lt;/td&gt;
&lt;td&gt;Semicolon CSV, German headers&lt;/td&gt;
&lt;td&gt;Decimal comma, dimensions in µm, leak rate in Pa·m³/s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;In-line air gauge&lt;/td&gt;
&lt;td&gt;XML with coded feature names&lt;/td&gt;
&lt;td&gt;&lt;code&gt;BORE_D2_TP&lt;/code&gt; instead of a name, station temperature in °F, a feature skipped on probe fault&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;All three files describe the same kind of part. Here they are as they come off the shop floor.&lt;/p&gt;
&lt;h3 class="relative group"&gt;The CMM report
&lt;/h3&gt;
&lt;p&gt;A fixed-width report built for a person to read. The actual value sits between nominal, tolerances and deviation. Form and position use a different column layout from size. Roughness is a separate table with three traces and three roughness measures, and only one of them (Ra) is wanted. The room temperature is in the header.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-text"&gt;==============================================================================
  CMM INSPECTION REPORT                                   Page 1 of 2
==============================================================================
  Machine      : CMM-01  (bridge type, probe head PH20)
  Program      : HOUSING_A12_FULL  rev. C
  Drawing      : A12-HSG-0007 rev. F
  Part / S/N   : SN-0042819
  Operator     : OP07          Shift: 2
  Started      : 2026-11-18 08:14:52      Finished: 2026-11-18 08:21:07
  Alignment    : 3-2-1 on datums A (base), B (bore D1), C (side)
  Units        : mm / deg
  Room temp.   : 20.4 C   (part temp. comp. ON, CTE 23.6e-6/K)
------------------------------------------------------------------------------
 SECTION 1 - SIZE
------------------------------------------------------------------------------
 #  Characteristic             Nominal     Up.Tol   Lo.Tol    Measured   Dev.
 1  DIA  Bore D1               12.000      &amp;#43;0.020   -0.020    12.006     &amp;#43;0.006
 2  DIA  Bore D2                8.000      &amp;#43;0.015   -0.015     8.004     &amp;#43;0.004
 3  DIST Centre D1 -&amp;gt; D2       42.000      &amp;#43;0.030   -0.030    42.012     &amp;#43;0.012
 4  LEN  Overall length (X)    84.500      &amp;#43;0.100   -0.100    84.455     -0.045
 5  LEN  Overall width (Y)     32.000      &amp;#43;0.050   -0.050    32.021     &amp;#43;0.021
------------------------------------------------------------------------------
 SECTION 2 - FORM AND POSITION
------------------------------------------------------------------------------
 #  Characteristic             Tol. zone                       Measured   Use
 6  ROUNDNESS  Bore D1         0.010                           0.0042     OK
 7  FLATNESS   Top face        0.050                           0.027      OK
 8  PARALLEL   Top face // A   0.030                           0.014      OK
 9  POSITION   Bore D2  |A|B|  0.050 (dia.)                    0.018      OK
------------------------------------------------------------------------------
 SECTION 3 - SURFACE (profilometer PRF-2, Lc 0.8 mm, 3 traces on sealing face)
------------------------------------------------------------------------------
 Trace     Ra [um]    Rz [um]    Rmax [um]
   1        0.82       5.1        6.0
   2        0.79       4.9        5.7
   3        0.85       5.3        6.2
 Max Ra allowed 1.6 um
==============================================================================
 Characteristics: 9 &amp;#43; surface     Out of tolerance: 0      RESULT: ACCEPTED
==============================================================================&lt;/code&gt;&lt;/pre&gt;
&lt;h3 class="relative group"&gt;The line QC export
&lt;/h3&gt;
&lt;p&gt;A semicolon CSV from a German line, with comment lines before the header. Dimensions are in micrometres, not millimetres, and use a decimal comma (&lt;code&gt;3,1&lt;/code&gt;). Hardness and a helium leak test appear here but nowhere else, and the leak rate is in Pa·m³/s while the MES expects mbar·l/s.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-csv"&gt;# QS-Linie 3 - Prüfprotokoll Export v2.4
# Teil-Nr.;A12-HSG-0007;Seriennr.;SN-0042820;Prüfplatz;LQ-3;Datum;18.11.2026 09:02:44
# Dezimaltrennzeichen: Komma
Pos;Merkmal;Prüfmittel;Sollwert;OT;UT;Istwert;Einheit;Bewertung
10;Bohrung D1 Durchmesser;Messdorn MD-12;12000;20;-20;12011;µm;i.O.
20;Bohrung D2 Durchmesser;Messdorn MD-08;8000;15;-15;7993;µm;i.O.
30;Abstand Bohrungsmitte D1-D2;Messvorrichtung MV-4;42000;30;-30;41988;µm;i.O.
40;Rundheit Bohrung D1;Formtester FT-1;0;10;0;3,1;µm;i.O.
50;Position Bohrung D2 (A|B);Messvorrichtung MV-4;0;50;0;22;µm;i.O.
60;Ebenheit Deckfläche;Messtisch MT-2;0;50;0;28;µm;i.O.
70;Parallelität Deckfläche zu A;Messtisch MT-2;0;30;0;11;µm;i.O.
80;Gesamtlänge;Messschieber MS-200;84500;100;-100;84471;µm;i.O.
90;Gesamtbreite;Messschieber MS-200;32000;50;-50;31986;µm;i.O.
100;Härte;Härteprüfer HP-V;;;;112;HV10;i.O.
110;Dichtheit Helium (integral);Lecksucher LS-He;;1,0E-05;;3,4E-07;Pa·m³/s;i.O.
# Ende des Protokolls - 11 Merkmale, 0 n.i.O.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 class="relative group"&gt;The air gauge result
&lt;/h3&gt;
&lt;p&gt;An XML export where features are codes, not names: &lt;code&gt;BORE_D2_TP&lt;/code&gt; is the true position of bore D2, &lt;code&gt;BORE_D1_CIRC&lt;/code&gt; is roundness. The station temperature is in Fahrenheit. Feature &lt;code&gt;F07&lt;/code&gt; is missing from the list, and the reason is only given in a free-text &lt;code&gt;&amp;lt;Status&amp;gt;&lt;/code&gt; at the end.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-xml"&gt;&amp;lt;?xml version=&amp;#34;1.0&amp;#34; encoding=&amp;#34;UTF-8&amp;#34;?&amp;gt;
&amp;lt;!-- In-line air gauge station AG-5, result export. Station temperature is reported in Fahrenheit. --&amp;gt;
&amp;lt;GaugeResult station=&amp;#34;AG-5&amp;#34; program=&amp;#34;HSG_A12_INLINE&amp;#34; version=&amp;#34;3.1&amp;#34;&amp;gt;
  &amp;lt;Header&amp;gt;
    &amp;lt;Serial&amp;gt;SN-0042821&amp;lt;/Serial&amp;gt;
    &amp;lt;Timestamp&amp;gt;2026-11-18T09:40:18Z&amp;lt;/Timestamp&amp;gt;
    &amp;lt;Operator id=&amp;#34;OP11&amp;#34;/&amp;gt;
    &amp;lt;Environment&amp;gt;
      &amp;lt;StationTemperature unit=&amp;#34;degF&amp;#34;&amp;gt;68.9&amp;lt;/StationTemperature&amp;gt;
      &amp;lt;Humidity unit=&amp;#34;%RH&amp;#34;&amp;gt;44&amp;lt;/Humidity&amp;gt;
    &amp;lt;/Environment&amp;gt;
  &amp;lt;/Header&amp;gt;
  &amp;lt;Measurements unit=&amp;#34;mm&amp;#34;&amp;gt;
    &amp;lt;Feature code=&amp;#34;F01&amp;#34; name=&amp;#34;BORE_D1_DIA&amp;#34;       nominal=&amp;#34;12.000&amp;#34; tol=&amp;#34;&amp;#43;/-0.020&amp;#34;&amp;gt;&amp;lt;Value&amp;gt;12.009&amp;lt;/Value&amp;gt;&amp;lt;/Feature&amp;gt;
    &amp;lt;Feature code=&amp;#34;F02&amp;#34; name=&amp;#34;BORE_D2_DIA&amp;#34;       nominal=&amp;#34;8.000&amp;#34;  tol=&amp;#34;&amp;#43;/-0.015&amp;#34;&amp;gt;&amp;lt;Value&amp;gt;7.998&amp;lt;/Value&amp;gt;&amp;lt;/Feature&amp;gt;
    &amp;lt;Feature code=&amp;#34;F03&amp;#34; name=&amp;#34;BORE_PITCH_D1_D2&amp;#34;  nominal=&amp;#34;42.000&amp;#34; tol=&amp;#34;&amp;#43;/-0.030&amp;#34;&amp;gt;&amp;lt;Value&amp;gt;42.006&amp;lt;/Value&amp;gt;&amp;lt;/Feature&amp;gt;
    &amp;lt;Feature code=&amp;#34;F04&amp;#34; name=&amp;#34;BORE_D1_CIRC&amp;#34;      nominal=&amp;#34;0&amp;#34;      tol=&amp;#34;0.010&amp;#34;&amp;gt;&amp;lt;Value&amp;gt;0.0055&amp;lt;/Value&amp;gt;&amp;lt;/Feature&amp;gt;
    &amp;lt;Feature code=&amp;#34;F05&amp;#34; name=&amp;#34;BORE_D2_TP&amp;#34;        nominal=&amp;#34;0&amp;#34;      tol=&amp;#34;0.050&amp;#34;&amp;gt;&amp;lt;Value&amp;gt;0.031&amp;lt;/Value&amp;gt;&amp;lt;/Feature&amp;gt;
    &amp;lt;Feature code=&amp;#34;F06&amp;#34; name=&amp;#34;TOP_FACE_FLAT&amp;#34;     nominal=&amp;#34;0&amp;#34;      tol=&amp;#34;0.050&amp;#34;&amp;gt;&amp;lt;Value&amp;gt;0.019&amp;lt;/Value&amp;gt;&amp;lt;/Feature&amp;gt;
    &amp;lt;Feature code=&amp;#34;F08&amp;#34; name=&amp;#34;LENGTH_X&amp;#34;          nominal=&amp;#34;84.500&amp;#34; tol=&amp;#34;&amp;#43;/-0.100&amp;#34;&amp;gt;&amp;lt;Value&amp;gt;84.517&amp;lt;/Value&amp;gt;&amp;lt;/Feature&amp;gt;
    &amp;lt;Feature code=&amp;#34;F09&amp;#34; name=&amp;#34;WIDTH_Y&amp;#34;           nominal=&amp;#34;32.000&amp;#34; tol=&amp;#34;&amp;#43;/-0.050&amp;#34;&amp;gt;&amp;lt;Value&amp;gt;31.994&amp;lt;/Value&amp;gt;&amp;lt;/Feature&amp;gt;
  &amp;lt;/Measurements&amp;gt;
  &amp;lt;Surface instrument=&amp;#34;PRF-2&amp;#34; unit=&amp;#34;um&amp;#34; parameter=&amp;#34;Ra&amp;#34;&amp;gt;
    &amp;lt;Trace n=&amp;#34;1&amp;#34;&amp;gt;0.91&amp;lt;/Trace&amp;gt;
    &amp;lt;Trace n=&amp;#34;2&amp;#34;&amp;gt;0.88&amp;lt;/Trace&amp;gt;
  &amp;lt;/Surface&amp;gt;
  &amp;lt;Status&amp;gt;F07 skipped: probe fault on parallelism fixture&amp;lt;/Status&amp;gt;
&amp;lt;/GaugeResult&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Three layouts and three naming styles for the same features. The units differ too: millimetres or micrometres, Celsius or Fahrenheit. And some optional values appear in only one of the files.&lt;/p&gt;
&lt;p&gt;The MES does not care about any of that. It wants one &lt;strong&gt;Data Collection&lt;/strong&gt; with clean parameters: &lt;code&gt;BoreDiameter1&lt;/code&gt;, &lt;code&gt;Flatness&lt;/code&gt;, &lt;code&gt;SurfaceRoughnessRa&lt;/code&gt;, in millimetres, with the right sample and reading structure.&lt;/p&gt;
&lt;p&gt;The classic answer is a parser per format. Three formats today, seven next year, each with a regex that breaks the day a vendor adds a column. The parser is never the hard part. Keeping twenty of them alive is.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The cost of file integration is not writing the first parser. It is owning the twentieth.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;p&gt;&lt;figure&gt;&lt;img
class="my-0 rounded-md"
loading="lazy"
decoding="async"
fetchpriority="low"
alt="Agentic Workflow"
src="https://image.j-roque.com/posts/20261118-agenticframework/agentic_file_parser.gif"
&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 class="relative group"&gt;What v12 Brings: Agents as MES Entities
&lt;/h2&gt;
&lt;p&gt;The framework is small, and that is its strength. Four concepts carry it:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Concept&lt;/th&gt;
&lt;th&gt;What it is&lt;/th&gt;
&lt;th&gt;Why it matters&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AI Agent&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Instructions, model, provider and allowed tools, stored as an MES entity&lt;/td&gt;
&lt;td&gt;Versioned, secured and exportable like a Data Collection or a Workflow&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AI MCP Server&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A registered tool server (MES, Data Platform, documentation, your own) with its authentication mode&lt;/td&gt;
&lt;td&gt;Tools are granted per agent, not per prompt&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Runtime synchronization&lt;/td&gt;
&lt;td&gt;The MES pushes agents and servers to the runtime and tracks the result&lt;/td&gt;
&lt;td&gt;One source of truth, no hand-configured chat platform&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;System MCP servers&lt;/td&gt;
&lt;td&gt;&lt;code&gt;CM MES&lt;/code&gt;, &lt;code&gt;CM MES Entity Query&lt;/code&gt;, &lt;code&gt;CM Data OData&lt;/code&gt; and others, shipped with the product&lt;/td&gt;
&lt;td&gt;The agent can ask the MES questions without custom code&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The agent for this case is an ordinary entity: a name, a model, a provider, and a runtime it is published to.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: center"&gt;&lt;figure&gt;&lt;img
class="my-0 rounded-md"
loading="lazy"
decoding="async"
fetchpriority="low"
alt="The File Parser agent in the MES"
src="https://image.j-roque.com/posts/20261118-agenticframework/agent-details.png"
&gt;&lt;/figure&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: center"&gt;&lt;em&gt;The agent is an MES entity: model, provider, runtime and synchronization status in one place.&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Its reach into the MES is explicit. It gets the &lt;code&gt;CM MES&lt;/code&gt; MCP server and only the tools it needs, listed on the agent itself.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: center"&gt;&lt;figure&gt;&lt;img
class="my-0 rounded-md"
loading="lazy"
decoding="async"
fetchpriority="low"
alt="MCP tools granted to the agent"
src="https://image.j-roque.com/posts/20261118-agenticframework/agent-mcp-tools.png"
&gt;&lt;/figure&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: center"&gt;&lt;em&gt;Tools are granted per agent. Nothing here can write to the MES.&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The tool server itself is another entity, with its endpoint and authentication defined once and reused by every agent that needs it.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: center"&gt;&lt;figure&gt;&lt;img
class="my-0 rounded-md"
loading="lazy"
decoding="async"
fetchpriority="low"
alt="The CM MES system MCP server"
src="https://image.j-roque.com/posts/20261118-agenticframework/mcp-server-cmmes.png"
&gt;&lt;/figure&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: center"&gt;&lt;em&gt;The &lt;code&gt;CM MES&lt;/code&gt; system MCP server. OAuth means tool calls run with a real MES identity, not a shared secret.&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This is the part that is easy to undersell. Before v12, &amp;ldquo;add AI&amp;rdquo; meant a side project with its own credentials, its own prompts in a config file and its own idea of who is allowed to do what. Now the agent lives where the rest of the manufacturing model lives.&lt;/p&gt;
&lt;h2 class="relative group"&gt;The Agent: Ask the MES, Don&amp;rsquo;t Hard-Code It
&lt;/h2&gt;
&lt;p&gt;The agent is the &lt;strong&gt;Data Collection File Interpreter&lt;/strong&gt;. Its contract is narrow on purpose: read a file, map it to the parameters of a named Data Collection, return JSON. It never posts and never judges limits.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: center"&gt;&lt;figure&gt;&lt;img
class="my-0 rounded-md"
loading="lazy"
decoding="async"
fetchpriority="low"
alt="Agent instructions"
src="https://image.j-roque.com/posts/20261118-agenticframework/agent-instructions.png"
&gt;&lt;/figure&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: center"&gt;&lt;em&gt;The instructions are the whole program: procedure, hard rules and an output contract.&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The important design choice is in step 1 and 2 of the procedure. The agent does not carry the parameter list in its prompt. It asks the MES:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;get_object_by_name&lt;/code&gt; resolves the Data Collection and returns its &lt;code&gt;Id&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;then we can call other tools to retrieve all the parameters and their specification&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The consequence is what makes this scale: &lt;strong&gt;change the Data Collection in the MES and the agent follows&lt;/strong&gt;. Add a parameter, mark one optional, change its unit, and the next file is mapped against the new definition. No prompt edit, no redeploy.&lt;/p&gt;
&lt;p&gt;The input or prompt the agent expects is a plain JSON message built by the workflow:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-json"&gt;{
  &amp;#34;fileName&amp;#34;: &amp;#34;housing_a12_SN-0042820_lineqc.csv&amp;#34;,
  &amp;#34;fileContent&amp;#34;: &amp;#34;Pos;Merkmal;Prüfmittel;Sollwert;OT;UT;Istwert;Einheit;Bewertung\n10;Bohrung D1 Durchmesser;...&amp;#34;,
  &amp;#34;dataCollection&amp;#34;: &amp;#34;DC_Housing_A12_FullInspection&amp;#34;,
  &amp;#34;material&amp;#34;: null,
  &amp;#34;resource&amp;#34;: &amp;#34;CMM-01&amp;#34;,
  &amp;#34;defaultSampleId&amp;#34;: null
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And the output is a contract, not prose. This is a real answer for the CMM report of serial &lt;code&gt;SN-0042817&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-json"&gt;{
  &amp;#34;status&amp;#34;: &amp;#34;ok&amp;#34;,
  &amp;#34;dataCollection&amp;#34;: &amp;#34;DC_Housing_A12_Final&amp;#34;,
  &amp;#34;material&amp;#34;: &amp;#34;LOT-A12-1107&amp;#34;,
  &amp;#34;rawData&amp;#34;: {
    &amp;#34;BoreDiameter1&amp;#34;: { &amp;#34;value&amp;#34;: &amp;#34;12.008&amp;#34;, &amp;#34;sampleId&amp;#34;: &amp;#34;Sample 1&amp;#34; },
    &amp;#34;BoreDiameter2&amp;#34;: { &amp;#34;value&amp;#34;: &amp;#34;7.996&amp;#34;, &amp;#34;sampleId&amp;#34;: &amp;#34;Sample 1&amp;#34; },
    &amp;#34;Flatness&amp;#34;: { &amp;#34;value&amp;#34;: &amp;#34;0.031&amp;#34;, &amp;#34;sampleId&amp;#34;: &amp;#34;Sample 1&amp;#34; },
    &amp;#34;OverallLength&amp;#34;: { &amp;#34;value&amp;#34;: &amp;#34;84.462&amp;#34;, &amp;#34;sampleId&amp;#34;: &amp;#34;Sample 1&amp;#34; }
  },
  &amp;#34;mappings&amp;#34;: [
    { &amp;#34;parameter&amp;#34;: &amp;#34;BoreDiameter1&amp;#34;, &amp;#34;source&amp;#34;: &amp;#34;Bore D1 Diameter (ACTUAL)&amp;#34;, &amp;#34;confidence&amp;#34;: &amp;#34;high&amp;#34; },
    { &amp;#34;parameter&amp;#34;: &amp;#34;BoreDiameter2&amp;#34;, &amp;#34;source&amp;#34;: &amp;#34;Bore D2 Diameter (ACTUAL)&amp;#34;, &amp;#34;confidence&amp;#34;: &amp;#34;high&amp;#34; },
    { &amp;#34;parameter&amp;#34;: &amp;#34;Flatness&amp;#34;, &amp;#34;source&amp;#34;: &amp;#34;Flatness Top Face (ACTUAL)&amp;#34;, &amp;#34;confidence&amp;#34;: &amp;#34;high&amp;#34; },
    { &amp;#34;parameter&amp;#34;: &amp;#34;OverallLength&amp;#34;, &amp;#34;source&amp;#34;: &amp;#34;Overall Length (ACTUAL)&amp;#34;, &amp;#34;confidence&amp;#34;: &amp;#34;high&amp;#34; }
  ],
  &amp;#34;unmapped&amp;#34;: [],
  &amp;#34;missing&amp;#34;: [],
  &amp;#34;warnings&amp;#34;: [&amp;#34;The file has Part ID SN-0042817. I did not use it as the sampleId. defaultSampleId was null, so I used \&amp;#34;Sample 1\&amp;#34;.&amp;#34;]
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Every value is traceable to a label in the file, every conversion is declared in &lt;code&gt;warnings&lt;/code&gt;, and a missing mandatory parameter goes to &lt;code&gt;missing&lt;/code&gt; instead of being invented.&lt;/p&gt;
&lt;h2 class="relative group"&gt;The Connect IoT Side: Deterministic Around the Probabilistic
&lt;/h2&gt;
&lt;p&gt;The agent is one task in a workflow, not the workflow. The &lt;code&gt;File Parser&lt;/code&gt; page is classic &lt;code&gt;Connect IoT&lt;/code&gt;: a file watcher raises &lt;code&gt;OnNewFile&lt;/code&gt;, the driver reads the content, an &lt;code&gt;Entity Instance&lt;/code&gt; task resolves the resource the controller runs on, and everything is handed to a sub-workflow.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: center"&gt;&lt;figure&gt;&lt;img
class="my-0 rounded-md"
loading="lazy"
decoding="async"
fetchpriority="low"
alt="File Parser workflow"
src="https://image.j-roque.com/posts/20261118-agenticframework/workflow-file-parser.png"
&gt;&lt;/figure&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: center"&gt;&lt;em&gt;Plain Connect IoT: file event, read, resolve the resource, call the agent sub-workflow.&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The &lt;code&gt;Agent Flow&lt;/code&gt; sub-workflow is where the pattern lives: &lt;strong&gt;Run Agent&lt;/strong&gt;, then a code task that validates the answer, then the out-of-the-box &lt;strong&gt;Data Collection&lt;/strong&gt; task. A rejected answer is logged and the file is moved to a dead-letter folder.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: center"&gt;&lt;figure&gt;&lt;img
class="my-0 rounded-md"
loading="lazy"
decoding="async"
fetchpriority="low"
alt="Agent Flow sub-workflow"
src="https://image.j-roque.com/posts/20261118-agenticframework/workflow-agent-flow.png"
&gt;&lt;/figure&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: center"&gt;&lt;em&gt;Agent, guard clause, Data Collection. The agent never touches the MES directly.&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 class="relative group"&gt;The Run Agent task
&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;Run Agent&lt;/code&gt; is a small custom task in an &lt;a
href="https://j-roque.com/posts/20260702-codetasktocustomtask/"
target="_blank"
&gt;Automation Task Library&lt;/a&gt;. The agent is picked in the designer from the MES entity list, the prompt comes from a setting or an input, and the task calls a thin business service wrapping &lt;code&gt;IAIAgent.RunPrompt&lt;/code&gt; (the platform also documents an &lt;a
href="https://developer.criticalmanufacturing.com/12.0/learn/concepts/gen-ai/agent_prompt_api/"
target="_blank"
&gt;Agent prompt API&lt;/a&gt;). The core of it fits on one screen:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-typescript"&gt;public override async onChanges(changes: Task.Changes): Promise&amp;lt;void&amp;gt; {
    if (changes[&amp;#34;activate&amp;#34;]) {
        this.activate = undefined;
        try {
            // The input, when linked, wins over the setting for this activation
            const picked: string | { Name?: string } = changes[&amp;#34;agentName&amp;#34;]?.currentValue ?? this.agentName;
            const agentName = typeof picked === &amp;#34;string&amp;#34; ? picked : picked?.Name;
            const prompt = changes[&amp;#34;prompt&amp;#34;]?.currentValue ?? this.prompt;
            if (!agentName?.trim()) { throw new Error(&amp;#34;RunAgent: &amp;#39;agentName&amp;#39; is required&amp;#34;); }
            if (!prompt?.trim()) { throw new Error(&amp;#34;RunAgent: &amp;#39;prompt&amp;#39; is required&amp;#34;); }
const input = new RunAgentPromptInput();
            input.AgentName = agentName;
            input.Prompt = prompt;
this._logger.info(`RunAgent: calling agent &amp;#39;${agentName}&amp;#39; (prompt: ${prompt.length} characters)`);
            const startedAt = Date.now();
            const output = await this._systemAPI.call&amp;lt;BaseOutput &amp;amp; { Response: string }&amp;gt;(input);
            const response = output?.Response ?? &amp;#34;&amp;#34;;
            this._logger.info(`RunAgent: agent &amp;#39;${agentName}&amp;#39; answered in ${Date.now() - startedAt} ms (response: ${response.length} characters)`);
this.response.emit(response);
            this.success.emit(true);
        } catch (error) {
            this.logAndEmitError((error as Error)?.message ?? String(error));
        }
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note what the info log does not contain: the prompt. These prompts carry whole equipment files. Sizes and timings go to info, a truncated preview goes to debug, and that is a rule worth keeping for every task that talks to a model.&lt;/p&gt;
&lt;h3 class="relative group"&gt;The guard clause
&lt;/h3&gt;
&lt;p&gt;The model&amp;rsquo;s own &lt;code&gt;status&lt;/code&gt; is never trusted blindly. A code task re-checks the answer, deterministically, before anything reaches the MES:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-typescript"&gt;/** Downgrades &amp;#34;ok&amp;#34; when the evidence in the response does not support it. */
function effectiveStatus(r: AgentResponse): Status {
    if (r.status !== &amp;#39;ok&amp;#39;) {
        return r.status;
    }
    const allHighConfidence = r.mappings.every(m =&amp;gt; m.confidence === &amp;#39;high&amp;#39;);
    const everyMappingHasData = r.mappings.every(m =&amp;gt; m.parameter in r.rawData);
    const hasData = Object.keys(r.rawData).length &amp;gt; 0;
return r.missing.length === 0 &amp;amp;&amp;amp; allHighConfidence &amp;amp;&amp;amp; everyMappingHasData &amp;amp;&amp;amp; hasData
        ? &amp;#39;ok&amp;#39;
        : &amp;#39;needs_review&amp;#39;;
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;ok&lt;/code&gt; goes to the Data Collection task. &lt;code&gt;needs_review&lt;/code&gt; goes to a human. Anything else is rejected with a reason. The final word on limits, SPC and protocols stays where it always was: the MES validates the post exactly as it would for any other integration.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Flexible on the input side, strict on the output side. That is the whole trick.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 class="relative group"&gt;The Result
&lt;/h2&gt;
&lt;p&gt;Three formats, one Data Collection. The full inspection version has thirteen parameters: nine mandatory dimensions and GD&amp;amp;T characteristics, plus four optional ones that only some sources provide.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: center"&gt;&lt;figure&gt;&lt;img
class="my-0 rounded-md"
loading="lazy"
decoding="async"
fetchpriority="low"
alt="Full inspection Data Collection"
src="https://image.j-roque.com/posts/20261118-agenticframework/dc-full-inspection-parameters.png"
&gt;&lt;/figure&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: center"&gt;&lt;em&gt;&lt;code&gt;DC_Housing_A12_FullInspection&lt;/code&gt;: the agent reads this definition at runtime. Note the v12 &lt;code&gt;Ask AI&lt;/code&gt; action on the entity itself.&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The optional parameters are where hand-written parsers usually crack, because every source covers a different subset:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;Optional values present&lt;/th&gt;
&lt;th&gt;Mandatory missing&lt;/th&gt;
&lt;th&gt;Expected outcome&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CMM report (&lt;code&gt;.txt&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Roughness Ra (3 traces), ambient temperature&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ok&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Line QC (&lt;code&gt;.csv&lt;/code&gt;, German)&lt;/td&gt;
&lt;td&gt;Hardness HV10, helium leak rate (Pa·m³/s → mbar·l/s)&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ok&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Air gauge (&lt;code&gt;.xml&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Roughness Ra (2 traces), temperature (°F → °C)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Parallelism&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;needs_review&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The agent maps what is there, converts only what is unambiguous, and reports what is not there. Here is what lands in the MES after the CSV run: values that arrived in micrometres under German labels, posted in millimetres against the right parameters.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: center"&gt;&lt;figure&gt;&lt;img
class="my-0 rounded-md"
loading="lazy"
decoding="async"
fetchpriority="low"
alt="Data Collection instance"
src="https://image.j-roque.com/posts/20261118-agenticframework/dc-instance-data.png"
&gt;&lt;/figure&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: center"&gt;&lt;em&gt;From &lt;code&gt;Bohrung D1 Durchmesser;...;12011;µm&lt;/code&gt; to &lt;code&gt;Bore D1 Diameter (mm) = 12.011&lt;/code&gt;.&lt;/em&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;No parser was written for that CSV. Nothing in the workflow changed between the three formats.&lt;/p&gt;
&lt;h2 class="relative group"&gt;Shipping It Like Everything Else
&lt;/h2&gt;
&lt;p&gt;An agent you configure by hand in one environment is a demo. An agent in source control is a feature.&lt;/p&gt;
&lt;p&gt;Because the agent is an MES entity, it exports like one. We export it with the standard &lt;code&gt;ExportObjects&lt;/code&gt; service, commit the XML to the &lt;code&gt;Data&lt;/code&gt; package, and register it with an &lt;code&gt;ImportObject&lt;/code&gt; master data row, next to the Data Collection it serves. Install the package in another environment and the agent, its instructions and its granted tools arrive together, and the MES synchronizes it to that environment&amp;rsquo;s runtime.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;With the new feature in v12 of the Global Data Orchestrator you can even manage it from a Center of Excellence and then deploy it to all your sites.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That is the &lt;a
href="https://j-roque.com/posts/20261001-buildvsbuy/"
target="_blank"
&gt;Build vs Buy&lt;/a&gt; argument in miniature. The cheap part was writing the instructions. The valuable part is that versioning, deployment, security and audit came from the platform.&lt;/p&gt;
&lt;h2 class="relative group"&gt;One Framework, Many Problems
&lt;/h2&gt;
&lt;p&gt;File parsing is the example, not the point. The same four pieces (an agent entity, granted tools, a workflow that calls it, and a deterministic guard) cover a much wider band of problems:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Problem&lt;/th&gt;
&lt;th&gt;Trigger&lt;/th&gt;
&lt;th&gt;What the agent does&lt;/th&gt;
&lt;th&gt;Guard&lt;/th&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Data collection&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;File or message arrives&lt;/td&gt;
&lt;td&gt;Maps unstructured content to an MES definition it reads at runtime&lt;/td&gt;
&lt;td&gt;Schema and status check in a code task&lt;/td&gt;
&lt;td&gt;Data Collection task posts, MES validates limits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Monitoring&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Alarm burst, scheduled check, drifting KPI&lt;/td&gt;
&lt;td&gt;Reads history through MES and Data Platform tools, explains the likely cause&lt;/td&gt;
&lt;td&gt;Confidence and source citations required&lt;/td&gt;
&lt;td&gt;Notification, Shift Handover entry, maintenance request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Control&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Process deviation, recipe drift&lt;/td&gt;
&lt;td&gt;Proposes a corrective setpoint or recipe adjustment within an allowed envelope&lt;/td&gt;
&lt;td&gt;Hard limits in the workflow, optional human approval via &lt;a
href="https://j-roque.com/posts/20260611-businessscenario/"
target="_blank"
&gt;Business Scenarios&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Connect IoT writes to the equipment only after the guard passes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The progression is deliberate. Data collection is low risk: the MES validates everything after the fact. Monitoring adds judgement but no actuation. Control is where the guard stops being a nice-to-have and becomes the design.&lt;/p&gt;
&lt;p&gt;What does not change across the three is the centre. One place to define agents. One place to grant tools. One identity model for who the agent acts as. One runtime that the MES keeps in sync. That is what &lt;strong&gt;centralized&lt;/strong&gt; means here: not one big agent, but one way of building and governing many small ones.&lt;/p&gt;
&lt;p&gt;Compare that with the alternative most plants are drifting into: a chatbot here, a Python script calling an API key there, a vendor&amp;rsquo;s &amp;ldquo;AI module&amp;rdquo; in the historian. Each one is reasonable on its own. Together they are ungovernable.&lt;/p&gt;
&lt;h2 class="relative group"&gt;Final Thoughts
&lt;/h2&gt;
&lt;p&gt;The folder full of files is not going away. Equipment vendors will keep inventing formats faster than anyone can write parsers.&lt;/p&gt;
&lt;p&gt;What v12 changes is where the intelligence lives. Agents are MES entities, tools are granted not improvised, and the workflow engine keeps the deterministic parts deterministic. The model reads the chaos. The MES decides what is true.&lt;/p&gt;
&lt;p&gt;Start with data collection, where the MES already checks the answer. Then move up the stack. The framework is the same all the way to control. Only the guard gets stricter.&lt;/p&gt;
&lt;p&gt;Next blogs I&amp;rsquo;ll show case more business use cases and how we can have human in the loop flow and a multi agent assessment. Stay tuned for more!&lt;/p&gt;
</content:encoded>
<enclosure url="https://j-roque.com/posts/20261118-agenticframework/featured.png" type="image/png" length="0"/>
<media:content url="https://j-roque.com/posts/20261118-agenticframework/featured.png" type="image/png" medium="image"/>
</item>
</channel>
</rss>