/** * Project Mind MCP - Embeddings Engine * * Local embeddings using ONNX for semantic search. * Uses all-MiniLM-L6-v2 model for high-quality, fast embeddings. * * Key features: * - Local inference (no API calls) * - ~50ms per query * - 384-dimensional embeddings * - Automatic caching of model */ /** * Generate embedding for a single text. * * @param text - Text to embed * @returns 384-dimensional embedding as Float32Array */ export declare function embed(text: string): Promise; /** * Generate embeddings for multiple texts. * * @param texts - Array of texts to embed * @returns Array of 384-dimensional embeddings */ export declare function embedBatch(texts: string[]): Promise; /** * Calculate cosine similarity between two embeddings. * Both vectors should already be normalized. * * @param a - First embedding * @param b - Second embedding * @returns Similarity score between -1 and 1 */ export declare function cosineSimilarity(a: Float32Array, b: Float32Array): number; /** * Find most similar embeddings from a collection. * * @param queryEmbedding - The query embedding * @param candidates - Array of candidates with id and embedding * @param limit - Maximum results to return * @param minSimilarity - Minimum similarity threshold * @returns Sorted array of matches with similarity scores */ export declare function findSimilar(queryEmbedding: Float32Array, candidates: Array<{ id: string | number; embedding: Float32Array; }>, limit?: number, minSimilarity?: number): Array<{ id: string | number; similarity: number; }>; /** * Serialize embedding to Buffer for database storage. */ export declare function serializeEmbedding(embedding: Float32Array): Buffer; /** * Deserialize embedding from database storage. */ export declare function deserializeEmbedding(buffer: Buffer): Float32Array; /** * Get embedding dimension (for schema validation). */ export declare function getEmbeddingDimension(): number; /** * Check if embeddings engine is ready. */ export declare function isReady(): boolean; /** * Preload the model (call at startup for faster first query). */ export declare function preload(): Promise; //# sourceMappingURL=embeddings.d.ts.map