import { RagReranker } from "./reranker.contract.mjs"; //#region ../ai/src/rag/rerank/keyword-reranker.d.ts /** Options for the {@link keywordReranker}. */ type KeywordRerankerOptions = { /** * Weight of the lexical-overlap signal blended with the original cosine * score, in `[0, 1]`. `1` ranks purely by keyword overlap; `0` keeps the * cosine order. Default `0.5`. */ weight?: number; }; /** * Zero-dependency lexical reranker (a BM25-lite, IDF-free keyword overlap). * * For each candidate it computes the fraction of distinct query terms that * appear in the chunk, blends that with the candidate's original cosine * score by `weight`, and sorts descending. A pure-lexical pass costs * nothing beyond string splits — no peer, no model — so it is the * recommended opt-in reranker when an embedding-only ranking surfaces a * keyword-rich chunk too low. * * Ties (equal blended score) preserve the incoming order, so the cosine * ranking breaks ties deterministically. * * @example * const kb = ai.rag({ embedder, store, reranker: ai.rag.keywordReranker() }); */ declare function keywordReranker(options?: KeywordRerankerOptions): RagReranker; //#endregion export { KeywordRerankerOptions, keywordReranker }; //# sourceMappingURL=keyword-reranker.d.mts.map