/** * LLM-based reranker ("judge"). * * Takes a small pool of search candidates and asks an LLM to score each * for semantic relevance to the query. Blends the LLM score with the * underlying retrieval score so a poorly-calibrated LLM call can't * catastrophically drop a high-confidence retrieval result. * * Optional — only used when `ai_curation.enabled` is true. */ import type { LLMProvider } from '../../core/llm-provider.js'; import type { SearchResult } from '../../core/types.js'; export interface LLMJudgeCandidate { id: string; content: string; retrievalScore: number; } export interface LLMJudgeOptions { /** Maximum characters of content passed per candidate to the LLM. */ contentSnippetChars?: number; /** Maximum candidates sent to the LLM in one call. */ maxCandidates?: number; /** Weight blend: retrieval_weight + llm_weight must equal 1. */ retrievalWeight?: number; llmWeight?: number; /** Minimum milliseconds between LLM calls (simple rate limiting). */ minRequestIntervalMs?: number; } /** * LLMJudge — minimalist reranker that asks an LLM to score candidates 0..10. * Blends the normalized LLM score with the retrieval score. */ export declare class LLMJudge { private provider; private opts; private lastRequestAt; constructor(provider: LLMProvider, opts?: LLMJudgeOptions); private rateLimit; /** * Score each candidate from 0..10 for relevance to the query. * Returns a score array aligned to the input candidates. * Returns null on failure (caller should fall back to retrieval scores). */ private scoreCandidates; /** * Rerank search results using the LLM as a semantic judge. * Blends LLM scores with retrieval scores so a bad LLM call can't drop correct docs. */ rerank(query: string, results: SearchResult[], contentLookup: (id: string) => string | undefined, limit: number): Promise; } //# sourceMappingURL=llm-judge.d.ts.map