glossary

Context and retrieval

Semantic search

Semantic search ranks documents by how close their embeddings are to the query embedding, so it can find a passage that means the same thing as the question even when the two share almost no keywords.

Abracadabra Team Glossary

How it works

The query is embedded, the index holds embeddings of the documents or chunks, and the rank is by vector nearness. Shared keywords are not required. A question in everyday words can surface a policy written in departmental ones, which is the result keyword search misses. The method can also miss the opposite case. An exact code, a drug name spelled in a particular way, or a negation can be closer in characters than in vectors, and the nearest paragraph may discuss the topic while stating the wrong condition.

Semantic search returns an order of texts. It does not return an answer, and it does not apply the policy. The same caveats as any embedding apply: one model for index and query, a chunking scheme that matches the questions, and a cutoff that decides what a later model will read. Hybrid search exists because this rank is weak on exact tokens. Treating semantic rank as the whole retrieval story is how identifier questions quietly fail.

A worked example

A weekend discharge policy with none of the query words

A nurse on a ward searches the hospital intranet for "who can authorise a weekend discharge". The keyword index finds pages that contain those words and little else. The semantic index ranks highest a policy titled "out-of-hours consultant approval", which shares almost none of the query tokens and says the on-call consultant signs the discharge. That ranking is the search working. It has not decided whether this patient meets the policy. If the nurse had typed the form code printed on the paper copy, the same vector rank might have preferred a general essay on discharge planning and missed the form, because the code is a keyword problem sitting beside a meaning problem.

Illustrative example, not a production trace and not a measured result.

What goes wrong

  • A query that hinges on a code, a surname or a form number returns thematic neighbours and never the row that contains the exact token. The exact form the person named never appears.
  • A negation in the question, such as a request for wards that do not need consultant sign-off, matches passages that are about consultant sign-off.
  • The index was embedded with one model and the query with another after a quiet upgrade, so relevant titles stop appearing and the intranet looks empty.

How to measure it

Keep queries where the accepted passage shares few tokens with the question, which is the case semantic rank is for. Alongside them, keep exact-identifier queries that returned no hit or the wrong neighbour.

After you change the embedding model or the chunking, compare task success for that task and cohort. Read sessions where the person rephrases the question into the policy's own title after the first result missed. Keep that rephrased query beside the first miss.

How Abracadabra helps

A person who repeats the search using the document's own title has often just done the keyword step the vector rank skipped. After the ranker changes, compare task success for that task and cohort.

When context is lost, people restate a fact or repeat the request. Abracadabra pins those corrections and repeated intents to the turn. After a change to what the agent keeps, compare task success for that task and cohort with the previous period.

Request access to read this on your own agent.

See it in your own agent's conversations.

Each task, the step where it stops, and the conversations behind every count. Free during early access.