HybridRetriever#

class scikitplot.mcp.HybridRetriever(retrievers, *, weights=None, rrf_k=60, fanout=4, strict=False)[source]#

Fuse several retrievers into one via Reciprocal Rank Fusion.

Parameters:
retrieverssequence of DocsRetriever

The legs to fuse (e.g. dense, BM25, graph).

weightssequence of float, optional

Per-leg weight (default all 1.0). Length must match retrievers.

rrf_kint, optional

RRF constant (default DEFAULT_RRF_K).

fanoutint, optional

Over-fetch factor: each leg is asked for fanout * k candidates so fusion has depth to work with (default 4).

strictbool, optional

False.

Parameters:

Notes

Resilient: a leg that raises is skipped, not fatal — one broken backend must not take down retrieval. Read-only; results are sanitised downstream by build_search_docs_result.

search(query, k=5)[source]#

Query every leg, fuse by RRF, and return the top-k fused chunks.

Parameters:
Return type:

list[RetrievedChunk]