export interface SemanticAnalysisResult { label: 'CONTRADICTION' | 'ENTAILMENT' | 'NEUTRAL'; score: number; confidence: number; } export interface ActionAssessmentResult { category: 'success' | 'failure' | 'neutral'; confidence: number; reasoning: string; } export interface SemanticSimilarityResult { similarity: number; confidence: number; reasoning: string; } export declare class SemanticAnalyzer { private nliClassifier; private embeddingModel; private isInitialized; private sessionCaches; private readonly maxCacheSize; private readonly maxSessions; initialize(): Promise; analyzeTextPair(premise: string, hypothesis: string): Promise; assessActionOutcome(action: string, expectedOutcome: string): Promise; classifyActionIntent(action: string, possibleIntents: string[]): Promise<{ bestMatch: string; confidence: number; allScores: Array<{ intent: string; score: number; }>; }>; /** * Calculate semantic similarity between two texts using NLI-based approach * Higher similarity indicates more related content */ calculateSemanticSimilarity(text1: string, text2: string, sessionId?: string): Promise; /** * Get or create a session-specific embedding cache */ private getSessionCache; /** * Clear cache for a specific session */ clearSessionCache(sessionId: string): void; /** * PERFORMANCE OPTIMIZATION: Batch compute embeddings for multiple texts * This is 10-100x faster than individual model calls */ getBatchEmbeddings(texts: string[], sessionId?: string): Promise; /** * Fast cosine similarity calculation between two vectors */ private cosineSimilarity; /** * PERFORMANCE OPTIMIZATION: Batch similarity matrix for multiple texts * Computes all pairwise similarities in one batch - much faster than individual calls */ computeSimilarityMatrix(texts: string[], sessionId?: string): Promise; /** * Extract semantic features from text for advanced similarity calculations */ extractSemanticFeatures(text: string, customIntents?: string[]): Promise<{ intents: string[]; sentiment: 'positive' | 'negative' | 'neutral'; confidence: number; }>; isReady(): boolean; } export declare const semanticAnalyzer: SemanticAnalyzer;