page_type | languages | products | urlFragment | name | description | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sample |
|
|
azure-search-openai-demo-java |
RAG chat app with Azure OpenAI and Azure AI Search with Java and Langchain4J |
A Java sample app that chats with your data using Azure AI services. |
This repo is the Java version of the well known ChatGPT + Enterprise data code sample originally written in python.
It demonstrates best practices for creating ChatGPT-like experiences over your own data using the Retrieval Augmented Generation pattern. It uses Azure OpenAI Service to access the ChatGPT model gpt-4o-mini
, and Azure 0AI Search for data indexing and retrieval and Azure Document Intelligence for document structured text parsing.
This repository includes sample data so it's ready to try end to end. In this sample application we use a fictitious company called Contoso Electronics, and the experience allows its employees to ask questions about the benefits, internal policies, as well as job descriptions and roles.
- Chat interface with search result citations and follow-up questions.
- Documents uploads and management.
- Response streaming.
- Response metadata with source content and grounded prompt tracking, search keywords, token usages.
- Citation panel with page level detail (pdf, html, markdown).
- Several documents formats supported: pdf, html, markdown, Office (docx,xslx,pptx).
- Explores various retrievial options to help users evaluate search results: search score, search top results, text/vector/hybrid retrievial strategy, semantic caption and ranking (Azure AI search specific features).
- Chat history with Azure CosmosDB or browser local database (for unauthenticated users).
- Login and documents access control with EntraID.
- Paged document text extraction with table data support with Azure Document Intelligence.
This sample supports different architectural styles. It can be deployed as a microservice event driven architecture with web frontend, AI orchestration and document ingestion apps hosted by Azure Container Apps or Azure Kubernetes Service. It uses Langchain4J AI orchestration java framework.
- For Azure Container Apps deployment, see here.
- Azure Kubernetes Service deployment is working in progress ☀️ ☁️ :construction_worker_man
Note
Previous java Semantic Kernel version has been moved in a dedicated branch
All the available architectures and implementations come with few options to start developing and running the application locally using dev containers or in the cloud using github codespaces. For more detailed instructions, please refer to the specific architecture implementation documentation:
- Azure Container Apps Getting Started
- Azure Kubernetes Service Getting Started ☀️ ☁️ WIP
For platform specific guidance, please refer to the following documentation:
- Azure Container Apps Guidance
- Azure Kubernetes Service Guidance ☀️ ☁️ WIP
This sample is designed to get you started quickly and let you experiment with Java RAG architectures on Azure. For production deployment, you can use the Azure Application Landing Zones (LZA) to deploy the solution in production leveraging best practices for security, monitoring, networking and operational excellence.
Check the chat-with-your-data-lza-app-accelerator to see how you can deploy this solution on Azure Container Apps LZA.
Note
Support for deploying on landing zone is available for previous semantic kernel version at this repo. A new version based on Azure Verified Modules for Azure Container Apps is WIP ☀️ ☁️ :construction_worker_man.
- 📖 Revolutionize your Enterprise Data with ChatGPT: Next-gen Apps w/ Azure OpenAI and AI Search
- 📖 Azure OpenAI Service
- 📖 RAG in Azure AI Search
- 📖 Azure OpenAI client library for Java
- 📖 Semantic Kernel for Java 1.0
- 📖 Evaluating a RAG chat App
- 📖 Well Architected Framework on Azure OpenAI Service
- 📺 Chat with your data using Java and Azure Open AI
- 📺 Vector Search, RAG, And Azure AI Search