/** * Local embedding provider using @huggingface/transformers (transformers.js v4). * * Implements the EmbeddingProvider interface for brain memory vector search. * Uses all-MiniLM-L6-v2 (22MB, 384 dimensions) — matches the brain_embeddings * vec0 table schema. Model downloads on first call and is cached locally by * the transformers library. * * @epic T134 * @task T136 * @why Ship vector search out-of-the-box without external API keys * @what Local embedding provider using @huggingface/transformers all-MiniLM-L6-v2 * @remarks Brain embeddings are a FIRST-CLASS CLEO feature — the transformers * package is a regular dependency of `@cleocode/core`, not optional. * Migrated from `@xenova/transformers` v2 to `@huggingface/transformers` * v4 (upstream rename, same author) which drops the deprecated * `prebuild-install` transitive via `sharp@0.34+`. */ import type { EmbeddingProvider } from './brain-embedding.js'; /** * Local embedding provider backed by @huggingface/transformers. * * Produces 384-dimension Float32Array vectors compatible with the * brain_embeddings vec0 table. The model is downloaded on first use * and cached locally by the transformers library. * * Use {@link initDefaultProvider} (in brain-embedding.ts) to register an * instance when brain.embedding.enabled=true and * brain.embedding.provider='local'. */ export declare class LocalEmbeddingProvider implements EmbeddingProvider { /** Number of dimensions produced — must match brain_embeddings vec0 table. */ readonly dimensions = 384; /** * Whether the pipeline has been successfully initialized and is ready to produce embeddings. */ isAvailable(): boolean; /** * Convert a single text string into a 384-dimension float vector. * Triggers model download on first call if not already cached. * * @param text - The text to embed. * @returns A Float32Array of length 384. */ embed(text: string): Promise; /** * Embed multiple texts in sequence, reusing the cached pipeline. * * @param texts - Array of text strings to embed. * @returns Array of Float32Array vectors, one per input text. */ embedBatch(texts: string[]): Promise; } /** * Get or create the shared LocalEmbeddingProvider singleton. * * @returns The shared LocalEmbeddingProvider instance. */ export declare function getLocalEmbeddingProvider(): LocalEmbeddingProvider; //# sourceMappingURL=embedding-local.d.ts.map