Hybrid Retrieval for RAG: Why Knowledge-Base Q&A Misses the Answer

    When RAG fails to surface facts that already sit in the knowledge base, the bottleneck is usually retrieval—not the generator. This article explains why dense and keyword search complement each other, how a dual-recall, fusion, and rerank pipeline works, and how to enable hybrid retrieval on mature platforms and tune it with evaluation, chunking, and bad-case feedback.

    1. A pitfall almost every RAG project hits

    If you have built knowledge-base Q&A with retrieval-augmented generation (RAG), you have likely seen this: the answer is already in the corpus, but retrieval never brings it back. A user asks, “What is the longest processing cycle for an order refund?” The document states it clearly, yet the model replies that there is no relevant information.

    The first instinct is often a larger model or a more elaborate prompt. In practice, RAG quality is capped at retrieval: if the right passages are missing, even a strong generator has nothing to work with.

    This piece looks at a problem most RAG systems eventually face: why hybrid retrieval can lift recall and precision well above a single retrieval path, and how to land that capability at low cost.

    2. Why a single retrieval path is not enough

    Mainstream retrieval falls into two families, each with a built-in blind spot.

    2.1 Vector retrieval: strong on semantics, weak on exact terms

    Vector (dense) retrieval encodes queries and documents as high-dimensional vectors and scores them with metrics such as cosine similarity. It is robust to natural-language variation—“how do I return an item” and “return and exchange process” can still match.

    Its weakness is insensitivity to exact match. Typical cases include:

    • Proper names and IDs: error codes, ticket numbers, and product SKUs (for example, ERR-4021) have little distinction in embedding space;
    • Abbreviations and jargon: internal system short names and domain terms that the embedding model rarely saw in training;
    • Short queries: the shorter the query, the fuzzier the vector, which often retrieves content that is semantically close but not the answer.

    2.2 Keyword retrieval: exact hits, no understanding of phrasing

    Keyword retrieval based on inverted indexes (for example, BM25) is strong at exact match: error codes, model numbers, and names hit reliably. It does not understand meaning. If the user asks “how do I send this back” and the document says “reverse logistics request process,” there is no lexical overlap and recall can be zero.

    2.3 They complement each other

    Dimension Vector retrieval Keyword retrieval
    Semantic generalization Strong Weak
    Exact match Weak Strong
    Long-tail terms Weak Strong
    Conversational queries Strong Weak

    Failure modes barely overlap. That is the case for hybrid retrieval: run both paths, then merge and deduplicate. Whether the query is semantic or literal, one path can still recover the answer.

    3. A complete hybrid retrieval pipeline

    An engineering-ready hybrid setup usually has three stages.

    3.1 Dual-path recall

    The same query is sent to the vector index and the keyword index. Each returns a Top-K candidate set. K can be set independently: a larger K on the vector path to protect recall, a smaller K on the keyword path to protect precision.

    3.2 Fusion ranking

    The two lists must become one ranking. A common method is Reciprocal Rank Fusion (RRF):

    1. score(doc) = Σ 1 / (k + rank_i(doc)) # k is often 60

    RRF depends on rank, not raw scores, so cosine similarity and BM25 scores do not need to be comparable. Weighted fusion is also an option when you have a prior on query type.

    3.3 Reranking

    A cross-encoder then scores the fused candidates and pushes truly relevant snippets to the top. The final Top-N is sent to the generator. This often moves the gold passage much higher, which matters for long context because generators attend more to earlier content.

    Flow:

    1. User query
    2. ├── Vector retrieval ──→ Candidate set A (Top-K1) ─┐
    3. │ ├─→ Merge/dedup (RRF) ─→ Rerank ─→ Top-N → Generation
    4. └── Keyword retrieval ─→ Candidate set B (Top-K2) ─┘

    4. Landing it is easier than it looks: many platforms already include it

    Building dual recall plus fusion from scratch—selection, implementation, tuning—can consume a month quickly.

    Many LLM application and knowledge-base platforms already expose hybrid retrieval as a built-in option. On common open-source LLM app platforms (including examples such as Baidu AI Cloud Qianfan AppBuilder), knowledge-base retrieval settings typically allow you to:

    1. Open the knowledge base retrieval configuration;
    2. Switch the retrieval mode from vector-only to hybrid;
    3. Optionally enable reranking (some platforms require a rerank model);
    4. Save and re-index existing documents, or apply immediately, depending on the platform.

    On a mature platform, a large recall gain is often a configuration toggle. Effort belongs on evaluation and ongoing tuning, not on reinventing the pipeline.

    5. Practice: tune until it actually works

    Turning hybrid retrieval on is only the start. Practical notes:

    • Build an eval set before you tune: collect tens to hundreds of real questions plus the passages that contain the gold answers. Compare Recall@K and hit rate before and after, instead of tuning by feel.
    • Watch chunking: retrieval quality starts with split quality. Chunks that are too large dilute relevance; chunks that are too small lose context. For structured documents, split by heading hierarchy with modest overlap.
    • Separate query types: if IDs and terms dominate, raise keyword-path weight; if queries are conversational, lean on the semantic path. Some platforms expose weights in hybrid mode—worth experimenting.
    • Enable reranking: when compute allows, reranking is often a cheap win for answer accuracy.
    • Collect bad cases continuously: live “wrong answer” cases are the best tuning data. Feed them back into the eval set and close the loop.

    6. Takeaway

    When knowledge-base Q&A answers the wrong question, retrieval is usually the bottleneck. Vector search understands meaning but forgets terms; keyword search hits strings but not paraphrase. Those gaps complement each other, which is why hybrid retrieval can raise recall and precision.

    Dual recall, fusion ranking, and reranking are already packaged on mainstream platforms and are often one setting away. Rather than spending a month building it yourself, enable hybrid retrieval first and spend the time on evaluation and tuning—that is the more reliable way to make knowledge-base Q&A work.