An AI agent architecture for consulting manuals and diagnosing PLCs, HMIs and drives from multiple vendors, with device access controlled by the engineer.
@KTECH · K-Tech Automation Solutions Co., Ltd.
Abstract
AI agents based on large language models (LLMs) can shorten on-site troubleshooting for PLCs, HMIs and drives when they read real data and remain under an engineer's control. This article reviews three technical foundations: retrieval-augmented generation (RAG), function calling, and the reasoning–action loop. It then surveys representative research and commercial products from 2023 to 2025.
The article proposes a reference architecture for a field agent that supports equipment from multiple vendors and can operate when the network is unavailable. It concludes with safety and security risks and seven design principles. The central requirements are read-only operation by default, two-step confirmation before writing parameters, and a traceable source for every recommendation.
Keywords: large language models, AI agents, PLC, variable-frequency drives, fault diagnosis, Modbus, RAG, industrial maintenance.
1. Introduction
Every hour of unplanned downtime is becoming more costly, while the pool of engineers experienced enough to troubleshoot faults is not growing as quickly. A 2024 Siemens report estimates that unplanned downtime costs the world's 500 largest companies nearly US$1.4 trillion annually, about 11% of revenue [1]. In automotive manufacturing, a line stoppage costs about US$2.3 million an hour, and a large plant loses about 27 production hours each month on average [1].
Deloitte and The Manufacturing Institute project that U.S. manufacturing could need up to 3.8 million new workers from 2024 to 2033. Some 1.9 million positions could remain unfilled unless the skills gap narrows [2]. Industrializing countries face similar pressure as demand for automation engineers grows faster than training capacity.
A production line at a small or midsize Vietnamese plant often combines Mitsubishi, Inovance or Siemens PLCs with Delta, INVT, ABB or Inovance drives and an HMI from another vendor. Each vendor has its own software, fault-code tables and documentation, mostly in English or Chinese. When a machine stops, field engineers must consult manuals and take measurements under pressure to restore production.
General-purpose chatbots can respond fluently, but they were not designed for this setting. They cannot read the real state of equipment and may give a plausible-sounding but incorrect parameter value. In automation, an incorrect parameter can damage a motor or endanger an operator.
This article makes four contributions.
- Summarize the technical foundations that let a language model retrieve information and read equipment data as an agent.
- Review research and commercial products that apply LLMs to industrial automation.
- Propose a reference architecture for an AI agent that assists field engineers working with equipment from multiple vendors.
- Analyze the risks, propose safe design principles and identify open research challenges.
2. From chatbots to AI agents
An AI agent can both reason and act. It selects a tool, invokes it, reads the result, and then responds. The three techniques below make this possible.
2.1. Retrieval-augmented generation (RAG)
An LLM encodes knowledge implicitly in its parameters, making it difficult to update or cite and susceptible to generating false content, known as hallucination [3]. Lewis et al. proposed RAG, which combines a text generation model with a document index accessed through a neural retriever [3]. Knowledge in the index can be edited, expanded and checked directly without retraining the model [3].
In the field, the RAG index contains PLC manuals, drive instructions, machine wiring diagrams and internal repair notes. When an engineer asks about a fault code, the system retrieves the relevant passage for the correct model before the LLM interprets it.
2.2. Function calling and the reasoning–action loop
In function calling, the application supplies the LLM with a list of tools and parameter schemas. The model returns a structured call with a function name and JSON arguments. The application executes the call and returns the result to the model. The LLM therefore has no direct access to the device. All access passes through code controlled by software engineers.
Yao et al.'s ReAct approach interleaves reasoning steps with actions that query external sources [4]. Compared with a reasoning chain alone, this reduces hallucinations and error propagation and provides a trace that is easier to inspect [4]. A typical troubleshooting loop is to propose a hypothesis, read a register to test it, rule it out when appropriate, and recommend the next step.
2.3. Standards for connecting tools
In late 2024, Anthropic introduced Model Context Protocol (MCP), an open standard for connecting AI applications to data sources and tools through a client–server model [5]. With MCP, a Modbus reader or technical document repository can be implemented once as a server and reused by multiple applications and LLMs.
| Capability level | Knowledge source | Reads equipment data | Cites sources | Main risk |
|---|---|---|---|---|
| Standalone chatbot | Model parameters | No | No | Hallucination and outdated knowledge |
| Chatbot + RAG | Parameters + indexed documents | No | Yes, by document passage | Retrieving the wrong model or document revision |
| AI agent (RAG + tools) | Documentation + real-time data | Yes, through authorized tools | Yes, from documents and measurements | Actions beyond authorized scope without adequate controls |
3. Research and commercial products
Most work from 2023 to 2025 focused on engineering tasks such as PLC programming and project configuration. Field maintenance of equipment from multiple vendors received less attention.
3.1. Academic research
Verified PLC code generation. Fakih et al. showed that GPT-4 and LLaMa2 did not produce valid PLC programs when used directly [6]. Their LLM4PLC workflow iterates with user feedback and guides the model using a syntax checker, a compiler and an SMV model checker [6]. On a FischerTechnik testbed, successful code generation rose from 47% to 72%. Expert quality scores increased from 2.25 to 7.75 out of 10 [6].
Multi-agent systems. Liu et al.'s Agents4PLC extends this approach with cooperating LLM agents that combine RAG, chain-of-thought reasoning, and source-code verification [7]. The team also released a benchmark that links natural-language requirements, formal specifications and verified reference PLC code [7].
Production control agents. Xia's team at the University of Stuttgart combined LLMs and a digital twin in a modular production system [8]. The agents read descriptions from the twin, plan actions, and call RESTful control interfaces to carry out tasks that were not preprogrammed [8]. Follow-up work organized atomic operations into microservices arranged by layers of the automation pyramid [9].
3.2. Commercial products
Siemens and Microsoft presented their Industrial Copilot vision at Hannover Messe 2023 and released the first product for TIA Portal in 2024 [10]. Customers can use a dedicated Azure OpenAI instance without having their data used to retrain the model [10]. The operations version helps operators and maintenance engineers interpret machine fault codes in natural language. Siemens plans an on-premises hardware and software package to preserve data sovereignty [11].
At SPS 2025, Siemens introduced Engineering Copilot TIA, which can carry out tasks such as creating and editing project elements, generating and testing code, and building monitoring interfaces [12]. This shift from a suggestion assistant to an agent that takes action calls for stricter controls.
| Work or product | Year | Lifecycle stage | Core technique | Notes |
|---|---|---|---|---|
| Engineering Copilot TIA (Siemens) [12] | 2025 | Engineering | Agent executes tasks in TIA Portal | Siemens ecosystem only |
| Industrial Copilot (Siemens) [10], [11] | 2024 | Engineering and operations | LLM + vendor documentation | Interprets fault codes, with on-premises deployment planned |
| Agents4PLC [7] | 2024 | Engineering | Multi-agent coordination, RAG and code verification | Benchmark dataset available |
| LLM4PLC [6] | 2024 | Engineering | Compilation and SMV verification loop, LoRA | Success rate rose from 47% to 72% |
| Xia et al. [8], [9] | 2023–2024 | Operations | Agents + digital twin + microservices | Modular laboratory production system |
A clear gap remains. Few published studies address mobile, Vietnamese-speaking maintenance agents for equipment from vendors commonly used in Asia, such as Mitsubishi, Inovance, Delta and INVT.
4. Reference architecture for a field AI agent
The proposed architecture has four layers: a multimodal phone interface, an agent orchestrator, a permission-controlled tool layer, and field devices. The LLM proposes actions, while the tool layer executes and controls all device access.

All device access passes through the tool layer. The parameter-writing tool can run only after the engineer confirms the action.
4.1. Components
Multimodal interface. Engineers can ask questions in text, by speaking Vietnamese, or by taking a photo. The image might show an HMI fault screen, a drive keypad or a motor nameplate. The interface should use large, high-contrast text and work with gloves.
Agent orchestrator. It runs the reasoning–action loop [4], manages context such as manufacturer, model and machine fault history, and applies safety policies before each tool call. The architecture is independent of the LLM vendor. A cloud model can be used online and a small local model offline.
Tool layer. Each tool has an explicit parameter schema and permission level.
| Tool | Function | Data source | Permission |
|---|---|---|---|
| Fault-code lookup | Return causes and remedies by manufacturer, model and fault code | Local structured database (SQLite) | Read-only |
| Document retrieval (RAG) | Retrieve relevant manual passages with document name and page | Indexed PDF manuals and internal notes | Read-only |
| Device reading | Read registers via Modbus RTU/TCP, including current, frequency and current or historical fault codes | RS-485 adapter or Ethernet port | Read-only, restricted to allowed registers |
| Vision | Recognize fault codes and read nameplate information from images | Phone camera | Read-only |
| Parameter writing | Write a new value to an authorized register | Field device | Disabled by default, engineer confirmation required |
| Incident log | Record symptoms, diagnosis, remedy and outcome | Local database, synced when online | Internal write access |
Offline data layer. Many workshops have weak mobile coverage, so the fault-code database, document index and logs are stored on the phone. The app can still search and read equipment when the network is down. Cloud LLM interpretation is replaced by a local model or raw lookup results.
4.2. Typical troubleshooting workflow
Consider a drive that reports an overcurrent fault during acceleration.
- The engineer photographs the drive display. The vision tool extracts the fault code and model.
- The agent invokes the fault-code lookup tool and receives a list of possible causes from the vendor's documentation.
- The agent uses RAG to retrieve the passage on acceleration time and current limits, including the page number.
- If the device is connected, the agent reads the relevant registers to rule out hypotheses such as an acceleration time set too short.
- The agent responds in Vietnamese, listing causes in order of likelihood, the next check, and the source for each point.
- If a parameter needs to change, the agent proposes it. The write occurs only when the engineer confirms it (Section 5).
- The outcome is recorded in the incident log, adding to the knowledge base for future cases.
For connectivity, tools should be packaged under an open standard such as MCP [5]. This allows the same Modbus reader to serve both the mobile app and the central SCADA system.
5. Safety risks and design principles
Once an AI agent is connected to real equipment, an incorrect answer can become an incorrect action. Safety therefore needs to be built into the architecture from the outset, without relying on the model to exercise caution on its own.
5.1. Risk categories
The 2026 OWASP Top 10 for LLM Applications, published in August 2026, keeps prompt injection at number one and moves excessive agency from sixth to third [13]. In field operations, five main risks follow.
- Technical hallucination: the model provides a parameter number, register address or setting that does not appear in the documentation.
- Unauthorized action: the agent writes a parameter while the motor is running or outside its permitted scope.
- Indirect prompt injection: material in documents, images or equipment data contains instructions that alter the agent's behavior.
- Data leakage: machine settings, PLC programs or customer know-how are sent outside the organization unintentionally.
- Overreliance: junior engineers follow the system's advice and skip measurement, inspection and independent judgment.
5.2. Seven design principles
| Principle | Implementation | Risk reduced |
|---|---|---|
| 1. Read-only by default | Separate and disable the write tool by default, enabling it per session and user | Unauthorized actions |
| 2. Two-step confirmation | Show the device, address, old and new values. Require engineer confirmation and verify that the machine is stopped | Unauthorized actions and hallucination |
| 3. Allowlist | Restrict reads and writes to declared registers for each model and enforce value limits | Hallucination and unauthorized actions |
| 4. Mandatory source citations | Attach a document title, page number or measured value to every recommendation. State explicitly when there is no source | Hallucination and overreliance |
| 5. Separate external content | Treat documents, images and equipment output solely as data, never as instructions | Indirect prompt injection |
| 6. Audit log | Record every tool call, approver and timestamp | Post-incident traceability |
| 7. Keep customer data local | Keep PLC programs and settings on the device. Send the minimum to cloud LLMs and favor local models for sensitive data | Data leakage |
One absolute limit applies: an AI agent must never interfere with safety circuits, safety PLCs or lockout/tagout (LOTO) procedures. These are functional safety matters and must be handled by authorized personnel under the plant's procedures.
6. Open challenges and future work
Six issues will determine whether field AI agents progress from prototypes to daily use.
Evaluation and benchmarks. PLC code generation already has a benchmark dataset [7], but multi-vendor fault diagnosis does not. Comparing models and agent configurations objectively requires a set of cases with symptoms, register data and verified root causes.
Language and terminology. Equipment manuals are mostly in English and Chinese, whereas Vietnamese engineers mix English terms into Vietnamese sentences. Speech recognition must also work in workshop noise, requiring real field recordings for fine-tuning.
Edge computing. Data sovereignty and weak network coverage favor moving LLMs closer to the plant, in line with the on-premises direction announced by Siemens [11]. The open question is which small models handle technical Vietnamese well enough on a phone or industrial PC.
Standardized connectivity. Each drive vendor has its own Modbus register map. A common device-description layer packaged with an open tool standard such as MCP [5] would let new vendors be added without rewriting the agent.
Knowledge feedback loop. Every resolved incident is a valuable case. An experienced engineer should review incident logs before they enter the knowledge base, to avoid propagating incorrect diagnoses.
Accountability and human oversight. As agents move from making suggestions to taking action [12], responsibility for parameter changes becomes urgent. Audit logs and two-step confirmation (Section 5) provide technical foundations, and the plant also needs an internal policy.
7. Conclusion
LLM-based AI agents have real potential to shorten fault diagnosis, particularly in plants with equipment from multiple vendors and a shortage of experienced engineers. This potential depends on grounding the agent in official vendor documentation and real measurements, rather than relying on the model's memory.
Studies of PLC code generation show that external verification loops substantially improve output quality [6], [7]. Commercial products are progressing from suggestions to automated execution [12]. This article proposes a four-layer architecture for a multi-vendor field agent that works offline, and seven safety design principles. Read-only operation by default and two-step confirmation are mandatory.
Future work includes building a multi-vendor fault-diagnosis benchmark, evaluating small edge models for technical Vietnamese, and standardizing device descriptions so new vendors can be supported.
Reference material
- Siemens, The True Cost of Downtime 2024, Senseye Predictive Maintenance, 2024.
- Deloitte and The Manufacturing Institute, Taking charge: Manufacturers support growth with active workforce strategies, 04/2024.
- P. Lewis et al., "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks", Advances in Neural Information Processing Systems 33 (NeurIPS 2020), 2020.
- S. Yao et al., "ReAct: Synergizing Reasoning and Acting in Language Models", ICLR 2023, 2023.
- Anthropic, "Introducing the Model Context Protocol", 25/11/2024.
- M. Fakih et al., "LLM4PLC: Harnessing Large Language Models for Verifiable Programming of PLCs in Industrial Control Systems", ICSE-SEIP '24, pp. 192–203, 2024, doi: 10.1145/3639477.3639743.
- Z. Liu et al., "Agents4PLC: Automating Closed-loop PLC Code Generation and Verification in Industrial Control Systems using LLM-based Agents", arXiv:2410.14209, 2024.
- Y. Xia, M. Shenoy, N. Jazdi, M. Weyrich, "Towards autonomous system: flexible modular production system enhanced with large language model agents", arXiv:2304.14721, 2023.
- Y. Xia, J. Zhang, N. Jazdi, M. Weyrich, "Incorporating Large Language Models into Production Systems for Enhanced Task Automation and Flexibility", VDI-Berichte 2437, 2024.
- Siemens, "Siemens Xcelerator: Scaling roll-out of generative AI with Siemens Industrial Copilot", press release, 22/04/2024.
- Siemens, "Siemens Industrial Copilot expanded, adopted by thyssenkrupp", press release, 12/11/2024.
- Siemens, "Siemens showcases the future of autonomous production at SPS 2025", press release, 11/2025.
- OWASP GenAI Security Project, OWASP GenAI LLM Top 10 2026, 08/2026.
Need direct help from an engineer? Call 0971028833 or send a request.



























































