/** * Neural Substrate Integration * * Integrates agentic-flow's neural embedding features: * - Semantic drift detection * - Memory physics (hippocampal dynamics) * - Embedding state machine * - Swarm coordination * - Coherence monitoring * * These features treat embeddings as a synthetic nervous system. */ export interface DriftResult { distance: number; velocity: number; acceleration: number; trend: 'stable' | 'drifting' | 'accelerating' | 'recovering'; shouldEscalate: boolean; shouldTriggerReasoning: boolean; } export interface MemoryEntry { id: string; embedding: Float32Array; content: string; strength: number; timestamp: number; accessCount: number; associations: string[]; } export interface AgentState { id: string; position: Float32Array; velocity: Float32Array; attention: Float32Array; energy: number; lastUpdate: number; } export interface CoherenceResult { isCoherent: boolean; anomalyScore: number; stabilityScore: number; driftDirection: Float32Array | null; warnings: string[]; } export interface SubstrateHealth { memoryCount: number; activeAgents: number; avgDrift: number; avgCoherence: number; lastConsolidation: number; uptime: number; } export interface NeuralSubstrateConfig { dimension?: number; driftThreshold?: number; decayRate?: number; } /** * Lazy-loaded Neural Substrate wrapper * * Wraps agentic-flow's NeuralSubstrate with graceful fallback */ export declare class NeuralEmbeddingService { private config; private substrate; private initialized; private available; constructor(config?: NeuralSubstrateConfig); /** * Initialize neural substrate */ init(): Promise; /** * Check if neural features are available */ isAvailable(): boolean; /** * Detect semantic drift from baseline */ detectDrift(input: string): Promise; /** * Set baseline for drift detection */ setDriftBaseline(context: string): Promise; /** * Store memory with interference detection */ storeMemory(id: string, content: string): Promise<{ stored: boolean; interference: string[]; } | null>; /** * Recall memories by similarity */ recallMemories(query: string, topK?: number): Promise | null>; /** * Consolidate memories (merge similar, forget weak) */ consolidateMemories(): { merged: number; forgotten: number; remaining: number; } | null; /** * Register agent for state tracking */ registerAgent(id: string, role: string): Promise; /** * Update agent state based on observation */ updateAgentState(agentId: string, observation: string): Promise<{ newState: AgentState; nearestRegion: string; regionProximity: number; } | null>; /** * Get agent state */ getAgentState(agentId: string): AgentState | null; /** * Coordinate swarm for task */ coordinateSwarm(task: string): Promise | null>; /** * Add agent to swarm */ addSwarmAgent(id: string, role: string): Promise; /** * Calibrate coherence monitor */ calibrateCoherence(goodOutputs: string[]): Promise<{ calibrated: boolean; sampleCount: number; } | null>; /** * Check output coherence */ checkCoherence(output: string): Promise; /** * Process input through full neural substrate */ process(input: string, context?: { agentId?: string; memoryId?: string; checkCoherence?: boolean; }): Promise<{ drift: DriftResult; state?: { nearestRegion: string; regionProximity: number; }; coherence?: CoherenceResult; stored?: boolean; } | null>; /** * Get substrate health */ health(): SubstrateHealth | null; /** * Full consolidation pass */ consolidate(): { memory: { merged: number; forgotten: number; remaining: number; }; } | null; } /** * Create neural embedding service */ export declare function createNeuralService(config?: NeuralSubstrateConfig): NeuralEmbeddingService; /** * Check if neural features are available */ export declare function isNeuralAvailable(): Promise; /** * List available ONNX embedding models */ export declare function listEmbeddingModels(): Promise>; /** * Download embedding model */ export declare function downloadEmbeddingModel(modelId: string, targetDir?: string, onProgress?: (progress: { percent: number; bytesDownloaded: number; totalBytes: number; }) => void): Promise; //# sourceMappingURL=neural-integration.d.ts.map