logo
Menu
Bedrock Gen-AI driven Chat-bot for the Factory Plant

Bedrock Gen-AI driven Chat-bot for the Factory Plant

POC about the adoption of the generative AI technology to implement a digital agent talking to an environmental pollution monitoring system and knowledge-base.

Published Oct 1, 2024
Last Modified Oct 4, 2024
This is the first article of a short series presenting a proof-of-concept about the adoption of the generative AI technology to implement a digital agent talking to an environmental pollution (PM2.5/PM10) monitoring system and knowledge-base. Serving a fictitious cements factory, the main goal of the digital agent is safeguarding workers and machines, providing technical knowledge to adopt safe behaviors and guide maintenance actions.
The raising of large language models enables dialog interaction between people and machines or systems, without learning new tools or software. I had the opportunity to work on a similar system, for a real project in a different business domain, using technologies other than generative AI. The release of Amazon Bedrock to create gen-AI apps gave me the opportunity to roll up one's sleeves and give a try to LLMs in a real use-case.
Example of Chat

Business Context

In several businesses, many kinds of processes to produce goods do generate particulate matter (PM) pollution, including PM 2.5 and PM 10. These particles are small enough to be inhaled and can cause serious health problems to workers, as well as have negative impacts on machinery and equipment. Fine particles can accumulate on surfaces and in moving parts, leading to wear and tear, reduced efficiency, and increased maintenance costs. PM can cause corrosion and damage to electronic components, which can lead to equipment failure and costly repairs.
In a cement factory where normally raw materials such as limestone, clay, and sand are processed and transformed into cement through a series of steps that include crushing, grinding, mixing, and heating in kilns, PM pollution must be monitored and reduced through the use of various air pollution control devices and techniques, such as electrostatic precipitators, fabric filters, and many more.

Business Problems

  • Current lack of real-time air quality monitoring poses a risk worker health and machines reliability,
  • Workers do not have easy access to procedures and guidelines, getting difficult and inefficient to take actions against a degrading air quality,
  • Missing of a track history of pollution data does not enable analysis and data-driven decision-making,
  • Failure to comply with relevant legislation and regulations can result in fines, penalties, and reputational damage.

P.O.C. Solution - Business View

  1. S.O.P., guides, relevant documents - to feed the generative AI model and chat-bot agent with the company's know-how and procedures,
  2. Gen-AI chat-bot agent - to answer workers' questions about environment air quality status, get guidelines and procedures,
  3. Cloud IoT digital platform & storage - to manage the PM sensors data flow and storage,
  4. IoT gateway and service - to get pollution data from the sensors, push them to the IoT digital platform,
  5. PM 2.5/10 sensors - distributed across the production plant, to gather pollution values from the working environment in near real-time.
Solution Diagram - Business View

Advantages of Using Bedrock and LLMs to Make a Chat-bot

We all know how good LLMs are to create new text, images/videos, charts. Following this use-case you can discover how powerful it becomes in combination with other actors like the IoT platform, or any other source of business data.
Normally, when you want a chat-bot to interact with some source of data you must define logical flows (and code it). Coordinate the interactions between the user and software components (REST APIs or so), that's a lot of IT work.
This is how a standard project without gen-AI would handle the chat-bot configuration, as well as the interaction between it and all sort of data needed to answer user's questions:
ProfessionalsTasks to Carry Out
Analyst + UX Expertdefine all possible user/chat-bot interactions (questions, answers, paths, side-cases, errors),
draw logical flows according to the use-cases,
define what kind of data the chat-bot needs for each supported question,
define all examples needed to train the chat-bot engine (many),
define all tests to run against the chat-bot.
Architectdefine how to implement the integrations between the chat-bot and the sources of data (can be internal REST APIs, databases, third-party tools and so on).
Developerconfigures the project environment,
configures the chat-bot flows and examples,
implement the integrations to the data sources,
runs the tests.
Developer + Analyst + UX Expertre-do the process for every test failing, or
for every new side-case emerging during the production use by the end-user.
While adopting gen-AI, and specifically Amazon Bedrock used in this P.O.C., you rely on the gen-AI semantic and reasoning capabilities to automatically figure-out:
  1. chat-bot answers
  2. logical flows
  3. test cases
  4. data needed to answer
  5. what external data sources are mandatory to answer, automatically selecting them from a known list (!)
  6. logical flows to call the external data sources and get data (!)
  7. automatic engagement of the end-user when some mandatory information was not provided in original question (!)
So that the IT professionals and tasks can change as follows:
ProfessionalsTasks to Carry Out
Analystwrite down basic instructions for the LLM to understand the domain and how to act to support the user
define a very few examples of questions, and few sample answers (optional),
define a smaller set of tests.
IT Product Specialistconfigures the project environment,
list and describe available sources of data to the gen-AI,
list examples and tests to the get-AI,
runs the tests.
Analyst + IT Product Specialistrefine gen-AI examples for every new side-case emerging during the production use by the end-user.
As a result, you gain:
  1. a cleaner configuration process,
  2. easier work for analyst and IT specialists to carry out,
  3. a smaller risk of unanswered questions,
  4. increased time to market.

P.O.C. Technologies & Architecture

  1. LLMs: Amazon Titan Embeddings, Anthropic Claude
  2. Chat-bot Agent & Actions: Bedrock Components
  3. Chat app: sample web/mobile app made on TS/Vue
  4. Knowledge-base: AWS OpenSearch Serverless
  5. PM Querying function: AWS Lambda
  6. AA.: AWS Cognito + IAM + Certificates
  7. IoT platform: AWS IoT Core
  8. Gateway twin: AWS IoT Thing
  9. Message routing: AWS IoT Rule
  10. Data storage: AWS DynamoDB
  11. Gateway/micro-controller: Raspberry Pi4
  12. Data reader service: NodeJS runtime, sensor driver, mqtt client
  13. Pollution Sensor: Nova PM laser sensor SDS011
Arch. Diagram
Arch. Diagram

Coming Soon

  • Part 1 - Gathering pollution data from the edge, pushing them to AWS IoT Core and DynamoDB
  • Part 2 - Deploy a Chat App, Bedrock Agent and Actions to Ask Questions about Live Data
  • Part 3 - Working with Bedrock Studio (visual app builder)
     

Comments