Filtering data during retrieval using Azure OpenAI portal

Adit Khandelwal 0 Reputation points
2025-05-07T11:49:31.1466667+00:00

I am trying to create a webapp using Azure OpenAI by connecting my own data which is vectorized using Azure AI search. I have added some custom fields and I want the data to get filtered based on those custom tag and user's query during retrieval. For example if there is a category tag with values like technology, marketing, etc. I want data to be filtered based on this tag and user's query and then retrieve most relevant documents from the filtered data. Can this be achieved using no code way provided in Azure OpenAI Portal where we can deploy as webapp after connecting to our data. If not what is the best and easiest way to set this up (either via code or no code approach)?

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
4,082 questions
{count} votes

1 answer

Sort by: Most helpful
  1. JAYA SHANKAR G S 4,035 Reputation points Microsoft External Staff Moderator
    2025-05-16T12:29:36.2833333+00:00

    Hello @Adit Khandelwal ,

    First thing you need check is cases where the chat completion gives you response properly.

    As per this documentation you can see.

    The chat models perform best in question and answer exercises. For example, "What are my available health plans?" or "What is the health plus option?".Queries that require data analysis would probably fail, such as "Which health plan is most popular?".Queries that require information about all of your data will also likely fail, such as "How many documents have I uploaded?". Remember that the search engine looks for chunks having exact or similar terms, phrases, or construction to the query. And while the model might understand the question, if search results are chunks from the data set, it's not the right information to answer that kind of question.

    In your case the requirement is filter the documents in AI search based on the tags, for that you should be having the field to store tag values in your search index and make it Filterable.

    User's image

    Above I am having field Rating and made filterable, similarly you create tags field.

    Below is the sample query for hotel data.

    User's image

    Here, i have also added system message in the left side, same kind of message you should add on your data according to your requirement.

    Next, we have a deploy option which directly create a web app for you with added data source.

    User's image

    Please try above and if find any query do let us know in comments or private message.

    Thank you


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.