Azure OpenAI RAG with Java, LangChain4j and Quarkus
A Microsoft sample application and workshop that builds a retrieval-augmented ChatGPT-style assistant in Java using LangChain4j, Quarkus, and Qdrant as the vector database, deployable to Azure or run fully locally with Ollama.
This sample shows how to build a retrieval-augmented generation chat experience in Java, using Quarkus to create a service that calls the OpenAI SDK and LangChain4j to answer questions grounded in a corpus of documents, paired with a website for interacting with the API. Qdrant serves as the vector database, and the application is designed to be hosted on Azure Static Web Apps and Azure Container Apps.
The project is meant to be followed alongside a full-length workshop that explains how the sample was built and how to run and deploy it, and it can be developed through GitHub Codespaces, a Dev Containers setup in VS Code, or fully locally at no cost by using Ollama instead of Azure OpenAI. Azure prerequisites include an account with access enabled for the Azure OpenAI Service and specific role-based access control permissions.