/** * Agentic QE v3 - Q-Learning Router for RuVector Integration * * Uses RuVector's Q-Learning capabilities to route test tasks to optimal agents. * Falls back to rule-based routing when RuVector is unavailable. */ import type { QLearningRouter, QLearningState, QLearningAction, TestTask, AgentRoutingResult, RuVectorConfig } from './interfaces'; /** * Q-Learning hyperparameters */ export interface QLearningParams { /** Learning rate (alpha) */ learningRate: number; /** Discount factor (gamma) */ discountFactor: number; /** Exploration rate (epsilon) for epsilon-greedy */ explorationRate: number; /** Exploration decay rate */ explorationDecay: number; /** Minimum exploration rate */ minExplorationRate: number; } /** * Q-Learning router that integrates with RuVector * Provides optimal agent routing using reinforcement learning */ export declare class RuVectorQLearningRouter implements QLearningRouter { private readonly config; private readonly fallback; private readonly params; private qTable; private feedback; private taskStateMap; private episodeCount; constructor(config: RuVectorConfig, params?: Partial); /** * Route a test task to optimal agent using Q-Learning */ routeTask(task: TestTask): Promise; /** * Batch route multiple tasks */ routeTasks(tasks: TestTask[]): Promise; /** * Provide feedback for Q-Learning update */ provideFeedback(taskId: string, result: { success: boolean; durationMs: number; quality: number; }): Promise; /** * Get Q-value for state-action pair */ getQValue(state: QLearningState, action: QLearningAction): number; /** * Reset learning state */ reset(): Promise; /** * Export learned model */ exportModel(): Promise>; /** * Import learned model */ importModel(model: Record): Promise; /** * Convert task to Q-Learning state */ private taskToState; /** * Select action using epsilon-greedy strategy */ private selectAction; /** * Get random action */ private getRandomAction; /** * Get best known action for state */ private getBestAction; /** * Get heuristic action when no Q-values exist */ private getHeuristicAction; /** * Get relevant domains for state */ private getRelevantDomains; /** * Calculate confidence score */ private calculateConfidence; /** * Get alternative actions ranked by Q-value */ private getAlternativeActions; /** * Generate reasoning explanation */ private generateReasoning; /** * Get Q-values for debugging */ private getQValuesForState; /** * Calculate reward from feedback */ private calculateReward; /** * Update Q-value using Q-Learning formula */ private updateQValue; /** * Get best action key for state */ private getBestActionKey; private stateToKey; private actionToKey; private keyToAction; } /** * Create Q-Learning router with optional RuVector integration */ export declare function createQLearningRouter(config: RuVectorConfig, params?: Partial): QLearningRouter; //# sourceMappingURL=q-learning-router.d.ts.map