/** * Scores and retrieves {@link KnowledgeArticle}s for a prompt. * * Retrieval is keyword overlap rather than embeddings: the corpus is small and * hand-curated, the keywords were chosen per article, and this keeps the core a * zero-dependency, fully-offline package. It also stays honest about failure — * a prompt matching nothing retrieves nothing, rather than confidently * returning the least-bad article. * * @packageDocumentation */ import { type KnowledgeArticle } from './knowledge-base'; /** An article plus why it matched, so callers can rank and explain. */ export interface RetrievedArticle { readonly article: KnowledgeArticle; readonly score: number; } /** * Retrieves the articles most relevant to `prompt`, best first. * * Scoring rewards specificity: a multi-word keyword ("server side") that * matches is worth more than a single word, because it is far less likely to * have matched by accident. A title-word match adds a small bonus. * * @param prompt - The raw user question. * @param articles - Corpus to search. Defaults to the built-in one; overridable for tests and host-app extension. */ export declare function retrieveArticles(prompt: string, articles?: readonly KnowledgeArticle[]): RetrievedArticle[]; /** * Serializes retrieved articles into the block appended to the model's prompt. * * The framing is deliberately firm: without it a model will happily "improve" * a snippet into a more familiar-looking API (AG Grid's, usually), which is * exactly the hallucination this whole subsystem exists to prevent. */ export declare function serializeArticles(retrieved: readonly RetrievedArticle[]): string; //# sourceMappingURL=knowledge-retriever.d.ts.map