Prompt
need hybrid search keyword plus embeddings
Latest observation
Oct 7, 2026
OpenAI APIWeb search: off
Yes — hybrid search combines keyword-based search and embedding/vector search so you get both:
- Keyword search: exact term matching, filters, high precision for named entities, IDs, rare terms
- Embedding search: semantic similarity, paraphrases, concept matching, typo/wording variation
Common hybrid approach
- Run a keyword retriever and a vector retriever in parallel
- Merge results
- Re-rank them using:
- weighted score combination, or
- a cross-encoder / reranker model
Typical scoring strategies
1) Weighted sum
final_score = a * keyword_score + b * vector_score
Good when both scores are normalized.
2) Reciprocal Rank Fusion (RRF)
Combines ranked lists without needing score normalization.
RRF = Σ 1 / (k + rank)
Often works very well in practice.
3) Rerank top-N
- Retrieve top 50 from keyword
- Retrieve top 50 from vector
- Union them
- Use a reranker to select final top 10
Best use cases
- Enterprise search
- Product search
- Document search
- RAG / chatbot retrieval
- Code search
Simple architecture
Query
├── Keyword search (BM25 / inverted index)
├── Vector search (embeddings / ANN)
└── Merge + Rerank
↓
Final results
If you're building this
Tools
- Elasticsearch / OpenSearch: supports hybrid setups
- Weaviate
- Pinecone + keyword layer
- Qdrant + external BM25
- Vespa
- Postgres + pgvector + full-text search
Practical recommendation
If you want strong quality:
- use BM25 + embeddings
- apply RRF
- then rerank with a cross-encoder if latency allows
If you want, I can give you:
- a code example in Python,
- a DB-specific implementation (Elasticsearch, OpenSearch, Postgres, etc.),
- or a design for RAG hybrid retrieval.