/** * Absolute relevance check for natural-language task queries. * * Ranked retrieval always returns its best N, even when nothing matches: fusion * scores are relative to the pool, so a nonexistent concept still "scores 0.96". * {@link assessRelevance} asks the absolute question instead — does any top hit * share enough of the query's content words (or sit close enough in embedding * space) to be about it at all? — so `suggest` and `brief` can say "no relevant * match" rather than hand back ten unrelated nodes. */ import type Database from 'better-sqlite3'; import type { GraphSearchResult } from './hybrid-query.js'; /** Cosine similarity at which an embedding neighbour counts as on-topic without shared words. */ export declare const SEMANTIC_RELEVANT_SIMILARITY = 0.55; export interface RelevanceVerdict { relevant: boolean; /** Content words of the query the on-topic hits cover. */ bestCoverage: number; /** Content words of the query. */ words: number; } /** * Whether `hits` plausibly answer `query`. Only multi-word queries are judged: a bare * identifier is a name lookup, where "no hit" already means no match and a typo should * still return its fuzzy neighbours. A question needs on-topic hits that together cover at * least half of its content words (and never fewer than one). */ export declare function assessRelevance(db: Database.Database, query: string, hits: readonly GraphSearchResult[]): RelevanceVerdict; //# sourceMappingURL=relevance.d.ts.map