A demo app showcasing Vector Search using Azure AI Search, Azure OpenAI for text embeddings, and Azure AI Vision for image embeddings.
This repository contains a React application that demonstrates the Azure AI Search Comparison Tool. This tool provides a web interface for visualizing different retrieval modes available in Azure AI Search. Additionally, the tool supports image search using text-to-image and image-to-image search functionalities. It leverages Azure OpenAI for text embeddings and Azure AI Vision API for image embeddings.
You can find a live demo at aka.ms/VectorSearchDemo
To run this demo locally, you will need the following:
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 command. If this fails, you likely need to upgrade PowerShell.Execute the following commands, if you don't have any pre-existing Azure services and want to start from a fresh deployment.
Clone this repository to your local machine.
Run azd auth login
Run azd up
- This will provision Azure resources and deploy this demo to those resources
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.
NOTE: It may take a minute for the application to be fully deployed. If you see a "Python Developer" welcome screen, then wait a minute and refresh the page.
azd env set AZURE_OPENAI_SERVICE {Name of existing Azure OpenAI service}
azd env set AZURE_OPENAI_DEPLOYMENT_NAME {Name of existing embedding model deployment}
. Only needed if your deployment is not the default 'embeddings'. Typically this'll be a text-embedding-ada-002 model.azd env set AZURE_SEARCH_SERVICE_ENDPOINT {Endpoint of existing Azure AI Search service}
azd env set AZURE_SEARCH_TEXT_INDEX_NAME {Name of existing Azure AI Search index with text}
azd env set AZURE_SEARCH_IMAGE_INDEX_NAME {Name of existing Azure AI Search index with images}
azd env set AZURE_VISIONAI_ENDPOINT {Endpoint of existing Azure AI Vision}
azd env set AZURE_VISIONAI_KEY {Key of existing Azure AI Vision}
azd up
If you've only changed the backend/frontend code in the app
folder, then you don't need to re-provision the Azure resources. You can just run:
azd deploy
If you've changed the infrastructure files (infra
folder or azure.yaml
), then you'll need to re-provision the Azure resources. You can do that by running:
azd up
azd auth login
app
./start.ps1
or ./start.sh
or run the "VS Code Task: Start App" to start the project locally.This is recommended only for development, and provides hot reloading of both backend and frontend:
In one terminal run the backend:
azd auth login
app
./start.ps1
or ./start.sh
In a second terminal run the frontend:
app/frontend
npm start
The Azure Search Comparison Tool allows you to search for text queries by entering them in the search bar and pressing 'Enter'. The application will generate text embeddings using Azure OpenAI and perform vector searches on the data stored in Azure AI Search.
The search results will be displayed as cards. Feel free to click on the settings icon to explore the different query approaches such as Hybrid Search and Hybrid Search with Semantic Ranking, Captions, and Highlights powered by Microsoft Bing. Note that you will need to enroll in a Semantic Plan in your Azure AI Search service to use this feature. See Semantic search.
We hope you find this repository useful for demoing Vector search and exploring the different features Azure AI Search has to offer. Feel free to explore and customize the code to meet your specific requirements.
If you have any questions or suggestions, please feel free to open an issue and we'll be happy to help.
Happy searching!