Glossary

What is hybrid search?

Hybrid search runs a keyword search and an embedding search over the same material and merges the results, because each finds things the other misses. How the two are fused, where a graph adds a third signal, and when it is still not enough.

Hybrid search is retrieval that asks two different questions of the same material and combines the answers. One is lexical: which passages contain the words in the query? The other is dense: which passages mean something close to the query? Each is good at what the other is bad at, and the combination finds more of what matters than either alone.

The two halves

Lexical retrieval is classic full-text search. The query is broken into terms, and passages are scored by how many of those terms they contain, weighted so that rare words count for more than common ones. BM25 is the standard scoring function in search engines such as Elasticsearch, and databases including Postgres ship full-text ranking built on the same idea. It is fast, needs no model, and is exact: a search for INV-0185 finds the passages containing INV-0185 and does not confuse it with INV-0182.

Dense retrieval uses embeddings. The query and every passage are turned into vectors by an encoder model, and the passages whose vectors sit nearest the query's are returned. It finds meaning rather than words: "has Acme paid yet?" reaches a passage that says "the client settled the outstanding balance on Friday", which shares no useful term with the question.

What each misses

The failures are close to mirror images.

Lexical search misses paraphrase. If the question says "cancel" and the record says "terminate", or the question says "who looks after billing" and the record says "the finance lead owns the payments migration", there is no overlap to score. It also struggles with short conversational follow-ups that carry almost no terms of their own.

Dense search misses precision. Invoice numbers, order references, error codes, product SKUs, surnames and figures all blur together in an embedding space, because the encoder was trained to treat near-identical strings as near-identical meaning. In company data these exact strings are often the whole question.

A system that only does one of the two tends to look fine in a demo and fail on the questions people actually ask, which are a mix of both kinds.

Fusing the results

The two searches return separate ranked lists, and their scores are on different scales: a BM25 score and a cosine similarity cannot be added together meaningfully. The common answer is reciprocal rank fusion, which ignores the raw scores and gives each passage credit based on its position in each list, so a passage ranked well by both methods rises to the top without either method's scale dominating. Weighted score blending is the alternative, and needs tuning whenever the encoder or the corpus changes.

Many pipelines then pass the fused shortlist to a slower second-stage model that reads each candidate together with the question and re-orders them.

A third signal: relationships

Words and meaning are both properties of the passage. Some questions depend on something else: how records relate. "What did the account manager for our largest customer promise last month?" contains no term that appears in the answer and means nothing close to it. Answering it requires knowing who the largest customer is, who manages that account, and what that person said.

A knowledge graph supplies that signal. If the question names an entity, the graph can return the facts attached to it, and one step further out, the facts attached to its neighbours. This is the core idea in GraphRAG and in a context graph: retrieval follows structure as well as text.

When hybrid is not enough

Hybrid search improves recall. It does not decide what is true. If two systems hold different renewal dates, a better search finds both and hands the model the disagreement. If one record is from last year, hybrid search has no sense of time unless the ranking adds one. And if the same customer is recorded under three names, keyword and vector search will each find a third of the picture. Those problems need entity resolution, supersession of old facts and a ranking that knows when something was true, which sit around the search rather than inside it.

Where Memtro stands

Memtro's retrieval combines all three signals. Memory is searched by vector similarity, by full-text rank in Postgres, and through the graph (the facts attached to the entities a question names, and one hop out to their neighbours), and the lists are combined with reciprocal rank fusion before a cross-encoder re-scores the shortlist. Ranking then accounts for recency, corroboration and whether a fact's stated validity has passed. The memory documentation covers each step.

Where agents remember your company

Sign in, add a provider key, create an API key and point your tools at Memtro. It takes about five minutes.

7-day free trial · card on file, nothing charged until it ends · cancel any time