Definition
The context relevancy test measures how relevant the context retrieved is given the question. This metric is based on the Ragas context precision metric.Taxonomy
- Task types: LLM.
- Availability: and .
Why it matters
- Context relevancy ensures that your retrieval system provides information that is directly related to the user’s question.
- This metric helps identify when your retrieval mechanism is returning irrelevant or off-topic context that could confuse the LLM.
- It’s essential for RAG (Retrieval-Augmented Generation) systems to maintain high precision in retrieved information.
Required columns
To compute this metric, your dataset must contain the following columns:- Input: The question or prompt given to the LLM
- Ground truth: The reference/correct answer
- Context: The retrieved context or background information
Test configuration examples
If you are writing atests.json
, here are a few valid configurations for the context relevancy test:
Related
- Ragas integration - Learn more about Ragas metrics.
- Context recall test - Measure completeness of retrieved context.
- Context utilization test - Evaluate how well context is used.
- Aggregate metrics - Overview of all available metrics.