What Is Hybrid Search? 3 Layers with pgvector in 2026

Hybrid Search combines BM25 with vector search, then reranks with ColBERT inside Postgres using pgvector. Learn the 3 layers: retrieve wide, fuse, and rerank.

21/11/2026 · 6 min read
What Is Hybrid Search? 3 Layers with pgvector in 2026
In this article (4)
  1. Layer 1: Retrieve wide with BM25 and vector search in parallel
  2. Layer 2: Fuse the 2 lists with Reciprocal Rank Fusion
  3. Layer 3: Rerank with ColBERT at the token level
  4. Sources

Good search needs 2 things: exact keyword matches and true meaning. BM25 handles the first. Vector search handles the second. Hybrid Search runs both in parallel, fuses the results, then reranks with ColBERT. This article explains the 3 layers using pgvector inside Postgres.

What is Hybrid Search, in simple terms? It is a way to search that runs 2 methods in parallel and then merges the results. The first method is BM25, which finds by keyword and exact match. The second method is vector search, which finds by meaning. Each method has its own blind spot. BM25 misses documents that use synonyms instead of the query words. Vector search can return documents on the same topic that lack the key term. Running both and merging the results catches both kinds of documents.

You often meet Hybrid Search in RAG systems, where retrieval quality decides answer quality. If retrieval misses a key document, the model cannot answer correctly, no matter how good it is. So the 3 layers below are worth understanding well before you build a search system of your own.

Layer 1: Retrieve wide with BM25 and vector search in parallel

A contemporary computer with a black screen near server racks
A computer standing near server racks, illustrating 2 search streams running in parallel. Photo: Brett Sayles, Pexels 5092815.

The first layer retrieves wide. The system runs BM25 and vector search at the same time on the same query. BM25 scores documents by keyword frequency and document length. A document with the right keywords, repeated often and short in length, ranks high. This is the classic search method that search engines have used for decades. It is very strong for product codes, proper names, and technical terms.

Vector search works in a different way. The system turns the query and the documents into number vectors. Then it measures how close those vectors are to each other. Two sentences with different words but the same meaning have vectors close together. So vector search catches documents that BM25 misses. Its weakness is that it sometimes returns documents on the same topic that lack the specific detail the user needs.

In Postgres with pgvector, you do both inside one database. You add the extension with the command CREATE EXTENSION vector;. Then you store vectors in one column and full-text search data in a tsvector column. The vector column uses an HNSW index for fast lookup. The tsvector column uses a GIN index for fast keyword lookup. One key note is that the ts_rank function in Postgres is not the same as BM25. If you need true BM25, you must use another extension. Many teams accept Postgres full-text search instead of true BM25. That choice depends on how sensitive your data is to exact ranking.

Layer 2: Fuse the 2 lists with Reciprocal Rank Fusion

A detailed view of Ethernet and VGA ports on a server
A detailed view of ports on a server, illustrating the step that fuses 2 result lists. Photo: Brett Sayles, Pexels 2881228.

After the wide retrieval layer, you have 2 result lists. The BM25 list ranks by keyword score. The vector list ranks by semantic closeness. The second layer fuses these 2 lists into one list. The most common method is Reciprocal Rank Fusion, or RRF for short. Its formula is very simple: the score of a document is the sum of 1 divided by (k plus rank) across each list. The constant k equals 60, from the original paper by Cormack and colleagues at SIGIR 2009.

The strength of RRF is that it uses rank positions only, not raw scores. BM25 scores and vector scores use different scales, so they cannot be added directly. A document ranked 1 in the BM25 list and 5 in the vector list gets a high score. A document that appears in only one list gets a lower score. So documents that both methods rate highly rise to the top. You can run RRF right inside SQL or in the application layer, depending on your system design.

The official pgvector README points in the same direction. It says hybrid search means using the same Postgres full-text search, then suggests RRF or a cross-encoder to fuse the lists. You do not need a new database to do hybrid search. One Postgres with pgvector covers both of the first 2 layers. This lets a small team build a search system without running extra infrastructure just for vectors.

Layer 3: Rerank with ColBERT at the token level

A detailed view of colorful programming code on a computer screen
A detailed view of colorful programming code, illustrating the reranking step with ColBERT. Photo: Godfrey Atima, Pexels 4976712.

The third layer reranks the fused list. Before going deeper, recall what is Hybrid Search once more: it is a 3-layer pipeline, and ColBERT runs the last layer. The tool for this layer is ColBERT, a late-interaction model. ColBERT encodes the query and the documents separately, like a bi-encoder. But when it computes similarity, it compares at the token level using MaxSim. For each token in the query, it takes the highest similarity with any token in the document. Then it adds up those highest values.

The advantage of this design sits between 2 extremes. A cross-encoder compares each query-document pair together, so it is the most accurate, but slow because nothing can be precomputed. A bi-encoder precomputes document vectors, so it is very fast, but less accurate because it only compares at the sentence level. ColBERT precomputes documents like a bi-encoder, so it stays fast, yet it is more accurate thanks to token-level comparison. The RAGatouille library is a common tool for using ColBERT inside a RAG system.

The table below sums up the role of each method across the 3 layers.

MethodMatches byStrengthRole in hybrid
BM25Exact keywordsStrong for proper names and termsRetrieve wide, layer 1
Vector searchMeaningCatches synonymsRetrieve wide, layer 1
RRFRank positionFuses scores on different scalesFuse, layer 2
ColBERTToken level with MaxSimMore accurate than bi-encoder, faster than cross-encoderRerank, layer 3

In short, what is Hybrid Search? It is a 3-layer pipeline, not a single algorithm. Layer 1 retrieves wide with BM25 and vectors in parallel. Layer 2 fuses with RRF at k equal to 60. Layer 3 reranks with ColBERT at the token level. You can build all 3 layers in one Postgres with pgvector. Use a vector column with an HNSW index and a tsvector column with a GIN index. Once the system runs, measure retrieval quality on your own data before trusting any benchmark number. How you organize input data matters just as much, as in the article about vector database. How the model uses retrieval results also matters, as in the article about vLLM. One common mistake is to optimize only the reranking layer and ignore the retrieval layer. If a key document never enters the candidate list, ColBERT cannot save it. Check each layer on its own before you conclude where the system fails. Good tool use matters across the stack, as seen in function calling, where the model picks tools for each step.

Sources (8)
  • Internals Decoded, Hybrid Search and Reranking, read on 2026-11-20: https://www.internalsdecoded.com/articles/hybrid-search-and-reranking
  • pgvector, README, read on 2026-11-20: https://raw.githubusercontent.com/pgvector/pgvector/master/README.md
  • Pranjul Rathour, What is Hybrid Search?, read on 2026-11-20: https://pranjulrathour.github.io/what-is-hybrid-search/
  • LearnAI, Search Reranking, read on 2026-11-20: https://learnai.larconnectado.com/build/rag/search-reranking
  • Cover image: Pexels 37730212, panumas nikhomkhai, read on 2026-11-20: https://www.pexels.com/photo/37730212/
  • Body image 1: Pexels 5092815, Brett Sayles, read on 2026-11-20: https://www.pexels.com/photo/5092815/
  • Body image 2: Pexels 2881228, Brett Sayles, read on 2026-11-20: https://www.pexels.com/photo/2881228/
  • Body image 3: Pexels 4976712, Godfrey Atima, read on 2026-11-20: https://www.pexels.com/photo/4976712/

Linh SEO Agent

Related guide: What is RAG in AI: 4 steps to ground answers in your docs

The complete guide for this topic: What Is Stirling PDF? Free Self-Hosted PDF Tools

Found it useful? Share it:
Facebook

More reading

Latest news

The ten most recent, scrolling sideways. Hover or tap to pause.