Glossary
Relevance score
A relevance score is the number a search system assigns to each result to estimate how well it matches a query, used to rank results and decide which ones to keep.
A relevance score is the number a search or retrieval system assigns to a result to estimate how well it matches a query. Higher scores mean the system expects the result to be more useful, and results are sorted by score before they are shown to a person or passed to a language model. The number comes from a scoring function, such as BM25 for keyword search, cosine similarity for vector search or a cross-encoder for reranking, so its scale and meaning depend on which function produced it. A relevance score is an estimate of relevance. Treating it as a measure of truth, or as comparable across systems, is one of the most common mistakes in search and RAG.
How a relevance score is produced
Every ranked search follows the same shape. The system takes a query, finds candidate results, gives each one a score and sorts by that score. What differs is the scoring function. In keyword search, the classic function is BM25, which rewards documents that contain the query’s terms, weights rare terms more heavily than common ones (the idea behind TF-IDF) and dampens the advantage of long documents. A BM25 score has no fixed upper limit. A score of 14.2 means nothing on its own; it only means more than 9.7 in the same result list for the same query.
In vector search, the query and each document are turned into an embedding, and the score is a similarity or distance between the two vectors. Cosine similarity ranges from minus one to one, though most text embeddings cluster in a much narrower band. Dot product similarity is unbounded unless the vectors are normalised, and Euclidean distance inverts the logic, so smaller is better. Vector databases often convert distances into a similarity so that higher always means closer, and each product does that conversion in its own way.
A third family of scores comes from models that read the query and the candidate together. A cross-encoder outputs a single number, often passed through a sigmoid so it lands between zero and one, that estimates whether the passage answers the query. Learning to rank models combine many signals, such as text match, freshness and click data, into one score. These scores sit closer to what people mean by relevance, at a higher cost per result.
Relevance scores compared by method
Method | Typical range | Higher is better? | What it measures |
|---|---|---|---|
BM25 | 0 to unbounded | Yes | Term overlap, weighted by rarity and document length |
Cosine similarity | -1 to 1 | Yes | Angle between query and document embeddings |
Dot product | Unbounded | Yes | Angle and vector length together |
Euclidean distance | 0 to unbounded | No | Straight-line distance between embeddings |
Cross-encoder | Often 0 to 1 after a sigmoid | Yes | The model’s estimate that the passage answers the query |
Reciprocal rank fusion | Small positive values | Yes | Agreement between several ranked lists |
Why scores from different systems don’t compare
Because every function has its own scale, a score only has meaning relative to other scores from the same function, for the same query, over the same index. A cosine similarity of 0.82 from one embedding model is not equivalent to 0.82 from another, and neither can be set against a BM25 score of 12 (the scales differ for the reasons covered in BM25 vs embeddings). Even within one system, scores drift between queries. A short, common query can produce a list where every result scores between 0.80 and 0.85, while a specific query produces one result at 0.91 and the rest below 0.5.
This matters most in hybrid search, which runs keyword and vector retrieval side by side. Adding a BM25 score to a cosine score produces a number dominated by whichever scale is larger. Systems handle this in two ways. Score normalisation rescales each list, for example with min-max scaling, before taking a weighted sum. Rank fusion ignores raw scores and combines positions instead: reciprocal rank fusion gives each result one divided by (k plus its rank) from every list and adds the values up. Fusion is popular because it needs no tuning of scales, and the fused score that comes out is small and only meaningful as an ordering.
Relevance score and relevance
A score is the system’s guess. Search relevance is whether the result helps the person or agent that searched. The two often line up, with a well-known gap between them: a high similarity score says a passage is about the same thing as the query, and whether it contains the answer is a separate question. A chunk describing Q3 revenue will score highly for a question about Q3 projections, because the words and meaning overlap, even when the projection figure lives in another paragraph. This is the argument behind similarity isn’t relevance, and it explains many confident wrong answers in RAG.
The gap widens as a corpus grows. With millions of chunks, many will sit close to any query in embedding space, and scores bunch together. When the top twenty results all score within a few hundredths of each other, the order among them is close to arbitrary. This effect is sometimes called semantic collapse. Semantic similarity still does useful work at that scale, but it needs help from exact matching, filters or a reranker to separate the results that answer the question from those that only discuss it.
Using relevance scores in practice
The most common use of a score is ranking, which needs nothing more than the order. The second is cut-offs: deciding how many results to keep. Top-k retrieval keeps a fixed number regardless of score, so weak results get through when few documents match and good ones get dropped when many do. A score threshold adapts to the query, keeping everything above a value and returning nothing when nothing clears it. Thresholds trade precision and recall. Set high, they return fewer, more reliable results; set low, they cast a wider net. The case that top-k is the wrong default rests on this point.
Thresholds only work when scores are reasonably stable for a given system, so they are set by testing on real queries. Take a few hundred queries from logs, label which results are relevant, and plot the scores of relevant and irrelevant results. Where the two distributions overlap least is a sensible starting threshold. Relative thresholds are another option: keep results that score within a set fraction of the top result, which copes better with queries whose scores are all high or all low.
The third use is gating. An agent can check the top score before answering and, if it is low, search again with a rewritten query, ask a clarifying question or say it does not know. Corrective RAG builds this check into the pipeline. Gating works best with reranker scores, which track whether a passage answers the question more closely than raw similarity does.
Reranking and second-stage scores
Most production systems score twice. The first stage uses a cheap function over the whole index, such as BM25, approximate nearest neighbour search or both, and returns a few hundred candidates. The second stage, reranking, rescores those candidates with a more expensive model and keeps the best. The reranker’s scores replace the first-stage scores for ordering, and they are usually the better basis for thresholds. A reranker can only reorder what the first stage found, which is why reranking can’t fix a bad first pass. For the models used at this stage, see best reranking models.
A worked example
A support agent searches a help centre for “can I change the billing email on an annual plan?”. The first stage returns 50 candidates. The top five by cosine similarity are an article on changing the account email (0.86), one on annual plan pricing (0.85), one on billing contacts (0.84), one on invoice delivery (0.83) and one on upgrading plans (0.81). The scores are almost flat, and the most useful article, on billing contacts, sits third.
A cross-encoder rescores the 50 candidates. Billing contacts rises to 0.93 and invoice delivery to 0.61, while the account email article falls to 0.34 because it covers the login address, a different field. Pricing and upgrades fall below 0.2. With a threshold of 0.5, the agent passes two passages to the model instead of five, and the first one answers the question. The context is smaller, the answer rests on the right passage and the agent can cite it. These figures are illustrative, but the pattern of flat first-stage scores and well-separated reranker scores is typical.
Measuring whether scores rank well
Scores are judged by the rankings they produce. Retrieval evaluation uses a golden dataset of queries with known relevant results and measures how high those results land. NDCG rewards putting the most relevant results first, recall@k asks whether the relevant results appear in the top k at all, and mean reciprocal rank looks at the position of the first correct one. For RAG, context precision checks how much of what was retrieved was useful. Tracking these numbers before and after a scoring change shows whether a new model or threshold helped.
Relevance scores in memory retrieval
Agent memory adds signals that document search usually lacks. A memory that was true last month may be superseded today, so memory retrieval often blends semantic match with time, using recency weighting so that newer facts outrank older ones on the same topic, and sometimes importance scoring for facts that matter more. The final score is then a mix of how well a memory matches the query and how current and significant it is.
How Exabase returns relevance scores
Exabase’s search APIs return scores at the level where the answer lives. Deep Search returns hits with a relevance score per hit and per matched chunk, along with the chunk’s text and its location: a page number for documents, or a timestamp range for audio and video. An agent can therefore rank passages inside a long PDF or a recording, rather than whole files, which is the idea behind sub-document retrieval. Text queries are hybrid by default, combining semantic search with typo-tolerant keyword matching, and filters by kind, folder, tag or date narrow the candidates before scoring (see metadata filtering).
In place of a raw score threshold, Deep Search exposes a precision parameter from 0 to 1, with a default of 0.3. Low values return a wide set of loosely related results for research; high values return only the closest matches for a factual question. The searching resources guide and the search endpoint reference cover the parameters, and choosing a precision setting walks through the trade-off.
Exabase Memory search returns each memory with a score, using hybrid semantic and keyword search with recency bias. Optional query expansion (expandQueries, 1 to 5) runs related queries and combines their scores, the reranker considers up to 500 candidates (rerankCandidates), and rerankThreshold drops a share of the lowest-scoring reranked results, so 0.05 removes the bottom 5%. The memory search reference lists the fields. Exabase does not publish how its scores are calibrated, so treat them as a ranking within one query and tune any thresholds on your own data. For teams whose problem is confident wrong answers, the RAG accuracy solution and the RAG pipelines use case show how the pieces fit together.
Frequently asked questions
What is a relevance score?
A relevance score is the number a search system gives each result to estimate how well it matches a query. Results are sorted by it, and its scale depends on the scoring function, such as BM25, cosine similarity or a reranker.
What is a good relevance score?
It depends on the system. A cosine similarity of 0.8 can be strong for one embedding model and ordinary for another, and BM25 scores have no fixed scale. Find a good value by labelling results for real queries and seeing where relevant and irrelevant scores separate.
Can relevance scores be compared across queries?
Only loosely. Scores from the same system shift with query length and specificity, so a fixed threshold that works for one kind of query can be too strict or too loose for another. Relative cut-offs and reranker scores are more stable.
What is the difference between a relevance score and a similarity score?
A similarity score measures how close two pieces of text are in meaning or wording. A relevance score is any score used to rank results by usefulness, which may be a similarity score, a reranker’s output or a blend of signals such as recency. Similarity is one input to relevance.
How do rerankers change relevance scores?
A reranker rescores a shortlist by reading the query and each candidate together. Its scores usually separate useful results from unhelpful ones more clearly than first-stage scores, which makes them a better basis for thresholds.
Why do all my search results have similar scores?
Usually because the corpus holds many passages close to the query in embedding space, so similarity scores bunch together. Adding keyword matching, metadata filters or a reranker spreads them out.
Does Exabase return relevance scores?
Yes. Deep Search returns a score per hit and per matched chunk, with page numbers or timestamps, and Memory search returns a score per memory. A precision parameter controls how strict Deep Search results are.
Related pages: Search relevance, semantic similarity, reranking, cross-encoder, reciprocal rank fusion, BM25, cosine similarity, precision and recall, Deep Search, RAG accuracy