Blog

Building AI-Powered Java Applications

By  
Marcus Hellberg
Marcus Hellberg
·
On Jun 24, 2024 1:59:33 PM
·

Over the past few months, I’ve spoken at Java conferences and developer events worldwide about building AI-powered applications with Java. What I’ve seen is that Java developers are curious and eager to learn, but AI can seem like a big and daunting new area to get into. Most of us have demanding jobs that occupy our time, and we might not have had the chance to learn the new concepts and tools needed to integrate AI into the apps we’re building.

At the same time, I believe business apps are a place where AI can make a big impact. Enterprise applications are often built to support complex workflows with many manual steps. There are people who spend their days working on tasks that AI could streamline significantly.

I wanted to help Java developers get started with building AI-augmented applications by creating application starters that focus on real business use cases.

Java AI Chatbot with business context-awareness

The first Java AI application starter is a retrieval-augmented generation (RAG) application that reads documents from a specified folder and uses them as context when answering questions. This is a good starting point for a chatbot that provides help about your business to customers or employees.

Common use cases for Java AI chatbots include:

  • AI-driven customer support chatbots
  • Employee self-service assistants for internal knowledge bases
  • Automated document-based Q&A systems

Tech stack for this application:

  • Vaadin Flow for the UI
  • LangChain4j for AI-driven text processing
  • Spring Boot for backend integration

You can find the sources on GitHub.

Java AI for sentiment analysis and reply drafting

The second Java AI starter project performs sentiment analysis on customer feedback. It provides a UI for drafting custom responses to feedback, helping customer support representatives provide more timely responses to customers.

Tech stack for this application:

  • Hilla (Vaadin’s TypeScript-based UI framework)
  • LangChain4j for AI-based sentiment detection
  • Spring Boot for backend logic

You can find the sources on GitHub.

What Java AI applications should we build next?

Instead of trying to come up with realistic use cases on my own, I'd love to hear from you:

  • How could AI improve your business apps?
  • What kind of starters would you like to see next?
Drop your ideas in the comments below, or reach out to me on X or LinkedIn
Marcus Hellberg
Marcus Hellberg
Marcus is the VP of Developer Relations at Vaadin. His daily work includes everything from writing blogs and tech demos to attending events and giving presentations on all things Vaadin and web-related. You can reach out to him on Twitter @marcushellberg.
Other posts by Marcus Hellberg