Think about groundedness and response completeness as:
- Groundedness focuses on the precision aspect of the response. It doesn’t contain content outside of the grounding context.
- Response completeness focuses on the recall aspect of the response. It doesn’t miss critical information compared to the expected response or ground truth.
System evaluation
System evaluation examines the quality of the final response in your RAG workflow. These evaluators ensure that the AI-generated content is accurate, relevant, and complete based on the provided context and user query:- Groundedness - Is the response grounded in the provided context without fabrication?
- Groundedness Pro - Does the response strictly adhere to the context (Azure AI Content Safety)?
- Relevance - Does the response accurately address the user’s query?
- Response Completeness (preview) - Does the response cover all critical information from ground truth?
Process evaluation
Process evaluation assesses the quality of the document retrieval step in RAG systems. The retrieval step is crucial for providing relevant context to the language model:- Retrieval - How relevant are the retrieved context chunks to the query?
- Document Retrieval - How well does retrieval match ground truth labels (requires qrels)?
Using RAG evaluators
RAG evaluators assess how well AI systems retrieve and use context to generate grounded responses. Each evaluator requires specific data mappings and parameters:Example input
Your test dataset should contain the fields referenced in your data mappings:Context format
Thecontext field is a plain string containing the retrieved context provided to the model. For multi-chunk retrieval, concatenate chunks into a single string using a separator such as \n\n between chunks:
For agent evaluation with
{{sample.output_items}}, the context field is optional if the response contains tool call messages — the evaluator can extract context from tool call results.Configuration example
Data mapping syntax:{{item.field_name}}references fields from your test dataset (for example,{{item.query}}).{{sample.output_items}}references agent responses generated or retrieved during evaluation. Use this when evaluating with an agent target or agent response data source. For agent evaluation,contextis optional if the response contains tool calls—the evaluator can extract context from tool call results.
Example output
These evaluators return scores from 1 to 5, where 1 is very poor and 5 is excellent. The default pass threshold is 3. Scores at or above the threshold are considered passing. Key output fields:Document retrieval
Because of its upstream role in RAG, the retrieval quality is important. If the retrieval quality is poor and the response requires corpus-specific knowledge, there’s less chance your language model gives you a satisfactory answer. The most precise measurement is to use thedocument_retrieval evaluator to evaluate retrieval quality and optimize your search parameters for RAG.
-
Document retrieval evaluator measures how well the RAG retrieves the correct documents from the document store. As a composite evaluator useful for RAG scenario with ground truth, it computes a list of useful search quality metrics for debugging your RAG pipelines:
-
To optimize your RAG in a scenario called parameter sweep, you can use these metrics to calibrate the search parameters for the optimal RAG results. Generate different retrieval results for various search parameters such as search algorithms (vector, semantic), top_k, and chunk sizes you’re interested in testing. Then use
document_retrievalto find the search parameters that yield the highest retrieval quality.
Document retrieval example
retrieval_ground_truth contains human-labeled relevance scores per document:
retrieved_documents contains scores from your search system:
Document retrieval output
Thedocument_retrieval evaluator returns multiple metrics for retrieval quality:
xdcg@3, top1_relevance, top3_max_relevance, holes, and holes_ratio metrics.