You can use Azure AI Search’s integrated grounding score in Retrieval-Augmented Generation (RAG) to measure response reliability based on retrieved data.
Here is the code snippet you can refer to:

In the above code, we are using the following key approaches:
- Uses Azure AI Search for information retrieval.
 
- Fetches search results with relevance scores.
 
- Calculates a simple grounding score by averaging relevance scores.
 
- Demonstrates grounding for RAG by aligning responses to indexed data.
 
Hence, the grounding score provides a quantitative measure of response reliability in RAG, ensuringthat  generated content stays faithful to the retrieved data.