Muokkaa

Jaa


How to build and consume vector indexes in Azure AI Foundry portal

Important

Items marked (preview) in this article are currently in public preview. This preview is provided without a service-level agreement, and we don't recommend it for production workloads. Certain features might not be supported or might have constrained capabilities. For more information, see Supplemental Terms of Use for Microsoft Azure Previews.

In this article, you learn how to create and use a vector index for performing Retrieval Augmented Generation (RAG) in the Azure AI Foundry portal.

A vector index isn't required for RAG, but a vector query can match on semantically similar content, which is useful for RAG workloads.

Prerequisites

You must have:

  • An Azure AI Foundry project
  • An Azure AI Search resource
  • You should have content in a supported format that provides sufficient information for a chat experience. It can be an existing index on Azure AI Search, or create a new index using content files in Azure Blob Storage, your local system, or data in Azure AI Foundry.

Create an index from the Chat playground

  1. Sign in to Azure AI Foundry.

  2. Go to your project or create a new project in Azure AI Foundry portal.

  3. From the menu on the left, select Playgrounds. Select the Chat Playground.

    Screenshot of Project Left Menu.

  4. Select a deployed chat completion model. If you have not done so already, deploy a model by selecting Create new deployment.

    Screenshot of create a deployment button.

  5. Scroll to the bottom of the model window. Select + Add a new data source

    Screenshot of the add your data section.

  6. Choose your Source data. You can choose source data from a list of your recent data sources, a storage URL on the cloud, or upload files and folders from the local machine. You can also add a connection to another data source such as Azure Blob Storage.

    If you don't have sample data, you can download these PDFs to your local system, and then upload them as your source data.

    Screenshot of select source data.

  7. Select Next after choosing source data

  8. Choose the Index Storage - the location where you want your index to be stored in the Index configuration tab.

  9. If you already have an Azure AI Search resource, you can browse the list of search service resources for your subscription and then select Connect for the one you want to use. If you're connecting with API keys, confirm your search service uses API keys.

    Screenshot of select index store.

    1. If you don't have an existing resource, choose Create a new Azure AI Search resource. Select Next.
  10. Select the Azure OpenAI connection you want to use. Select Next.

  11. Enter a name you want to use for your vector index. Select Next.

  12. Review the details you entered and select Create

  13. You're taken to the index details page where you can see the status of your index creation.

Use an index in prompt flow

  1. Sign in to Azure AI Foundry and select your project.

  2. From the collapsible left menu, select Prompt flow from the Build and customize section.

  3. Open an existing prompt flow or select + Create to create a new flow.

  4. On the top menu of the flow designer, select More tools, and then select Index Lookup.

    Screenshot of Vector index Lookup from More Tools.

  5. Provide a name for your Index Lookup Tool and select Add.

  6. Select the mlindex_content value box, and select your index from the value section. After completing this step, enter the queries and query_types to be performed against the index.

    Screenshot of the prompt flow node to configure index lookup.

    Screenshot of the prompt flow node to generate an index.