import { RankedItem } from "./rrf.mjs"; //#region ../ai/src/rag/hybrid/bm25.d.ts /** A document to score lexically. */ type LexicalDoc = { id: string; text: string; }; /** * Rank `docs` against `query` with BM25 (A4) — the lexical half of hybrid * retrieval. Scores keyword overlap with TF saturation (`k1`) and length * normalization (`b`) over the candidate set, so an exact-term match * surfaces even when dense embeddings miss it. Returns docs sorted by * score (highest first); zero-score docs are dropped. * * Operates over the supplied candidate set (typically the dense retriever's * over-fetch), so it needs no global corpus index — ideal for fusing with * a vector ranking via {@link reciprocalRankFusion}. */ declare function bm25Rank(query: string, docs: ReadonlyArray): RankedItem[]; //#endregion export { LexicalDoc, bm25Rank }; //# sourceMappingURL=bm25.d.mts.map