November 21st, 2024

Java Intelligent Application Templates in the Azure AI Gallery

Bruno Borges
Principal PM Manager

Artificial Intelligence (AI) is no longer a futuristic concept—it’s transforming how developers build and innovate applications today. To help Java developers harness the full potential of AI, Microsoft’s Azure AI App Templates gallery offers a growing collection of AI-powered application templates. These templates are designed to streamline development, showcase integration patterns, and accelerate your AI journey. With the Azure Developer CLI (azd), Azure OpenAI and other Azure services, and comprehensive templates for Java developers, building intelligent applications has never been more accessible.

In this blog post, we’ll introduce the AI Gallery, discuss how azd simplifies deployment, and explore four standout Java templates that demonstrate the power of integrating Azure and AI technologies.

Simplifying AI Development with the Azure Developer CLI

The Azure Developer CLI is your ultimate toolkit for deploying AI applications. By offering pre-configured workflows, infrastructure as code (IaC), and CI/CD pipelines, azd enables developers to get started quickly and focus on innovation. With just a single command — $ azd up — you can deploy your chosen template to Azure, complete with all necessary configurations and dependencies.

Java AI Frameworks: LangChain4j, Spring AI, and Semantic Kernel for Java

Java developers exploring AI applications are increasingly adopting frameworks that simplify working with advanced AI models. Three key frameworks—LangChain4j, Spring AI, and Semantic Kernel for Java—are particularly noteworthy. These frameworks will be featured across Java templates in the Azure AI Gallery, showcasing how they enhance AI capabilities in Java applications.

Image Picture1

Explore Java Intelligent Application Templates

Here’s a quick overview of the four Java templates available in the Azure AI Gallery:

  1. Spring Petclinic Microservices with AI on Azure Container Apps
    Transform the classic Petclinic application into an AI-powered microservices system. Leverage Azure Container Apps and OpenAI to create a scalable, intelligent version of the Spring-based favorite.

  2. Retrieval-Augmented Generation (RAG) Chat with Azure AI Search
    Build a ChatGPT-like application to answer questions about uploaded documents. Integrate Azure AI Search with OpenAI models for highly contextual, document-based chat interfaces.

  3. Customer Assistant with Java
    Enhance customer service with a smart assistant for querying and updating customer information seamlessly.

  4. Banking GenAI Multi-Agent Assistant for Transaction Review
    Design a Generative AI-powered banking assistant. Enable users to check balances, review transactions, and initiate payments in a secure, conversational interface.

Practical Example: Experimenting with the RAG Chat Template

Let’s dive into the RAG Chat with Azure AI Search template to see how easy it is to get started. Follow these steps:

  1. Clone the template repository

    $ git clone https://github.com/azure-samples/azure-search-openai-demo-java.git 
    $ cd azure-search-openai-demo-java 
  2. Install the Azure Developer CLI
    Follow the installation guide to set up the CLI on your machine.

  3. Deploy the application
    Run the following command to deploy the application and infrastructure. If you are not authenticated already with the Azure CLI, the Azure Developer CLI will get you through the authentication process.

    $ azd up
  4. Test the application
    Once deployed, the application’s frontend and backend will be live. Use the application to test ChatGPT-like interactions, powered by Azure AI Search and Azure OpenAI.

  5. Customize and expand
    Experiment with different datasets, integrate additional Azure services, or modify the UI to suit your needs.

The Azure AI Gallery and templates provide a powerful starting point to explore AI capabilities, while tools like the Azure Developer CLI and Azure OpenAI services make it easier than ever to deploy, test, and iterate. Whether you’re modernizing existing applications, building conversational interfaces, or experimenting with new AI features, the Java Intelligent Application templates offer practical examples and inspiration. Try them out today and bring your Java applications into the AI-driven future.

Happy AI coding!

Author

Bruno Borges
Principal PM Manager

Bruno is Principal Program Manager for Microsoft's Java Engineering Group. Previously the Java lead for Azure Developer Relations. Conference speaker, open source contributor, Java Champion and influencer, Twitter junkie, beer sommelier.

0 comments