Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Infiniflow Ragflow Hybrid Retrieval

From Leeroopedia
Knowledge Sources
Domains RAG, Information_Retrieval, NLP
Last Updated 2026-02-12 06:00 GMT

Overview

A search strategy that combines dense vector similarity with sparse keyword matching and optional reranking to retrieve the most relevant document chunks.

Description

Hybrid Retrieval merges two complementary retrieval paradigms: dense retrieval (embedding-based vector similarity) and sparse retrieval (BM25-style keyword matching). The vector similarity weight parameter controls the balance: a weight of 0.3 means 30% vector + 70% keyword. Results from both methods are fused using score combination, then optionally reranked by a cross-encoder model. This hybrid approach outperforms either method alone because vector search captures semantic meaning while keyword search captures exact term matches.

Usage

Use this principle for testing retrieval quality on a knowledge base. This is the core search mechanism used by chat applications, search applications, and the retrieval testing interface.

Theoretical Basis

scorehybrid=wvecsimvector(q,d)+(1wvec)scorekeyword(q,d)

Where:

  • wvec is the vector_similarity_weight (default 0.3)
  • simvector is cosine similarity between query and document embeddings
  • scorekeyword is the BM25/TF-IDF keyword relevance score

Optional reranking applies a cross-encoder to the top-K results for more precise ordering.

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment