Azure PromptFlow — querying existing vectordb indexes for richer context

Ozgur Guler
Microsoft Azure
Published in
3 min readNov 21, 2023

PromptFlow has “automated RAG” functionality where upon pointing either to unstructured data within a data lake / blob storage, even a folder on your laptop or any other azure ml registered dataset, it launches an automated RAG pipeline and gives you a sample app.

An automated RAG pipeline under PromptFlow

This is pretty much a no-code deployment of a RAG pipeline which can be initiated by creating a new “Vector Index” on PromptFlow.

Creating a Vector Index to trigger automated pipeline

Ok, what if you already have a vector index on Azure AI Search (previously Azure Cognitive Search) and would like to use that for your RAG implementation.

In this case, we will need to replace the “Vector Index Lookup” step, with a “Vector DB Lookup” step where we will need to explicitly define the same index under the vector db lookup step.

Adding a Vector DB Lookup step

On the “Vector Index Lookup” step the index path is given as an azureml path. This is because PromptFlow generated AzureAISearch index is registered to AzureML.

Vector index lookup details

To use another index that is not created by PromptFlow, you need to replace this step with the below vectordbloolup step.

This time you need to explicitly define the AISearch connection and index names as well as the vector_field you will use for the search. You can implement filters and further search parameters. You can also query multiple indexes and create a “richer” context. Langchain’s multi-vector retriever can help streamline creating embeddings and seperate indexes for e.g. smaller chunks and summaries.

Conclusion

Vector db lookup gives you more flexibility to leverage embeddings stored in more indexes to help create richer contexts and better RAG performances.

Subscribe to AzureOpenAI builders newsletter on LinkedIn

--

--