4 March, 2024

flespi at Gurtam AI Hackathon 2024

How we're paving the way for AI in software development.

At flespi we love challenges, and as part of the Gurtam family, and with a wealth of experience in developing AI on our platform, it was inevitable for us to accept another one. Just like last year when we powered our own event, 14 teams were tasked with creating an AI-powered service - a solution that can be used to boost Gurtam's products or enhance internal processes. 

In just two days, teams needed to develop an idea valuable enough for integration into the company's product workflow, while also delivering an inspiring pitch to the esteemed jury to compete with others. One-third of flespi team was dedicated to the competition, while the remainder continued to address specific issues requiring a developer's attention. So, what's our story?

Let's step back for a while. Connecting a device to flespi nowadays is not a big deal anymore. Protocols are regularly updated as well. Around 1 million messages per minute are flowing in and out steadily but... Do you utilize all the data directly 'as-is'? Maybe your business needs to extract valuable data from custom CAN-bus frames or connect external equipment through a serial port, requiring the data to be represented in a complex format.

To save you time, the solution is PVM (Parsing Virtual Machine). A custom programming language that was developed by our team and introduced quite some time ago. It's designed to parse and process the data coming through dozens of independent protocols. (You can think of it as akin to protobuf with added mathematical logic.) The only issue is that even if you're quite familiar with flespi, you might have never used it.

Yes, the lack of technical documentation hinders our users from utilizing PVM extensively. Frankly, not many of our customers are willing to dig in. While we offer a convenient UI testing tool to experiment with the PVM plugin code (PVM plugin sandbox), learning something new always takes time and can be challenging. 

On the other hand, our support chat has been flooded with requests for assistance, and while we're always ready to help by writing PVM code ourselves, we've considered enhancing our support interaction. What if we could teach AI to simplify PVM usage, making it accessible even to newcomers? Moving forward, I should say - we did it.

We believe this could be a game-changer for our users. Picture yourself being able to describe a data transformation problem or input Java/Python code exactly as you envision it, and receiving a programmable output to work with. In this scenario, LLM can serve as a helpful, friendly companion, akin to a Co-pilot writing PVM code based on human instructions. 

How did we do it? The flespi concept of reliability is grounded in extensive testing; we leave no stone unturned. This time, we continued refining our prompts and experimenting with various ChatGPT models until we achieved satisfactory results. The turning point came when we added language samples to prompts, significantly enhancing response quality. However, different models showed varying levels of effectiveness. 

Here are a couple of examples of how we tested them during the Hackathon in the internal interface. For instance, if we asked to rename all device parameters starting with ‘device’ to 'corporate.device.*':

…or to convert base64 data to text and parse it as ‘ibeacon’ data:

…or to split BLE data into plain parameters:

Ok, but then we tried something harder. What if we’re using Python syntax?

One little observation as more and more users turn the AI assistant on. You need to keep your language simple yet consistent when communicating. Remember: 'garbage in, garbage out'. Cutting sentences, making minor errors, or omitting words can lead to confusion and unpredictable results. AI is not capable of reading your mind; it’s not your seasoned colleague, so speaking clearly is a distinct advantage. :)

But enough said, take a look at how it's implemented in the chat session, and surely - you can already try it out. Address your request for a PVM code to codi, our AI assistant, the same way you're asking him to help.


Anyway, we’re very excited not only about the new scope of AI but also about the challenges we've overcome and the simplicity of enhancing this work model on-the-go. Frankly speaking, we're on our way to implementing other features in the dashboard to make the platform functionality more all-encompassing, so stay tuned for updates!