/** * TF-IDF Embedding Provider — zero-dependency semantic search * (Term Frequency–Inverse Document Frequency) * Provides a lightweight text-to-vector implementation using TF-IDF (Term * Frequency–Inverse Document Frequency) for cosine-similarity ranking. This * is good enough for 10–200 skills. For production enterprise deployments, * plug in an OpenAI/Cohere `EmbeddingProvider` instead. * * No external dependencies — works out of the box. */ import { EmbeddingProvider } from './types.js'; /** * Simple TF-IDF based embedding provider. * Builds a vocabulary from the registered corpus and represents each text as * a TF-IDF weighted vector. */ export declare class TfIdfEmbeddingProvider implements EmbeddingProvider { private vocabulary; private idf; private corpusSize; private _dimensions; get dimensions(): number; /** * Build the vocabulary and IDF weights from a corpus of documents. * Must be called before `embed()` or `embedBatch()`. */ fit(documents: string[]): void; embed(text: string): Promise; embedBatch(texts: string[]): Promise; /** * Synchronous embed for internal use (no async overhead). */ embedSync(text: string): number[]; /** * Tokenize text into lowercase terms. * Splits on non-alphanumeric characters and filters stopwords. */ private tokenize; } /** * Cosine similarity between two vectors. * Returns a value between -1 and 1 (1 = identical, 0 = orthogonal). */ export declare function cosineSimilarity(a: number[], b: number[]): number; //# sourceMappingURL=tfidf-embedding.d.ts.map