/**
 * Embedding Repository
 *
 * Repository for code embeddings and semantic search.
 */
import type Database from 'better-sqlite3';
import type { CodeEmbedding } from '../schema.js';
export interface EmbeddingFilter {
    projectId?: string;
    filePath?: string;
    symbolType?: string;
    symbolName?: string;
    language?: string;
}
export interface EmbeddingSearchResult {
    embedding: CodeEmbedding;
    similarity: number;
}
export declare class EmbeddingRepository {
    private db;
    constructor(db?: Database.Database);
    /**
     * Create or update code embedding
     */
    upsert(embedding: Omit<CodeEmbedding, 'id' | 'created_at' | 'updated_at'>): CodeEmbedding;
    /**
     * Bulk upsert embeddings
     */
    bulkUpsert(embeddings: Omit<CodeEmbedding, 'id' | 'created_at' | 'updated_at'>[]): number;
    /**
     * Get embedding by ID
     */
    getById(id: number): CodeEmbedding | null;
    /**
     * Find embeddings by filter
     */
    find(filter?: EmbeddingFilter): CodeEmbedding[];
    /**
     * Search embeddings by semantic similarity
     */
    searchSimilar(queryEmbedding: Float32Array, filter?: EmbeddingFilter, topK?: number): EmbeddingSearchResult[];
    /**
     * Search embeddings by symbol name
     */
    searchBySymbol(symbolName: string, filter?: EmbeddingFilter, limit?: number): CodeEmbedding[];
    /**
     * Delete embeddings for file
     */
    deleteForFile(projectId: string, filePath: string): number;
    /**
     * Delete embeddings for project
     */
    deleteForProject(projectId: string): number;
    /**
     * Delete stale embeddings (files that no longer exist)
     */
    deleteStale(projectId: string, existingFiles: string[]): number;
    /**
     * Check if file needs re-indexing
     */
    needsReindex(projectId: string, filePath: string, contentHash: string): boolean;
    /**
     * Get embedding statistics
     */
    getStats(projectId?: string): {
        totalEmbeddings: number;
        totalFiles: number;
        byLanguage: Record<string, number>;
        bySymbolType: Record<string, number>;
    };
    private deserializeEmbedding;
    private cosineSimilarity;
}
export declare function getEmbeddingRepository(): EmbeddingRepository;
export declare function resetEmbeddingRepository(): void;
