Blog

Harnessing generative AI for business applications: Practical insights from Vaadin

By  
Marc Englund
Marc Englund
·
On Jun 19, 2023 2:22:24 PM
·

AI and Generative AI (GAI) will clearly be the next transformative wave for software, likely even more impactful than the adoption of the internet, mobile, and cloud technologies. As an industry, we are just beginning a multi-decade journey to fully harness the value of GAI for developers and users of enterprise business applications. 

With a company full of technologists squarely focused on business applications, we’ve jumped in with both feet at Vaadin. We are working on initial projects and products to reduce toil and increase productivity for both developers and end users of enterprise applications.

We are also working on some tools that will help Vaadin developers more easily modernize applications and new features that will help end users of Vaadin access GAI in their workflows. This article is about some of the practical takeaways we've found so far.

Generative AI will change business apps

Recent advancements in generative AI (GAI) have hardly gone unnoticed by anyone, as our news feeds are flooded with news of ChatGPT, Bing, and Bard. Each day brings new announcements and unfamiliar topics such as “prompt engineering.” While examples of erroneous answers and “hallucinations” abound, the early users of ChatGPT and other GAI tools have also shared stories of significant benefits across a variety of disciplines, from software development to blog writing to making sense of data. GAI is a transformational technology that is likely to exceed the impact of even personal computers and the World Wide Web. 

While GAI technology itself is advancing at warp speed, it will take time for GAI to fully seep into enterprise business applications. There will be security, copyright, privacy, and other regulatory hurdles to overcome. In addition, developers will require re-skilling and upskilling to fully leverage the potential of GAI. Enterprise application users will need to be retrained to use chatbots and other GAI-assisted workflows. Governments will need to define new regulatory frameworks, and businesses will need new guardrails to address potential negative impacts. We are currently in the early days of what is likely to be a decades-long journey to harness GAI technology.

At Vaadin, we believe that everyone involved in business applications needs to start thinking about how AI, and especially GAI, can be used both to speed the development process and assist application users. But we also know there will be challenges and bumps on the road as we work to better understand and apply this technology in a way that benefits developers, users, and society. Applied just right, however, GAI can be a force multiplier that spawns an entirely new generation of technology applications that improve productivity and drive economic advantages.

“The future is already here – it's just not evenly distributed”

- William Gibson

A place to start

It can all feel quite overwhelming, and figuring out what is useful and feasible in practice for my team and my application can be quite challenging. What is applicable right now, and what should I keep an eye out for in the near future? 

This article aims to establish a more sustainable pace as we take a look at some examples of how we’re already using GAI to aid our daily work at Vaadin. Additionally, we will explore a few prototypes and research efforts that aim to bring GAI to users and customers in the not-so-distant future.

For me, for you, for everyone

GAI can be used within business applications to assist end users. While some of the value will be specific to each application and domain, there are UX patterns that will be beneficial across all types of business applications. This is what we’ll take a look at first.

Next, we’ll explore how we at Vaadin have embraced a “learn by doing” approach as we incorporate GAI into our daily work. We will also highlight anticipated use cases for AI in the near future. 

Lastly, we’ll take a look at how we think AI might play a role in making application development and modernization better and faster. We'll consider how AI can reduce toil and help us create better applications.

GAI for users of business applications

Generative AI has great potential to enhance business applications by automating tasks, learning user behavior, providing insights, and serving as a force multiplier. Its capabilities range from automating report generation and predicting trends to anomaly detection and data entry. 

However, there aren't many universally applicable UI/UX patterns, and each business application often requires custom, domain-specific solutions to address unique challenges, workflows, and user needs.

A good principle, for now, is to keep the human in the driver's seat, treating GAI as a collaborator or assistant. 

Here are some initial solutions we’ve found to have broad applicability:

  • Treat the AI as a collaborator

    Patterns familiar from the Collaboration Kit can be used to bring in AI as a collaborator and assistant, clearly indicating if the AI makes changes. The human approves everything, owns the work, and remains accountable.

  • Create structured data from natural language

    GAI can transform unstructured natural language into structured data. This can be used to take voice input or emails and map the data to a structured format, for example. This opens up a myriad of possibilities, some of which we will discuss next.

  • Automate data entry

    GAI can fill and update forms, potentially detecting the input type and the corresponding record that needs to be updated; this might be an uploaded file or a verbal command like “change the billing address for Acme Ltd to […]” A community-provided add-on already exists for this purpose, called Auto Form Filler.

  • Command and control using natural language

    In some situations, relying solely on point-and-click or keyboard typing may not be practical. Instead, employing wake words and speech recognition can be used to interact with the system. This approach holds tremendous potential for enhancing accessibility as well.

  • Filtering and searching

    Data-intensive applications often need data filtering, searching, and querying. Requiring the user to be proficient in query languages such as SQL is seldom a good solution, and even visual query builders can become overly complex. GAI has the potential to take a natural language description of the need and transform that into a structured query. However, for frequently performed operations, relying solely on natural language input might prove cumbersome. Consider providing a way for users to save the generated query for easy reuse.

  • Strive for determinism

    GAIs are inherently non-deterministic, meaning they can produce different answers to the same question. In business applications, this variability is not always desirable. To mitigate this, behind-the-scenes prompt engineering and other techniques can be applied to establish context and constraints to limit the variation in GAI responses. Moreover, post-processing or saving the initial result (see the previous query builder example) can provide the necessary level of determinism.

What we’ve learned (so far) from using GAI at Vaadin

Inevitably the best way to start learning about a new technology is just to start using it. In addition to identifying how it can increase our own productivity, we wanted to get a better understanding of how we can incorporate GAI into our solutions to deliver better experiences for both developers and users.  

Let's take a look at a few key learnings we've gathered so far:

  • Code generation needs (human) adult supervision

    Large language models (LLMs) such as OpenAI ChatGPT and others have the capability to generate code. We’ve used both Github Copilot and ChatGPT to generate code that uses Vaadin. While answers to simple requests were mostly correct, more complex requests frequently generated errors and hallucinations. GAI is similar to a junior developer, so make sure you are carefully reviewing the code produced and making necessary corrections.

  • Code generation is particularly helpful for common tools/frameworks/APIs that you don’t know

    When an LLM such as Github Copilot has been exposed to enough examples of something, it can assist you in jumping right in and learning by doing. This approach allows you to learn while simultaneously working towards your specific goal, rather than relying on generic examples until you are proficient enough to tackle the problem at hand. However, when working with less common technologies or languages, this does not always work.
  • Generated content is a good starting point, not an endpoint

    Whether generating content for a blog or technical documentation, ChatGPT and similar tools can create a good starting point for content. However, human expertise is essential to correct errors and add a unique style or spin to the topic.
  • GAI is a (mostly) helpful research assistant

    Using GAI to extract the key points on a particular topic can be helpful in identifying factors that you may have overlooked. However, depending on the tool, you may need to explicitly request URLs for source material. Even if links are provided, they may be non-existent or incorrect. Therefore, make sure you click on each link to confirm their accuracy.
  • Creating the right prompts takes time

    It takes time and experimentation to learn how to craft prompts for a GAI tool that elicits a useful and verifiable response. In some cases, the effort to craft a set of prompts that elicits the right answer may be harder than actually doing the work yourself. However, this will improve over time, and to some extent, we can influence it by using the GAI APIs to fine-tune, train, and provide context (see Docs Assistant later.)

  • Complex things are still complex

    For instance, GAI is, for the time being, fairly good at generating code but falls short in software development. It excels at adapting generic code snippets to specific contexts, providing not just code completion but an “intelligent” code-block completion. However, it’s missing the bigger picture of what we’re trying to achieve and lacks a feedback loop to assess the success of the generated code.

    Although tooling and integrations are likely to improve these aspects rapidly, one significant obstacle remains: we often work on unique, domain-specific problems that lack extensive prior work to rely on. How far LLMs and GAI can go remains to be seen – but perhaps all we need is for the GAI to handle the toil so that we can focus on the higher-level challenges.

GAI for Developers in the Vaadin community 

GAI accelerates mundane coding tasks for developers by automating boilerplate code generation and customization. It expedites the coding process similarly to autocomplete, but at a more advanced level. Moreover, GAI can help with problem-solving by providing solutions to specific questions, thus eliminating the need for manual search in the documentation. Though it occasionally produces hallucinations and confuses API versions, vendors can mitigate these issues by training and fine-tuning their GAIs. 

At Vaadin, we created a proof-of-concept of a Docs Assistant, particularly adept at answering questions regarding Flow or Hilla projects. 

Tools we have seen the most success with so far are Github Copilot for code, OpenAI ChatGPT for code and textual inspiration, OpenAI GPT APIs (e.g., Docs Assistant), and to some (limited) extent, DALL-E and Midjourney for visual inspiration.  

Here's what we've learned so far:

  • GAI can and often should be fine-tuned or augmented to provide more relevant and up-to-date answers

    As the models have a “cut-off date” for the material it was trained on, it needs help to stay current. This can, for instance, be done by letting the AI access the internet or by providing access to your content via an API. When using the API, you can also make sure answers are relevant to your domain by providing context. This is what we did with the Docs Assistant.
  • What the AI does not know, it makes up

    Without constraints, the AI easily imagines non-existing APIs or mixes up different frameworks and different versions. The more context and constraints we can give, the better the answers are. The surprising flip side of these hallucinations is that they can actually indicate missing APIs or how an API should intuitively work.
  • GAI for UI/UX is still an emerging field

    There is potential for using GAI to generate UIs from natural language, napkin drawings, or from the data model specification, but it’s still early days. Multimodality (the ability to look at, e.g., both text and images) will no doubt play a major role, and tools are emerging. For now, image generators can provide UI inspiration, and GAIs can, for instance, help with styling  (by Sascha Ißbrücker, source) but not yet so much with the layout. In the near future, we can expect the GAI to at least give us a good starting point to work from.

Conclusion

At Vaadin, we're excited about the potential of GAI to bring new levels of efficiency, creativity, and innovation to our work and to the broader technology landscape. We have learned much from our initial foray into GAI, but we are aware that there is much more to uncover. 

The future of GAI is indeed here – let’s start distributing it, piece by piece, as we together uncover new ways to use GAI as a force multiplier for the users of our applications.

Marc Englund
Marc Englund
Marc is a a long time Vaadineer, carrying a Design Strategist card in his left jeans pocket. Lately he has mostly been thinking about the new #FFS, and other ways to make the developers’ day more enjoyable.
Other posts by Marc Englund