Skip to main content
Relevance Score
Oriol Zertuche avatar
Written by Oriol Zertuche
Updated over a week ago

In the context of Cody AI, a semantic search tool, the relevance score serves as a critical measurement to determine the degree of similarity between a user's query and the information found within the system's knowledge base. The relevance score greatly influences the scope of knowledge that Cody AI extracts to form its response.

A higher relevance score implies a stricter requirement for a match from the knowledge base. This implies that Cody AI would extract less knowledge for a query, resulting in a more precise response. However, this precision might also constrain the AI's ability to answer a wider range of queries.

On the other hand, a lower relevance score broadens the range of knowledge that Cody AI considers when synthesizing a response. In cases where an exact match is available, it will be included alongside the broader context. This approach could lead to incorporating more general or even unrelated information from the knowledge base, consequently making responses more generic or potentially erroneous.

Examples

To illustrate the concept of relevance score in Cody AI, let's consider two different user queries and how the system might respond based on the scores.

1. User Query: "Tell me about the eating habits of a lion."

High Relevance Score: Cody AI searches for an exact match within its knowledge base, specifically addressing lions' dietary preferences, such as eating other animals and their hunting methods.

Low Relevance Score: By utilizing broader knowledge, Cody AI generates a response that includes information about the dietary habits of big cats in general and their differences compared to other animal groups. The answer will also contain the exact match about lions' eating habits, allowing Cody AI to reason with limited information.

2. User Query: "What animals can fly?"

High Relevance Score: Cody AI provides a list of flying animals, including birds, bats, and certain insects like butterflies and bees, based on specific information from its knowledge base.

Low Relevance Score: Leveraging a broader set of knowledge, Cody AI discusses the various forms of animal locomotion, mentioning that some animals have adapted to flying as their primary movement method. This response will also include the exact match about flying animals, combining the related information with a broader context.

In these examples, a higher relevance score means that Cody AI produces more targeted and accurate information by strictly adhering to the knowledge base. Conversely, a lower score expands the scope of knowledge used for response synthesis and includes any exact matches, which might cause Cody AI to deliver more generic or potentially mistaken answers along with pertinent information.

Did this answer your question?