/** * BRAIN Vector Similarity Search * * Provides vector-based KNN search against brain_embeddings vec0 table. * Falls back gracefully when no embedding provider is registered or * sqlite-vec is unavailable. * * @task T5388 * @epic T5149 */ export interface SimilarityResult { id: string; distance: number; type: string; title: string; text: string; } /** Vector search outcome: the hits, or why the vector layer could not answer. */ export interface SimilaritySearch { /** Hits ranked by distance (ascending); empty when unavailable. */ results: SimilarityResult[]; /** Set when the vector layer is unavailable, naming the missing piece (T13948). */ unavailable?: string; } /** * Search for entries similar to a query string using vector similarity. * * Returns an empty array when the vector layer is unavailable; use * {@link searchSimilarWithStatus} to learn why. * * @param query - Text to find similar entries for * @param projectRoot - Project root directory * @param limit - Maximum results to return (default 10) * @returns Array of similar entries ranked by distance (ascending) */ export declare function searchSimilar(query: string, projectRoot: string, limit?: number): Promise; /** * Vector similarity search that reports an unavailable vector layer instead * of returning a silent empty list (T13948). * * 1. Embeds the query text via the registered embedding provider. * 2. Runs KNN query against brain_embeddings vec0 table. * 3. Joins with observation/decision/pattern/learning tables for full entries. * * @param query - Text to find similar entries for * @param projectRoot - Project root directory * @param limit - Maximum results to return (default 10) * @returns The hits, plus `unavailable` when no provider, vector, extension or * embedding for the active model exists, or the KNN query failed. * @example * ```ts * const { results, unavailable } = await searchSimilarWithStatus('worktree', root, 10); * ``` */ export declare function searchSimilarWithStatus(query: string, projectRoot: string, limit?: number): Promise; //# sourceMappingURL=brain-similarity.d.ts.map