Skip to navigation

How search ranks pages

How semantic and keyword search combine, and how to read a result.

Each search runs two lookups and merges them. Semantic search finds pages whose meaning is close to the query even when the wording differs. Keyword search finds pages that contain the query’s names, codes and identifiers, which semantic search can miss.

QuerySemanticcosine similarityKeywordtitle, summary, bodyMerge and rankResultsQuerySemanticcosine similarityKeywordtitle, summary, bodyMerge and rankResults
Your appThe brain

How results are ordered

A page ranks higher when it’s closer to the query in meaning and when the query’s words appear in its title, summary or body. A page found only by semantic search ranks by similarity alone.

Each result’s similarity field holds the vector score only, so two results can appear out of similarity order when one of them also matched on keywords. The combined rank isn’t returned.

The similarity floor

minSimilarity drops semantic matches below 0.35. Keyword matches are kept below it.

minSimilarity 0.35Matched onpricingbothplans-and-limitssemanticenterprise-seat-capkeywordteam-offsite-notesdropped0.00.51.0SimilarityminSimilarity 0.35Matched onpricingbothplans-and-limitssemanticenterprise-seat-capkeywordteam-offsite-notesdropped0.00.51.0
Illustrative results for “enterprise seat limit”. The third page is kept because it contains the words. The fourth has neither enough similarity nor a keyword match.

Defaults and limits

SettingDefaultNotes
topK5How many results to return
minSimilarity0.35Floor for semantic matches. Keyword matches are returned below it
What gets embeddedTitle, summary and the start of the bodyText further into a long page is reached by reading the page
Excerpts500 characters, 5 resultsUp to 20 results and 2,000 characters each, where a response includes excerpts

Reading a result

matchedOn says why a page came back:

matchedOnWhat it meansWhat to do with it
bothClose in meaning and contains the query’s wordsUsually the strongest candidate
semanticClose in meaning, no shared keywordsUseful for paraphrased questions. Check the page says what you need
keywordContains the words, may be below the similarity floorUseful for names and IDs. The word may only appear in passing

Similarity and correctness

A similarity of 0.82 says the page sits close to the query in embedding space. It gives no 82% chance that the page answers the question. A page that contains the answer and a page that only discusses the topic can score the same.

Use the score to choose which pages to open, then read them to decide whether you have an answer. How to build with Living Brain covers that step.

Search or the prompt index

Search answers a specific question. The prompt index is a short digest of the brain’s most important pages, pinned pages first, that gives an agent general context. Agents that hold a conversation usually load the index at the start of a session and search when a question needs something specific.