chore: recovery checkpoint - v3.0 API successfully recovered
CRITICAL CHECKPOINT - DO NOT PUSH TO GITHUB Recovery Status: - Successfully recovered brainy.ts from compiled JavaScript - All core v3.0 API methods functional (add, get, update, delete, relate, find, etc.) - Neural subsystem intact (562KB embedded patterns, NLP working) - Augmentation pipeline operational (20+ augmentations) - HNSW clustering system complete - Triple Intelligence compiled (needs constructor fix) - Test suite validates functionality Changes preserved: - 898 files with changes from last 3 days - 144,475 insertions - All augmentation improvements - All test coverage enhancements - Complete v3.0 feature set This is a LOCAL checkpoint only - contains recovered work after corruption incident. Created backup in .backups/brainy-full-20250910-151314.tar.gz Branch: recovery-checkpoint-20250910-151433 Date: Wed Sep 10 03:18:04 PM PDT 2025
This commit is contained in:
parent
f65455fb22
commit
8ff382ca3b
895 changed files with 143654 additions and 28268 deletions
125
.recovery-workspace/dist-backup-20250910-141917/utils/autoConfiguration.d.ts
vendored
Normal file
125
.recovery-workspace/dist-backup-20250910-141917/utils/autoConfiguration.d.ts
vendored
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
/**
|
||||
* Automatic Configuration System for Brainy Vector Database
|
||||
* Detects environment, resources, and data patterns to provide optimal settings
|
||||
*/
|
||||
export interface AutoConfigResult {
|
||||
environment: 'browser' | 'nodejs' | 'serverless' | 'unknown';
|
||||
availableMemory: number;
|
||||
cpuCores: number;
|
||||
threadingAvailable: boolean;
|
||||
persistentStorageAvailable: boolean;
|
||||
s3StorageDetected: boolean;
|
||||
recommendedConfig: {
|
||||
expectedDatasetSize: number;
|
||||
maxMemoryUsage: number;
|
||||
targetSearchLatency: number;
|
||||
enablePartitioning: boolean;
|
||||
enableCompression: boolean;
|
||||
enableDistributedSearch: boolean;
|
||||
enablePredictiveCaching: boolean;
|
||||
partitionStrategy: 'semantic' | 'hash';
|
||||
maxNodesPerPartition: number;
|
||||
semanticClusters: number;
|
||||
};
|
||||
optimizationFlags: {
|
||||
useMemoryMapping: boolean;
|
||||
aggressiveCaching: boolean;
|
||||
backgroundOptimization: boolean;
|
||||
compressionLevel: 'none' | 'light' | 'aggressive';
|
||||
};
|
||||
}
|
||||
export interface DatasetAnalysis {
|
||||
estimatedSize: number;
|
||||
vectorDimension?: number;
|
||||
growthRate?: number;
|
||||
accessPatterns?: 'read-heavy' | 'write-heavy' | 'balanced';
|
||||
}
|
||||
/**
|
||||
* Automatic configuration system that detects environment and optimizes settings
|
||||
*/
|
||||
export declare class AutoConfiguration {
|
||||
private static instance;
|
||||
private cachedConfig;
|
||||
private datasetStats;
|
||||
private constructor();
|
||||
static getInstance(): AutoConfiguration;
|
||||
/**
|
||||
* Detect environment and generate optimal configuration
|
||||
*/
|
||||
detectAndConfigure(hints?: {
|
||||
expectedDataSize?: number;
|
||||
s3Available?: boolean;
|
||||
memoryBudget?: number;
|
||||
}): Promise<AutoConfigResult>;
|
||||
/**
|
||||
* Update configuration based on runtime dataset analysis
|
||||
*/
|
||||
adaptToDataset(analysis: DatasetAnalysis): Promise<AutoConfigResult>;
|
||||
/**
|
||||
* Learn from performance metrics and adjust configuration
|
||||
*/
|
||||
learnFromPerformance(metrics: {
|
||||
averageSearchTime: number;
|
||||
memoryUsage: number;
|
||||
cacheHitRate: number;
|
||||
errorRate: number;
|
||||
}): Promise<Partial<AutoConfigResult['recommendedConfig']>>;
|
||||
/**
|
||||
* Get minimal configuration for quick setup
|
||||
*/
|
||||
getQuickSetupConfig(scenario: 'small' | 'medium' | 'large' | 'enterprise'): Promise<{
|
||||
expectedDatasetSize: number;
|
||||
maxMemoryUsage: number;
|
||||
targetSearchLatency: number;
|
||||
s3Required: boolean;
|
||||
}>;
|
||||
/**
|
||||
* Detect the current runtime environment
|
||||
*/
|
||||
private detectEnvironment;
|
||||
/**
|
||||
* Detect available system resources
|
||||
*/
|
||||
private detectResources;
|
||||
/**
|
||||
* Detect available storage capabilities
|
||||
*/
|
||||
private detectStorageCapabilities;
|
||||
/**
|
||||
* Generate recommended configuration based on detected environment and resources
|
||||
*/
|
||||
private generateRecommendedConfig;
|
||||
/**
|
||||
* Generate optimization flags based on environment and resources
|
||||
*/
|
||||
private generateOptimizationFlags;
|
||||
/**
|
||||
* Adapt configuration based on actual dataset analysis
|
||||
*/
|
||||
private adaptConfigurationToData;
|
||||
/**
|
||||
* Estimate dataset size if not provided
|
||||
*/
|
||||
private estimateDatasetSize;
|
||||
/**
|
||||
* Reset cached configuration (for testing or manual refresh)
|
||||
*/
|
||||
resetCache(): void;
|
||||
}
|
||||
/**
|
||||
* Convenience function for quick auto-configuration
|
||||
*/
|
||||
export declare function autoConfigureBrainy(hints?: {
|
||||
expectedDataSize?: number;
|
||||
s3Available?: boolean;
|
||||
memoryBudget?: number;
|
||||
}): Promise<AutoConfigResult>;
|
||||
/**
|
||||
* Get quick setup configuration for common scenarios
|
||||
*/
|
||||
export declare function getQuickSetup(scenario: 'small' | 'medium' | 'large' | 'enterprise'): Promise<{
|
||||
expectedDatasetSize: number;
|
||||
maxMemoryUsage: number;
|
||||
targetSearchLatency: number;
|
||||
s3Required: boolean;
|
||||
}>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue