Hybrid Search
Combining vector (semantic) and BM25 (keyword) search. (Ref: https://www.pinecone.io/learn/hybrid-search/)
Lesson previews
The team needs retrieval that protects exact policy language while still accepting employee phrasing. The best first move is hybrid retrieval with measured lexical and dense contributions, then evaluate on real paraphrases.
5 minImplement Hybrid Retrieval with RRFBM25 and dense retrieval each find useful support-ticket documents, but raw score averaging ranks a generic article above the exact error-code runbook. RRF hybrid retrieval: retrieve separately, fuse ranks, then rerank or assemble context The common trap is treating every numeric retrieval score as comparable. A BM25 score and a cosine similarity score do not represent the same evidence scale. Retrieve separately Run BM25 top 20 and dense top 20 for the same user question, preserving rank positions and document IDs. Separate runs keep each signal visible. You can inspect whether exact and semantic evidence are both contributing. Compute RRF…
5 minFuse Rankings Before You Try to Calibrate ScoresThe issue is not retrieval coverage; it is score comparability. RRF is the strongest first move because it combines rank positions from heterogeneous systems without assuming BM25, vector, and reranker scores share a scale.
5 minWalk from Baseline Search to Hybrid RetrievalUpgrade pressure A Monday deadline tempts the team to replace working lexical search with vectors. Advanced teams keep the baseline alive so they can measure what each new layer adds. Layered retrieval Baseline -> Dense -> Fusion -> Rerank Each layer has a job and a cost. The sequence protects exact-match trust while adding semantic reach. React Replace BM25 with vectors Better recall without losing exact evidence. An upgrade is only real if you can show which layer improved which query class. 01 Baseline 02 Fusion 03 Rerank Protect exact terms BM25 gets exact error codes right but misses symptom…
5 minDecide: When Hybrid Search Is Worth ItThe audit assistant misses exact control IDs while doing well on broad conceptual questions. Before: the audit assistant used dense vectors only and missed CC6.6 when the paragraph used slightly different phrasing. After: the team added lexical retrieval for identifiers, fused ranks, and measured recall@10 on 80 audit queries. Exact control lookups improved without hurting conceptual questions.
5 minHybrid Search Objection DeckObjection Vector search should understand the meaning, so why add keyword search? Use this when exact identifiers, SKUs, legal clause numbers, or error codes appear in query logs. Your line Meaning is not the whole intent. If the user types E-1049 or CC6.6, that token is part of the answer contract. Hybrid search lets exact-match and semantic evidence both compete. Do not frame lexical search as old or inferior; it solves a different part of the problem. It names the mixed-intent mechanism instead of arguing tools. Dense vs. lexical What does each path catch? Hybrid is warranted when real queries…
4 minHybrid Search BattlecardsObjection: 'Embeddings should handle this without keyword search.' Battlecard A stakeholder wants vector-only simplicity. Your line Embeddings handle paraphrase; exact identifiers still need lexical evidence. Hybrid lets each retriever cover the failure mode it is good at. Arguing that one method is always better turns a query-pattern issue into a tool debate. It frames hybrid as division of labor, not complexity for its own sake. Vector-only vs hybrid for audit queries Compare Use hybrid when the query contains identifiers and natural language. What does RRF avoid comparing directly? Score scales. It avoids directly comparing raw BM25 scores with vector similarity…
4 minUse Hybrid When Words MatterHybrid search is the escape hatch when exact language carries meaning. Vector Strength Vectors help when users and documents use different wording for the same concept. They are useful for natural questions, symptoms, descriptions, and fuzzy exploration. Keyword Strength Keyword retrieval helps when a token itself matters: a code, identifier, person, date, acronym, function name, or quoted phrase. Fusion RRF and similar approaches merge ranked lists without requiring raw vector scores and BM25 scores to mean the same thing. Agreement rises; disagreement still gives either retriever a chance. Decision Rule If users complain that search 'misses the exact thing I…
5 minFuse Keyword And Vector ResultsThe team needs to merge BM25 and vector results, but raw scores are not comparable across retrievers. Reciprocal Rank Fusion: combine ranked lists using rank positions, not raw score scales The common trap is averaging BM25 and vector scores without calibration. That makes the larger or more variable score dominate. List ranks BM25: A=1, B=2, C=3. Vector: B=1, C=2, A=3. Use each retriever's rank position; ignore raw score scale. Apply RRF With k=60, A gets 1/(60+1) + 1/(60+3). B gets 1/(60+2) + 1/(60+1). C gets 1/(60+3) + 1/(60+2). Higher ranks contribute slightly more, but agreement across lists matters. Sort fused…
5 minSort Queries By Retrieval StrategySort each query into the retrieval strategy that best fits its dominant signal. Keyword-first Vector-first Hybrid Rerank-heavy ERR-1842 checkout timeout How do I reverse a duplicate invoice payment? SOC2 CC6.6 exception evidence Best source for refund policy when customer paid through reseller Vendor name Acme Robotics contract addendum What changed in the onboarding workflow after the new risk review? API 429 retry policy for enterprise tenants Which of these five similar policy chunks is the actual exception?
4 minRelated skills
Optimizing document segments for retrieval accuracy. (Ref: https://www.pinecone.io/learn/chunking-strategies/)
GroundingConnecting model responses to verified external sources (e.g., Google Search). (Ref: https://ai.google.dev/gemini-api/docs/grounding)
Knowledge Graphs (GraphRAG)Representing entities and relationships for complex reasoning. (Ref: https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/)
Metadata FilteringScoping retrieval using structured attributes (tags, dates). (Ref: https://docs.pinecone.io/docs/metadata-filtering)
Parent Document RetrievalRetrieving small chunks but providing large context to the LLM. (Ref: https://python.langchain.com/docs/modules/data_connection/retrievers/parent_document_retriever)
Reranking (Cohere)Using secondary models to refine the relevance of retrieved results. (Ref: https://cohere.com/rerank)