Skip to main content
5-Regular Member
June 10, 2025
Question

Using an LLM with ThingWorx

  • June 10, 2025
  • 0 replies
  • 1430 views

Everyone is talking about Generative AI, Large Language Models (LLMs) in particular. They are being used to provide Customer Service assistance in Chatbots, automate writing code in software development, summarizing long articles, documents, and data stores, among many other use cases. LLMs have the ability to ingest huge amounts of data, process queries related to that data, find patterns, and provide answers to natural language questions asked of the model.

 

Could LLMs be used to provide greater insights into factory floor operations? The answer is most definitely yes! And ThingWorx can be used to facilitate this capability. ThingWorx enables connectivity to sensors, systems, and databases on the factory floor to monitor and analyze operations. Linking ThingWorx to an LLM establishes an AI Assistant capability that can provide personnel with valuable insights on the floor that can greatly reduce downtime and increase overall productivity.

A new Best Practice has been developed that lays out the steps necessary to accomplish this connection between ThingWorx and an LLM. This document can be used as a recipe for building a ThingWorx application that acts as an AI Assistant for an organization’s factory floor personnel. Questions can be asked by a user to find answers to issues like the following:

  • Which machine has failed most often over the last month?
  • What was the most frequent failure mode?
  • What was the maximum pressure observed on Machine 3 during February?
  • How many hours was Machine 1 running during March?
  • How many times did the temperature exceed 250 on any machine last month?

In addition to the Best Practice document, we have made available a ThingWorx project file that serves as an Accelerator to build out this application much faster. Use this project as a starting point and make any modifications necessary to implement this process in your own environment.

 

You can find both the Best Practice document and the ThingWorx project file here Using an LLM with ThingWorx 

 

Tip: This video has chapters available — open the player menu to jump straight to a section.

 

Chapter Summaries

Chapters:

  • 0:00 – Introduction (Dave Kessler, Digital Thread Architecture Hub)
  • 0:17 – About the Best Practice Document: Using ThingWorx with LLMs v1.0
  • 1:37 – Accelerator Overview in Composer (TWX LLM project entities)
  • 3:19 – The Manager Thing: GPT Auth Token and GPT URL Configuration
  • 4:05 – Why Microsoft Azure OpenAI (data privacy and security guardrails)
  • 5:17 – Prepare Data Button and Sample Dataset (machines, speed, temperature, rotation)
  • 6:07 – Live Demo: Asking a Natural Language Question
  • 7:00 – How ThingWorx Processes the Question (LLM-generated query, aggregation parameters, plain-language preamble)
  • 9:47 – Avoiding Raw Data and Preventing LLM Hallucinations
  • 11:05 – Handling Failed Queries (worst-case scenario and retry)
  • 12:08 – Cost, Security, and Prompt Engineering Principles
  • 12:56 – Guardrails Example: Blocking Off-Topic Questions
  • 13:48 – Using the Accelerator as a Launching Point for Development

 

Any additional feedback or questions you have can be entered below.