Skip to content

Azure-Samples/azure-search-openai-demo-java

page_type languages products urlFragment name description
sample
azdeveloper
java
bicep
typescript
html
azure
azure-openai
active-directory
azure-cognitive-search
azure-app-service
azure-container-apps
azure-kubernetes-service
azure-sdks
github
document-intelligence
azure-monitor
azure-pipelines
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.

RAG chat app with Azure AI services and Langchain4J

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.

Features

  • 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.

Chat screen

Solution architecture and deployment options

Microservice RAG Architecture

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

Getting Started

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:

Guidance

For platform specific guidance, please refer to the following documentation:

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.

Azure Container Apps LZA deployment

Resources

About

This repo is the Java version of Microsoft's sample app for ChatGPT + Enterprise data.

Topics

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.md

Code of conduct

Security policy

Stars

Watchers

Forks

Contributors 55