Forum Discussion
Masaru_Matsumura
Apr 24, 2024Copper Contributor
How to build a RAG system using AzureOpenAI and AzureAISearch.
I want to build a RAG system using AzureOpenAI and AzureAISearch. I am currently struggling with the on your data feature of AzureOpenAI to adjust the field composition of the uploaded files. The u...
Kidd_Ip
Feb 24, 2025MVP
Try on below:
- Understand the Data Ingestion Process: When you upload files using the "on your data" in AzureOpenAI, the data is chunked and embedded into an Azure AI Search instance. This process involves creating an index that stores the data in a searchable format.
- Define Field Mappings: To ensure that your question and content fields are correctly mapped, you may required to define explicit field mappings in your index. This can be done using the Azure AI Search indexer. Below in JSON:
{
"name": "your-index-name",
"fields": [
{
"name": "question",
"type": "Edm.String",
"searchable": true,
"filterable": true,
"sortable": true,
"facetable": false
},
{
"name": "content",
"type": "Edm.String",
"searchable": true,
"filterable": false,
"sortable": false,
"facetable": false
}
],
"suggesters": [],
"scoringProfiles": [],
"defaultScoringProfile": null,
"corsOptions": null,
"analyzers": [],
"tokenizers": [],
"tokenFilters": [],
"charFilters": []
}
- Adjust the Indexer Configuration: Ensure that the indexer configuration correctly maps the source fields (question and content) to the target fields in the index. You can use the Azure AI Search portal or the REST API to configure the indexer.
- Test the Configuration: After setting up the index and indexer, test the configuration by querying the index with specific questions. Ensure that the responses are as expected, with each question returning a specific answer.
- Optimize the Retrieval Process: Fine-tune the retrieval process by adjusting the query parameters and relevance scoring. This will help improve the accuracy of the responses.