fastrag.retrieval.hybrid#

Composable hybrid retrieval with replaceable ranking fusion.

Classes

HybridRetriever(*, retrievers[, fusion, ...])

Fetch candidates from each retriever concurrently, then fuse their ranks.

class fastrag.retrieval.hybrid.HybridRetriever(*, retrievers, fusion=None, candidate_k=40)[source]#

Bases: Retriever

Fetch candidates from each retriever concurrently, then fuse their ranks.

Parameters:
async retrieve(query, *, k=5)[source]#

Fuse the candidate rankings down to k documents.

Parameters:
Return type:

list[Document]