Context Relevance measures how relevant (or similar) the context provided was to the user query.

Context relevance

Context Relevance measures how relevant (or similar) the context provided was to the user query. This metric requires and slots in your data, as well as embeddings for them (i.e. {context_embedding}, {query_embedding}. Context Relevance is a relative metric. High Context Relevance values indicate significant similarity or relevance. Low Context Relevance values are a sign that you need to augment your knowledge base or vector DB with additional documents, modify your retrieval strategy, or use better embeddings.

Requirements

Context and Query Embeddings are required to compute Context Relevance. If you’re seeing a Missing Embeddings error, it means you didn’t log your embeddings correctly.
Context Relevance is differentiated from Context Adherence: Context Relevance evaluates whether the retrieved context is relevant to a user’s query whereas Context Adherence determines how well the response aligns to provided context.

Best practices

Use for Results Assessment

Leverage Context Relevance when assessing the quality of your retrieval system’s results and determining how accurately it adheres to queries.

Combine with Other Metrics

Use context relevance alongside context adherence, correctness, and completeness metrics for a comprehensive view of response quality.