This solution creates a ChatGPT-like frontend experience over your own documents using RAG (Retrieval Augmented Generation). It uses Azure OpenAI Service to access GPT models, and Azure AI Search for data indexing and retrieval.
This solution's backend is written in Python. There are also JavaScript, .NET, and Java samples based on this one. Learn more about developing AI apps using Azure AI Services.
This template, the application code and configuration it contains, has been built to showcase Microsoft Azure specific services and tools. We strongly advise our customers not to make this code part of their production environments without implementing or enabling additional security features. See our productionizing guide for tips, and consult the Azure OpenAI Landing Zone reference architecture for more best practices.

📺 Watch a video overview of the app.
This sample demonstrates a few approaches for creating ChatGPT-like experiences over your own data using the Retrieval Augmented Generation pattern. It uses Azure OpenAI Service to access a GPT model (gpt-5.4-mini), and Azure AI Search for data indexing and retrieval.
The repo includes sample data so it's ready to try end to end. In this sample application we use a fictitious company called Zava, and the experience allows its employees to ask questions about the benefits, internal policies, as well as job descriptions and roles.

IMPORTANT: In order to deploy and run this example, you'll need:
Microsoft.Authorization/roleAssignments/write permissions, such as Role Based Access Control Administrator, User Access Administrator, or Owner. If you don't have subscription-level permissions, you must be granted RBAC for an existing resource group and deploy to that existing group.Microsoft.Resources/deployments/write permissions on the subscription level.Pricing varies per region and usage, so it isn't possible to predict exact costs for your usage. However, you can try the Azure pricing calculator for the resources below.
To reduce costs, you can switch to free SKUs for various services, but those SKUs have limitations. See this guide on deploying with minimal costs for more details.
⚠️ To avoid unnecessary costs, remember to take down your app if it's no longer in use,
either by deleting the resource group in the Portal or running azd down.
You have a few options for setting up this project. The easiest way to get started is GitHub Codespaces, since it will setup all the tools for you, but you can also set it up locally if desired.
You can run this repo virtually by using GitHub Codespaces, which will open a web-based VS Code in your browser:
Once the codespace opens (this may take several minutes), open a terminal window.
A related option is VS Code Dev Containers, which will open the project in your local VS Code using the Dev Containers extension:
In the VS Code window that opens, once the project files show up (this may take several minutes), open a terminal window.
Install the required tools:
python --version from console. On Ubuntu, you might need to run sudo apt install python-is-python3 to link python to python3.pwsh.exe from a PowerShell terminal. If this fails, you likely need to upgrade PowerShell.Create a new folder and switch to it in the terminal.
Run this command to download the project code:
shell
azd init -t azure-search-openai-demo
Note that this command will initialize a git repository, so you do not need to clone this repository.
The steps below will provision Azure resources and deploy the application code to Azure Container Apps. To deploy to Azure App Service instead, follow the app service deployment guide.
Login to your Azure account:
shell
azd auth login
For GitHub Codespaces users, if the previous command fails, try:
shell
azd auth login --use-device-code
Create a new azd environment:
shell
azd env new
Enter a name that will be used for the resource group.
This will create a new folder in the .azure folder, and set it as the active environment for any calls to azd going forward.
1. (Optional) This is the point where you can customize the deployment by setting environment variables, in order to use existing resources, enable optional features (such as auth or vision), or deploy low-cost options, or deploy with the Azure free trial.
1. Run azd up - This will provision Azure resources and deploy this sample to those resources, including building the search index based on the files found in the ./data folder.
- Important: Beware that the resources created by this command will incur immediate costs, primarily from the AI Search resource. These resources may accrue costs even if you interrupt the command before it is fully executed. You can run azd down or delete the resources manually to avoid unnecessary spending.
- You will be prompted to select two locations, one for the majority of resources and one for the OpenAI resource, which is currently a short list. That location list is based on the OpenAI model availability table and may become outdated as availability changes.
1. After the application has been successfully deployed you will see a URL printed to the console. Click that URL to interact with the application in your browser.
It will look like the following:

NOTE: It may take 5-10 minutes after you see 'SUCCESS' for the application to be fully deployed. If you see a "Python Developer" welcome screen or an error page, then wait a bit and refresh the page.
If you've only changed the backend/frontend code in the app folder, then you d
$ claude mcp add azure-search-openai-demo \
-- python -m otcore.mcp_server <graph>