/** * Relevance Tuning System * * Enhances semantic search quality with multi-factor scoring: * - Semantic similarity (embedding distance) * - Lexical matching (keyword overlap) * - Recency boost (newer files score higher) * - File type preferences * - Path relevance (project structure awareness) */ export interface RelevanceFactors { semanticSimilarity: number; lexicalMatch: number; recencyScore: number; fileTypeScore: number; pathRelevance: number; } export interface RelevanceWeights { semantic: number; lexical: number; recency: number; fileType: number; path: number; } export interface TuningOptions { weights?: Partial; recencyDecayDays?: number; preferredExtensions?: string[]; preferredPaths?: string[]; minSemanticScore?: number; } export declare class RelevanceTuner { private weights; private options; constructor(options?: TuningOptions); /** * Calculate combined relevance score */ calculateRelevance(factors: RelevanceFactors): number; /** * Calculate lexical match score (keyword overlap) */ calculateLexicalMatch(query: string, content: string): number; /** * Calculate recency score with exponential decay */ calculateRecencyScore(fileDate: Date): number; /** * Calculate file type score based on preferences */ calculateFileTypeScore(filePath: string): number; /** * Calculate path relevance score */ calculatePathRelevance(filePath: string): number; /** * Tokenize text into words */ private tokenize; /** * Get file extension */ private getExtension; /** * Update weights dynamically */ updateWeights(newWeights: Partial): void; /** * Get current weights */ getWeights(): RelevanceWeights; /** * Get current options */ getOptions(): TuningOptions; } /** * Create tuner with sensible defaults */ export declare function createRelevanceTuner(options?: TuningOptions): RelevanceTuner; //# sourceMappingURL=relevance-tuning.d.ts.map