| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | import { EpisodeSearchResult } from './agentdb-fast'; |
| | import { SonaConfig, LearnedPattern } from './sona-wrapper'; |
| | import { ParallelConfig, BatchEpisode } from './parallel-intelligence'; |
| | export interface MemoryEntry { |
| | id: string; |
| | content: string; |
| | type: string; |
| | embedding: number[]; |
| | created: string; |
| | accessed: number; |
| | score?: number; |
| | } |
| | export interface AgentRoute { |
| | agent: string; |
| | confidence: number; |
| | reason: string; |
| | patterns?: LearnedPattern[]; |
| | alternates?: Array<{ |
| | agent: string; |
| | confidence: number; |
| | }>; |
| | } |
| | export interface LearningStats { |
| | totalMemories: number; |
| | memoryDimensions: number; |
| | totalEpisodes: number; |
| | totalTrajectories: number; |
| | avgReward: number; |
| | sonaEnabled: boolean; |
| | trajectoriesRecorded: number; |
| | patternsLearned: number; |
| | microLoraUpdates: number; |
| | baseLoraUpdates: number; |
| | ewcConsolidations: number; |
| | routingPatterns: number; |
| | errorPatterns: number; |
| | coEditPatterns: number; |
| | workerTriggers: number; |
| | attentionEnabled: boolean; |
| | onnxEnabled: boolean; |
| | parallelEnabled: boolean; |
| | parallelWorkers: number; |
| | parallelBusy: number; |
| | parallelQueued: number; |
| | } |
| | export interface IntelligenceConfig { |
| | |
| | embeddingDim?: number; |
| | |
| | maxMemories?: number; |
| | |
| | maxEpisodes?: number; |
| | |
| | enableSona?: boolean; |
| | |
| | enableAttention?: boolean; |
| | |
| | enableOnnx?: boolean; |
| | |
| | sonaConfig?: Partial<SonaConfig>; |
| | |
| | storagePath?: string; |
| | |
| | learningRate?: number; |
| | |
| | |
| | |
| | |
| | parallelConfig?: Partial<ParallelConfig>; |
| | } |
| | |
| | |
| | |
| | export declare class IntelligenceEngine { |
| | private config; |
| | private vectorDb; |
| | private agentDb; |
| | private sona; |
| | private attention; |
| | private onnxEmbedder; |
| | private onnxReady; |
| | private parallel; |
| | private memories; |
| | private routingPatterns; |
| | private errorPatterns; |
| | private coEditPatterns; |
| | private agentMappings; |
| | private workerTriggerMappings; |
| | private currentTrajectoryId; |
| | private sessionStart; |
| | private learningEnabled; |
| | private episodeBatchQueue; |
| | constructor(config?: IntelligenceConfig); |
| | private initOnnx; |
| | private initVectorDb; |
| | private initParallel; |
| | |
| | |
| | |
| | embed(text: string): number[]; |
| | |
| | |
| | |
| | embedAsync(text: string): Promise<number[]>; |
| | |
| | |
| | |
| | private attentionEmbed; |
| | |
| | |
| | |
| | private hashEmbed; |
| | private tokenize; |
| | private tokenEmbed; |
| | private meanPool; |
| | |
| | |
| | |
| | remember(content: string, type?: string): Promise<MemoryEntry>; |
| | |
| | |
| | |
| | recall(query: string, topK?: number): Promise<MemoryEntry[]>; |
| | private cosineSimilarity; |
| | |
| | |
| | |
| | route(task: string, file?: string): Promise<AgentRoute>; |
| | private getExtension; |
| | private getState; |
| | private getAlternates; |
| | |
| | |
| | |
| | beginTrajectory(context: string, file?: string): void; |
| | |
| | |
| | |
| | addTrajectoryStep(activations: number[], reward: number): void; |
| | |
| | |
| | |
| | endTrajectory(success: boolean, quality?: number): void; |
| | |
| | |
| | |
| | setTrajectoryRoute(agent: string): void; |
| | |
| | |
| | |
| | recordEpisode(state: string, action: string, reward: number, nextState: string, done: boolean, metadata?: Record<string, any>): Promise<void>; |
| | |
| | |
| | |
| | queueEpisode(episode: BatchEpisode): void; |
| | |
| | |
| | |
| | flushEpisodeBatch(): Promise<number>; |
| | |
| | |
| | |
| | learnFromSimilar(state: string, k?: number): Promise<EpisodeSearchResult[]>; |
| | |
| | |
| | |
| | registerWorkerTrigger(trigger: string, priority: string, agents: string[]): void; |
| | |
| | |
| | |
| | getAgentsForTrigger(trigger: string): { |
| | priority: string; |
| | agents: string[]; |
| | } | undefined; |
| | |
| | |
| | |
| | routeWithWorkers(task: string, file?: string): Promise<AgentRoute>; |
| | |
| | |
| | |
| | initDefaultWorkerMappings(): void; |
| | |
| | |
| | |
| | recordCoEdit(file1: string, file2: string): void; |
| | |
| | |
| | |
| | getLikelyNextFiles(file: string, topK?: number): Array<{ |
| | file: string; |
| | count: number; |
| | }>; |
| | |
| | |
| | |
| | recordErrorFix(errorPattern: string, fix: string): void; |
| | |
| | |
| | |
| | getSuggestedFixes(error: string): string[]; |
| | |
| | |
| | |
| | tick(): string | null; |
| | |
| | |
| | |
| | forceLearn(): string | null; |
| | |
| | |
| | |
| | getStats(): LearningStats; |
| | |
| | |
| | |
| | export(): Record<string, any>; |
| | |
| | |
| | |
| | import(data: Record<string, any>, merge?: boolean): void; |
| | |
| | |
| | |
| | clear(): void; |
| | |
| | get patterns(): Record<string, Record<string, number>>; |
| | |
| | get file_sequences(): string[][]; |
| | |
| | get errors(): Record<string, string[]>; |
| | } |
| | |
| | |
| | |
| | export declare function createIntelligenceEngine(config?: IntelligenceConfig): IntelligenceEngine; |
| | |
| | |
| | |
| | export declare function createHighPerformanceEngine(): IntelligenceEngine; |
| | |
| | |
| | |
| | export declare function createLightweightEngine(): IntelligenceEngine; |
| | export default IntelligenceEngine; |
| | |