import { RankedItem } from "./rrf.mjs"; import { LexicalDoc } from "./bm25.mjs"; //#region ../ai/src/rag/hybrid/hybrid-rank.d.ts /** * Hybrid rank (A4) — fuse a dense (vector) ranking with a BM25 lexical * ranking over the same candidate set via Reciprocal Rank Fusion. Dense * retrieval captures semantic similarity; BM25 captures exact-term * matches dense embeddings miss (names, ids, rare tokens). Fusing both * beats either alone for keyword-heavy queries. * * `dense` is the vector retriever's result in rank order; `candidates` * supplies the text for the lexical pass (typically the same over-fetched * set). Returns the fused ranking, highest score first. * * @example * const fused = hybridRank({ * query: "invoice 8842 refund", * dense: vectorHits, // [{ id }, ...] in similarity order * candidates: vectorHits.map(h => ({ id: h.id, text: h.text })), * }); */ declare function hybridRank(params: { query: string; dense: ReadonlyArray<{ id: string; }>; candidates: ReadonlyArray; k?: number; }): RankedItem[]; //#endregion export { hybridRank }; //# sourceMappingURL=hybrid-rank.d.mts.map