Resource

Gen AI Meets SiteWise Hackathon

Published on 13 May, 2024 by Jonathan

At Green Custard, we are always seeking to make our customer’s experience better. Given the advent of Generative AI, we thought “What if our customers could simply ask questions about SiteWise and their data stored within SiteWise?”

This initial concept drove us to hold a hackathon last month at Green Custard in order to see how effective this could be. We have been working closely with Ely Museum, so decided that the hackathon would work with their SiteWise. The hackathon was also there to encourage staff to use tools such as Amazon CodeWhisperer as part of their development process to see how effective Gen AI is in assisting with development tasks. We have since enabled Amazon Q Developer (the new name for Amazon CodeWhisperer) for all developers.

Holding a hackathon involves some prep, and we wanted to hit the ground running, so we made some technology selections and created boilerplate and an initial prompt to get started. The choices were:

  • Streamlit for rapid UI prototyping
  • Claude 3 Sonnet for LLM, invoked via Amazon Bedrock
  • A custom prompt to handle user questions.
  • Scaffolding so a question could be asked, and dummy data returned

On the day, the hackathon split into three teams:

  • Team 1 - interface to AWS IoT SiteWise to retrieve and aggregate data as requested
  • Team 2 - render the UI elements (e.g. graphs, or tables) returned by Team 1 in Streamlit
  • Team 3 - make this deployable

The goal was to enable both questions about SiteWise meta-data and also SiteWise asset data, and enabled a variety of display formats such as graphs, tables, and the ability to export data.

The hackathon was a success, but the solution was a little fragile, in particular having a single large prompt was not the best. As such, we have done a small amount of development since to take a more agentic approach to the problem, and in fact use a mix of Claude 3 models depending on task. The benefits of this approach are:

  • Users get a better experience with interim responses
  • We can classify questions to weed out bad intentions, and direct to specific request types
  • We can detect missing information from the user more easily, e.g. dates
  • With Claude 3 Opus the code generation to drive the output is more nuanced and can cater for a wider range of questions.

The approach is summarised in the following image:

In addition, we have recorded a video of the chat bot, along with some pointers on how it works. Feel free to watch at Chatting with AWS IoT SiteWise using Generative AI, and please get in touch with us at Green Custard to learn more about how we can help business challenges with IoT, Gen AI, and a host of other great AWS services.

Back to the list