@soulcraft/brainy 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -3
- package/README.md +427 -111
- package/bin/brainy.js +340 -62
- package/dist/api/ConfigAPI.d.ts +67 -0
- package/dist/api/ConfigAPI.js +166 -0
- package/dist/api/DataAPI.d.ts +123 -0
- package/dist/api/DataAPI.js +391 -0
- package/dist/api/SecurityAPI.d.ts +50 -0
- package/dist/api/SecurityAPI.js +139 -0
- package/dist/api/UniversalImportAPI.d.ts +134 -0
- package/dist/api/UniversalImportAPI.js +615 -0
- package/dist/augmentationManager.js +12 -7
- package/dist/augmentationPipeline.d.ts +0 -61
- package/dist/augmentationPipeline.js +0 -87
- package/dist/augmentationRegistry.d.ts +1 -1
- package/dist/augmentationRegistry.js +1 -1
- package/dist/augmentations/apiServerAugmentation.d.ts +27 -1
- package/dist/augmentations/apiServerAugmentation.js +290 -9
- package/dist/augmentations/auditLogAugmentation.d.ts +109 -0
- package/dist/augmentations/auditLogAugmentation.js +358 -0
- package/dist/augmentations/batchProcessingAugmentation.d.ts +3 -2
- package/dist/augmentations/batchProcessingAugmentation.js +123 -22
- package/dist/augmentations/brainyAugmentation.d.ts +142 -8
- package/dist/augmentations/brainyAugmentation.js +179 -2
- package/dist/augmentations/cacheAugmentation.d.ts +8 -5
- package/dist/augmentations/cacheAugmentation.js +116 -17
- package/dist/augmentations/conduitAugmentations.d.ts +2 -2
- package/dist/augmentations/conduitAugmentations.js +2 -2
- package/dist/augmentations/configResolver.d.ts +122 -0
- package/dist/augmentations/configResolver.js +440 -0
- package/dist/augmentations/connectionPoolAugmentation.d.ts +3 -1
- package/dist/augmentations/connectionPoolAugmentation.js +37 -12
- package/dist/augmentations/defaultAugmentations.d.ts +14 -10
- package/dist/augmentations/defaultAugmentations.js +16 -11
- package/dist/augmentations/discovery/catalogDiscovery.d.ts +142 -0
- package/dist/augmentations/discovery/catalogDiscovery.js +249 -0
- package/dist/augmentations/discovery/localDiscovery.d.ts +84 -0
- package/dist/augmentations/discovery/localDiscovery.js +246 -0
- package/dist/augmentations/discovery/runtimeLoader.d.ts +97 -0
- package/dist/augmentations/discovery/runtimeLoader.js +337 -0
- package/dist/augmentations/discovery.d.ts +152 -0
- package/dist/augmentations/discovery.js +441 -0
- package/dist/augmentations/display/cache.d.ts +130 -0
- package/dist/augmentations/display/cache.js +319 -0
- package/dist/augmentations/display/fieldPatterns.d.ts +52 -0
- package/dist/augmentations/display/fieldPatterns.js +393 -0
- package/dist/augmentations/display/iconMappings.d.ts +57 -0
- package/dist/augmentations/display/iconMappings.js +68 -0
- package/dist/augmentations/display/intelligentComputation.d.ts +109 -0
- package/dist/augmentations/display/intelligentComputation.js +462 -0
- package/dist/augmentations/display/types.d.ts +203 -0
- package/dist/augmentations/display/types.js +7 -0
- package/dist/augmentations/entityRegistryAugmentation.d.ts +3 -1
- package/dist/augmentations/entityRegistryAugmentation.js +5 -1
- package/dist/augmentations/indexAugmentation.d.ts +5 -3
- package/dist/augmentations/indexAugmentation.js +5 -2
- package/dist/augmentations/intelligentVerbScoringAugmentation.d.ts +24 -7
- package/dist/augmentations/intelligentVerbScoringAugmentation.js +111 -27
- package/dist/augmentations/manifest.d.ts +176 -0
- package/dist/augmentations/manifest.js +8 -0
- package/dist/augmentations/marketplace/AugmentationMarketplace.d.ts +168 -0
- package/dist/augmentations/marketplace/AugmentationMarketplace.js +329 -0
- package/dist/augmentations/marketplace/cli.d.ts +47 -0
- package/dist/augmentations/marketplace/cli.js +265 -0
- package/dist/augmentations/metricsAugmentation.d.ts +3 -3
- package/dist/augmentations/metricsAugmentation.js +2 -2
- package/dist/augmentations/monitoringAugmentation.d.ts +3 -3
- package/dist/augmentations/monitoringAugmentation.js +2 -2
- package/dist/augmentations/neuralImport.d.ts +1 -1
- package/dist/augmentations/neuralImport.js +4 -4
- package/dist/augmentations/rateLimitAugmentation.d.ts +82 -0
- package/dist/augmentations/rateLimitAugmentation.js +321 -0
- package/dist/augmentations/requestDeduplicatorAugmentation.d.ts +2 -2
- package/dist/augmentations/requestDeduplicatorAugmentation.js +1 -1
- package/dist/augmentations/storageAugmentation.d.ts +1 -1
- package/dist/augmentations/storageAugmentation.js +2 -2
- package/dist/augmentations/storageAugmentations.d.ts +37 -8
- package/dist/augmentations/storageAugmentations.js +204 -15
- package/dist/augmentations/synapseAugmentation.d.ts +1 -1
- package/dist/augmentations/synapseAugmentation.js +35 -16
- package/dist/augmentations/typeMatching/brainyTypes.d.ts +83 -0
- package/dist/augmentations/typeMatching/brainyTypes.js +425 -0
- package/dist/augmentations/typeMatching/intelligentTypeMatcher.d.ts +39 -59
- package/dist/augmentations/typeMatching/intelligentTypeMatcher.js +103 -389
- package/dist/augmentations/universalDisplayAugmentation.d.ts +191 -0
- package/dist/augmentations/universalDisplayAugmentation.js +371 -0
- package/dist/brainy-unified.d.ts +106 -0
- package/dist/brainy-unified.js +327 -0
- package/dist/brainy.d.ts +277 -0
- package/dist/brainy.js +1241 -0
- package/dist/brainyData.d.ts +56 -111
- package/dist/brainyData.js +912 -756
- package/dist/brainyDataV3.d.ts +186 -0
- package/dist/brainyDataV3.js +337 -0
- package/dist/config/distributedPresets-new.d.ts +118 -0
- package/dist/config/distributedPresets-new.js +318 -0
- package/dist/config/distributedPresets.d.ts +118 -0
- package/dist/config/distributedPresets.js +318 -0
- package/dist/config/extensibleConfig.d.ts +99 -0
- package/dist/config/extensibleConfig.js +268 -0
- package/dist/config/index.d.ts +17 -0
- package/dist/config/index.js +35 -0
- package/dist/config/modelAutoConfig.d.ts +32 -0
- package/dist/config/modelAutoConfig.js +139 -0
- package/dist/config/modelPrecisionManager.d.ts +42 -0
- package/dist/config/modelPrecisionManager.js +98 -0
- package/dist/config/sharedConfigManager.d.ts +67 -0
- package/dist/config/sharedConfigManager.js +215 -0
- package/dist/config/storageAutoConfig.d.ts +41 -0
- package/dist/config/storageAutoConfig.js +328 -0
- package/dist/config/zeroConfig.d.ts +68 -0
- package/dist/config/zeroConfig.js +301 -0
- package/dist/cortex/backupRestore.d.ts +2 -2
- package/dist/cortex/backupRestore.js +85 -27
- package/dist/cortex/healthCheck.d.ts +2 -2
- package/dist/cortex/neuralImport.d.ts +2 -2
- package/dist/cortex/neuralImport.js +18 -13
- package/dist/cortex/performanceMonitor.d.ts +2 -2
- package/dist/critical/model-guardian.d.ts +4 -0
- package/dist/critical/model-guardian.js +31 -11
- package/dist/demo.d.ts +4 -4
- package/dist/demo.js +7 -7
- package/dist/distributed/cacheSync.d.ts +112 -0
- package/dist/distributed/cacheSync.js +265 -0
- package/dist/distributed/coordinator.d.ts +193 -0
- package/dist/distributed/coordinator.js +548 -0
- package/dist/distributed/httpTransport.d.ts +120 -0
- package/dist/distributed/httpTransport.js +446 -0
- package/dist/distributed/index.d.ts +8 -0
- package/dist/distributed/index.js +5 -0
- package/dist/distributed/networkTransport.d.ts +132 -0
- package/dist/distributed/networkTransport.js +633 -0
- package/dist/distributed/queryPlanner.d.ts +104 -0
- package/dist/distributed/queryPlanner.js +327 -0
- package/dist/distributed/readWriteSeparation.d.ts +134 -0
- package/dist/distributed/readWriteSeparation.js +350 -0
- package/dist/distributed/shardManager.d.ts +114 -0
- package/dist/distributed/shardManager.js +357 -0
- package/dist/distributed/shardMigration.d.ts +110 -0
- package/dist/distributed/shardMigration.js +289 -0
- package/dist/distributed/storageDiscovery.d.ts +160 -0
- package/dist/distributed/storageDiscovery.js +551 -0
- package/dist/embeddings/CachedEmbeddings.d.ts +40 -0
- package/dist/embeddings/CachedEmbeddings.js +146 -0
- package/dist/embeddings/EmbeddingManager.d.ts +102 -0
- package/dist/embeddings/EmbeddingManager.js +291 -0
- package/dist/embeddings/SingletonModelManager.d.ts +95 -0
- package/dist/embeddings/SingletonModelManager.js +220 -0
- package/dist/embeddings/index.d.ts +12 -0
- package/dist/embeddings/index.js +16 -0
- package/dist/embeddings/lightweight-embedder.d.ts +0 -1
- package/dist/embeddings/lightweight-embedder.js +4 -12
- package/dist/embeddings/model-manager.d.ts +11 -0
- package/dist/embeddings/model-manager.js +43 -7
- package/dist/embeddings/universal-memory-manager.d.ts +1 -1
- package/dist/embeddings/universal-memory-manager.js +27 -67
- package/dist/embeddings/worker-embedding.js +4 -8
- package/dist/errors/brainyError.d.ts +5 -1
- package/dist/errors/brainyError.js +12 -0
- package/dist/examples/basicUsage.js +7 -4
- package/dist/graph/graphAdjacencyIndex.d.ts +96 -0
- package/dist/graph/graphAdjacencyIndex.js +288 -0
- package/dist/graph/pathfinding.js +4 -2
- package/dist/hnsw/scaledHNSWSystem.js +11 -2
- package/dist/importManager.js +8 -5
- package/dist/index.d.ts +17 -22
- package/dist/index.js +37 -23
- package/dist/mcp/brainyMCPAdapter.d.ts +4 -4
- package/dist/mcp/brainyMCPAdapter.js +5 -5
- package/dist/mcp/brainyMCPService.d.ts +3 -3
- package/dist/mcp/brainyMCPService.js +3 -11
- package/dist/mcp/mcpAugmentationToolset.js +20 -30
- package/dist/neural/embeddedPatterns.d.ts +1 -1
- package/dist/neural/embeddedPatterns.js +2 -2
- package/dist/neural/entityExtractor.d.ts +65 -0
- package/dist/neural/entityExtractor.js +316 -0
- package/dist/neural/improvedNeuralAPI.d.ts +357 -0
- package/dist/neural/improvedNeuralAPI.js +2628 -0
- package/dist/neural/naturalLanguageProcessor.d.ts +155 -10
- package/dist/neural/naturalLanguageProcessor.js +941 -66
- package/dist/neural/naturalLanguageProcessorStatic.d.ts +2 -2
- package/dist/neural/naturalLanguageProcessorStatic.js +3 -3
- package/dist/neural/neuralAPI.js +8 -2
- package/dist/neural/patternLibrary.d.ts +57 -3
- package/dist/neural/patternLibrary.js +348 -13
- package/dist/neural/staticPatternMatcher.d.ts +2 -2
- package/dist/neural/staticPatternMatcher.js +2 -2
- package/dist/neural/types.d.ts +287 -0
- package/dist/neural/types.js +24 -0
- package/dist/shared/default-augmentations.d.ts +3 -3
- package/dist/shared/default-augmentations.js +5 -5
- package/dist/storage/adapters/baseStorageAdapter.d.ts +42 -0
- package/dist/storage/adapters/fileSystemStorage.d.ts +26 -2
- package/dist/storage/adapters/fileSystemStorage.js +218 -15
- package/dist/storage/adapters/memoryStorage.d.ts +4 -4
- package/dist/storage/adapters/memoryStorage.js +17 -12
- package/dist/storage/adapters/opfsStorage.d.ts +2 -2
- package/dist/storage/adapters/opfsStorage.js +2 -2
- package/dist/storage/adapters/s3CompatibleStorage.d.ts +2 -2
- package/dist/storage/adapters/s3CompatibleStorage.js +2 -2
- package/dist/storage/backwardCompatibility.d.ts +10 -78
- package/dist/storage/backwardCompatibility.js +17 -132
- package/dist/storage/baseStorage.d.ts +18 -2
- package/dist/storage/baseStorage.js +74 -3
- package/dist/storage/cacheManager.js +2 -2
- package/dist/storage/readOnlyOptimizations.js +8 -3
- package/dist/streaming/pipeline.d.ts +154 -0
- package/dist/streaming/pipeline.js +551 -0
- package/dist/triple/TripleIntelligence.d.ts +25 -110
- package/dist/triple/TripleIntelligence.js +4 -574
- package/dist/triple/TripleIntelligenceSystem.d.ts +159 -0
- package/dist/triple/TripleIntelligenceSystem.js +519 -0
- package/dist/types/apiTypes.d.ts +278 -0
- package/dist/types/apiTypes.js +33 -0
- package/dist/types/brainy.types.d.ts +308 -0
- package/dist/types/brainy.types.js +8 -0
- package/dist/types/brainyDataInterface.d.ts +5 -8
- package/dist/types/brainyDataInterface.js +2 -2
- package/dist/types/graphTypes.js +2 -2
- package/dist/universal/crypto.d.ts +11 -1
- package/dist/universal/crypto.js +24 -93
- package/dist/universal/events.d.ts +3 -2
- package/dist/universal/events.js +6 -75
- package/dist/universal/fs.d.ts +2 -3
- package/dist/universal/fs.js +5 -211
- package/dist/universal/path.d.ts +3 -2
- package/dist/universal/path.js +22 -78
- package/dist/universal/uuid.d.ts +1 -1
- package/dist/universal/uuid.js +1 -1
- package/dist/utils/brainyTypes.d.ts +217 -0
- package/dist/utils/brainyTypes.js +261 -0
- package/dist/utils/cacheAutoConfig.d.ts +3 -3
- package/dist/utils/embedding.d.ts +9 -4
- package/dist/utils/embedding.js +89 -26
- package/dist/utils/enhancedLogger.d.ts +104 -0
- package/dist/utils/enhancedLogger.js +232 -0
- package/dist/utils/hybridModelManager.d.ts +19 -28
- package/dist/utils/hybridModelManager.js +36 -200
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/intelligentTypeMapper.d.ts +60 -0
- package/dist/utils/intelligentTypeMapper.js +349 -0
- package/dist/utils/metadataIndex.d.ts +118 -1
- package/dist/utils/metadataIndex.js +539 -16
- package/dist/utils/nodeVersionCheck.d.ts +24 -0
- package/dist/utils/nodeVersionCheck.js +65 -0
- package/dist/utils/paramValidation.d.ts +39 -0
- package/dist/utils/paramValidation.js +192 -0
- package/dist/utils/rateLimiter.d.ts +160 -0
- package/dist/utils/rateLimiter.js +271 -0
- package/dist/utils/statistics.d.ts +4 -4
- package/dist/utils/statistics.js +3 -3
- package/dist/utils/structuredLogger.d.ts +146 -0
- package/dist/utils/structuredLogger.js +394 -0
- package/dist/utils/textEncoding.js +2 -1
- package/dist/utils/typeValidation.d.ts +59 -0
- package/dist/utils/typeValidation.js +374 -0
- package/dist/utils/version.js +19 -3
- package/package.json +15 -17
- package/scripts/download-models.cjs +94 -20
- package/dist/augmentations/walAugmentation.d.ts +0 -109
- package/dist/augmentations/walAugmentation.js +0 -516
- package/dist/browserFramework.d.ts +0 -15
- package/dist/browserFramework.js +0 -31
- package/dist/browserFramework.minimal.d.ts +0 -14
- package/dist/browserFramework.minimal.js +0 -31
- package/dist/chat/BrainyChat.d.ts +0 -121
- package/dist/chat/BrainyChat.js +0 -396
- package/dist/chat/ChatCLI.d.ts +0 -61
- package/dist/chat/ChatCLI.js +0 -351
package/dist/brainyData.d.ts
CHANGED
|
@@ -8,10 +8,10 @@ import { DistanceFunction, GraphVerb, EmbeddingFunction, HNSWConfig, SearchResul
|
|
|
8
8
|
import { MetadataIndexConfig } from './utils/metadataIndex.js';
|
|
9
9
|
import { CleanupConfig } from './utils/periodicCleanup.js';
|
|
10
10
|
import { NounType, VerbType } from './types/graphTypes.js';
|
|
11
|
-
import { WebSocketConnection } from './types/augmentations.js';
|
|
12
11
|
import { BrainyDataInterface } from './types/brainyDataInterface.js';
|
|
13
12
|
import { DistributedConfig } from './types/distributedTypes.js';
|
|
14
13
|
import { SearchCacheConfig } from './utils/searchCache.js';
|
|
14
|
+
import { ImprovedNeuralAPI } from './neural/improvedNeuralAPI.js';
|
|
15
15
|
import { TripleQuery, TripleResult } from './triple/TripleIntelligence.js';
|
|
16
16
|
export interface BrainyDataConfig {
|
|
17
17
|
/**
|
|
@@ -332,7 +332,7 @@ export interface BrainyDataConfig {
|
|
|
332
332
|
intelligentVerbScoring?: {
|
|
333
333
|
/**
|
|
334
334
|
* Whether to enable intelligent verb scoring
|
|
335
|
-
* Default:
|
|
335
|
+
* Default: true (enabled by default for better relationship quality)
|
|
336
336
|
*/
|
|
337
337
|
enabled?: boolean;
|
|
338
338
|
/**
|
|
@@ -416,6 +416,7 @@ export declare class BrainyData<T = any> implements BrainyDataInterface<T> {
|
|
|
416
416
|
private allowDirectReads;
|
|
417
417
|
private storageConfig;
|
|
418
418
|
private config;
|
|
419
|
+
private rawConfig;
|
|
419
420
|
private useOptimizedIndex;
|
|
420
421
|
private _dimensions;
|
|
421
422
|
private loggingConfig;
|
|
@@ -449,6 +450,15 @@ export declare class BrainyData<T = any> implements BrainyDataInterface<T> {
|
|
|
449
450
|
private partitioner;
|
|
450
451
|
private operationalMode;
|
|
451
452
|
private domainDetector;
|
|
453
|
+
private networkTransport;
|
|
454
|
+
private coordinator;
|
|
455
|
+
private shardManager;
|
|
456
|
+
private cacheSync;
|
|
457
|
+
private readWriteSeparation;
|
|
458
|
+
private httpTransport;
|
|
459
|
+
private storageDiscovery;
|
|
460
|
+
private queryPlanner;
|
|
461
|
+
private shardMigrationManager;
|
|
452
462
|
private get cache();
|
|
453
463
|
private get index();
|
|
454
464
|
private get metadataIndex();
|
|
@@ -472,8 +482,10 @@ export declare class BrainyData<T = any> implements BrainyDataInterface<T> {
|
|
|
472
482
|
get initialized(): boolean;
|
|
473
483
|
/**
|
|
474
484
|
* Create a new vector database
|
|
485
|
+
* @param config - Zero-config string ('production', 'development', 'minimal'),
|
|
486
|
+
* simplified config object, or legacy full config
|
|
475
487
|
*/
|
|
476
|
-
constructor(config?: BrainyDataConfig);
|
|
488
|
+
constructor(config?: BrainyDataConfig | string | any);
|
|
477
489
|
/**
|
|
478
490
|
* Check if the database is in read-only mode and throw an error if it is
|
|
479
491
|
* @throws Error if the database is in read-only mode
|
|
@@ -609,53 +621,31 @@ export declare class BrainyData<T = any> implements BrainyDataInterface<T> {
|
|
|
609
621
|
*/
|
|
610
622
|
private handleDistributedConfigUpdate;
|
|
611
623
|
/**
|
|
612
|
-
*
|
|
613
|
-
*
|
|
624
|
+
* Initialize NEW distributed components for Brainy 3.0
|
|
625
|
+
* This enables true multi-node operation with consensus and sharding
|
|
614
626
|
*/
|
|
615
|
-
|
|
627
|
+
private initializeDistributedComponents;
|
|
616
628
|
/**
|
|
617
|
-
*
|
|
618
|
-
* @param serverUrl WebSocket URL of the remote Brainy server
|
|
619
|
-
* @param protocols Optional WebSocket protocols to use
|
|
620
|
-
* @returns The connection object
|
|
629
|
+
* Execute a query on local shards
|
|
621
630
|
*/
|
|
622
|
-
|
|
631
|
+
private executeLocalQuery;
|
|
623
632
|
/**
|
|
624
|
-
*
|
|
625
|
-
*
|
|
626
|
-
* @param vectorOrData Vector or data to add
|
|
627
|
-
* @param metadata Optional metadata to associate with the data
|
|
628
|
-
* @param options Additional options for processing
|
|
629
|
-
* @returns The ID of the added data
|
|
630
|
-
*
|
|
631
|
-
* @example
|
|
632
|
-
* // Auto mode - intelligently decides processing
|
|
633
|
-
* await brainy.add("Customer feedback: Great product!")
|
|
634
|
-
*
|
|
635
|
-
* @example
|
|
636
|
-
* // Explicit literal mode for sensitive data
|
|
637
|
-
* await brainy.add("API_KEY=secret123", null, { process: 'literal' })
|
|
638
|
-
*
|
|
639
|
-
* @example
|
|
640
|
-
* // Force neural processing
|
|
641
|
-
* await brainy.add("John works at Acme Corp", null, { process: 'neural' })
|
|
633
|
+
* Set up distributed operation handlers
|
|
642
634
|
*/
|
|
643
|
-
|
|
644
|
-
forceEmbed?: boolean;
|
|
645
|
-
addToRemote?: boolean;
|
|
646
|
-
id?: string;
|
|
647
|
-
service?: string;
|
|
648
|
-
process?: 'auto' | 'literal' | 'neural';
|
|
649
|
-
}): Promise<string>;
|
|
635
|
+
private setupDistributedOperations;
|
|
650
636
|
/**
|
|
651
|
-
*
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
*
|
|
656
|
-
* @private
|
|
637
|
+
* Local add operation (without distribution)
|
|
638
|
+
*/
|
|
639
|
+
private localAdd;
|
|
640
|
+
/**
|
|
641
|
+
* Local find operation (potentially for a specific shard)
|
|
657
642
|
*/
|
|
658
|
-
private
|
|
643
|
+
private localFind;
|
|
644
|
+
/**
|
|
645
|
+
* Get distributed health status
|
|
646
|
+
* @returns Health status if distributed mode is enabled
|
|
647
|
+
*/
|
|
648
|
+
getHealthStatus(): any;
|
|
659
649
|
/**
|
|
660
650
|
* Add multiple vectors or data items to the database
|
|
661
651
|
* @param items Array of items to add
|
|
@@ -663,13 +653,14 @@ export declare class BrainyData<T = any> implements BrainyDataInterface<T> {
|
|
|
663
653
|
* @returns Array of IDs for the added items
|
|
664
654
|
*/
|
|
665
655
|
/**
|
|
666
|
-
* Add multiple nouns in batch
|
|
667
|
-
* @param items Array of nouns to add
|
|
656
|
+
* Add multiple nouns in batch with required types
|
|
657
|
+
* @param items Array of nouns to add (all must have types)
|
|
668
658
|
* @param options Batch processing options
|
|
669
659
|
* @returns Array of generated IDs
|
|
670
660
|
*/
|
|
671
661
|
addNouns(items: Array<{
|
|
672
662
|
vectorOrData: Vector | any;
|
|
663
|
+
nounType: NounType | string;
|
|
673
664
|
metadata?: T;
|
|
674
665
|
}>, options?: {
|
|
675
666
|
forceEmbed?: boolean;
|
|
@@ -677,19 +668,6 @@ export declare class BrainyData<T = any> implements BrainyDataInterface<T> {
|
|
|
677
668
|
concurrency?: number;
|
|
678
669
|
batchSize?: number;
|
|
679
670
|
}): Promise<string[]>;
|
|
680
|
-
/**
|
|
681
|
-
* Add multiple vectors or data items to both local and remote databases
|
|
682
|
-
* @param items Array of items to add
|
|
683
|
-
* @param options Additional options
|
|
684
|
-
* @returns Array of IDs for the added items
|
|
685
|
-
*/
|
|
686
|
-
addBatchToBoth(items: Array<{
|
|
687
|
-
vectorOrData: Vector | any;
|
|
688
|
-
metadata?: T;
|
|
689
|
-
}>, options?: {
|
|
690
|
-
forceEmbed?: boolean;
|
|
691
|
-
concurrency?: number;
|
|
692
|
-
}): Promise<string[]>;
|
|
693
671
|
/**
|
|
694
672
|
* Filter search results by service
|
|
695
673
|
* @param results Search results to filter
|
|
@@ -1023,6 +1001,12 @@ export declare class BrainyData<T = any> implements BrainyDataInterface<T> {
|
|
|
1023
1001
|
* @returns Array of verbs of the specified type
|
|
1024
1002
|
*/
|
|
1025
1003
|
getVerbsByType(type: string): Promise<GraphVerb[]>;
|
|
1004
|
+
/**
|
|
1005
|
+
* Get all verbs associated with a specific noun (both as source and target)
|
|
1006
|
+
* @param nounId The ID of the noun
|
|
1007
|
+
* @returns Array of verbs where the noun is either source or target
|
|
1008
|
+
*/
|
|
1009
|
+
getVerbsForNoun(nounId: string): Promise<GraphVerb[]>;
|
|
1026
1010
|
/**
|
|
1027
1011
|
* Delete a verb
|
|
1028
1012
|
* @param id The ID of the verb to delete
|
|
@@ -1287,48 +1271,6 @@ export declare class BrainyData<T = any> implements BrainyDataInterface<T> {
|
|
|
1287
1271
|
searchMode?: 'local' | 'remote' | 'combined';
|
|
1288
1272
|
metadata?: any;
|
|
1289
1273
|
}): Promise<SearchResult<T>[]>;
|
|
1290
|
-
/**
|
|
1291
|
-
* Search a remote Brainy server for similar vectors
|
|
1292
|
-
* @param queryVectorOrData Query vector or data to search for
|
|
1293
|
-
* @param k Number of results to return
|
|
1294
|
-
* @param options Additional options
|
|
1295
|
-
* @returns Array of search results
|
|
1296
|
-
*/
|
|
1297
|
-
searchRemote(queryVectorOrData: Vector | any, k?: number, options?: {
|
|
1298
|
-
forceEmbed?: boolean;
|
|
1299
|
-
nounTypes?: string[];
|
|
1300
|
-
includeVerbs?: boolean;
|
|
1301
|
-
storeResults?: boolean;
|
|
1302
|
-
service?: string;
|
|
1303
|
-
searchField?: string;
|
|
1304
|
-
offset?: number;
|
|
1305
|
-
}): Promise<SearchResult<T>[]>;
|
|
1306
|
-
/**
|
|
1307
|
-
* Search both local and remote Brainy instances, combining the results
|
|
1308
|
-
* @param queryVectorOrData Query vector or data to search for
|
|
1309
|
-
* @param k Number of results to return
|
|
1310
|
-
* @param options Additional options
|
|
1311
|
-
* @returns Array of search results
|
|
1312
|
-
*/
|
|
1313
|
-
searchCombined(queryVectorOrData: Vector | any, k?: number, options?: {
|
|
1314
|
-
forceEmbed?: boolean;
|
|
1315
|
-
nounTypes?: string[];
|
|
1316
|
-
includeVerbs?: boolean;
|
|
1317
|
-
localFirst?: boolean;
|
|
1318
|
-
service?: string;
|
|
1319
|
-
searchField?: string;
|
|
1320
|
-
offset?: number;
|
|
1321
|
-
}): Promise<SearchResult<T>[]>;
|
|
1322
|
-
/**
|
|
1323
|
-
* Check if the instance is connected to a remote server
|
|
1324
|
-
* @returns True if connected to a remote server, false otherwise
|
|
1325
|
-
*/
|
|
1326
|
-
isConnectedToRemoteServer(): boolean;
|
|
1327
|
-
/**
|
|
1328
|
-
* Disconnect from the remote server
|
|
1329
|
-
* @returns True if successfully disconnected, false if not connected
|
|
1330
|
-
*/
|
|
1331
|
-
disconnectFromRemoteServer(): Promise<boolean>;
|
|
1332
1274
|
/**
|
|
1333
1275
|
* Ensure the database is initialized
|
|
1334
1276
|
*/
|
|
@@ -1526,14 +1468,21 @@ export declare class BrainyData<T = any> implements BrainyDataInterface<T> {
|
|
|
1526
1468
|
* @returns Created noun ID
|
|
1527
1469
|
*/
|
|
1528
1470
|
/**
|
|
1529
|
-
* Add a noun to the database
|
|
1471
|
+
* Add a noun to the database with required type
|
|
1530
1472
|
* Clean 2.0 API - primary method for adding data
|
|
1531
1473
|
*
|
|
1532
1474
|
* @param vectorOrData Vector array or data to embed
|
|
1533
|
-
* @param
|
|
1475
|
+
* @param nounType Required noun type (one of 31 types)
|
|
1476
|
+
* @param metadata Optional metadata object
|
|
1534
1477
|
* @returns The generated ID
|
|
1535
1478
|
*/
|
|
1536
|
-
addNoun(vectorOrData: Vector | any, metadata?: T
|
|
1479
|
+
addNoun(vectorOrData: Vector | any, nounType: NounType | string, metadata?: T, options?: {
|
|
1480
|
+
forceEmbed?: boolean;
|
|
1481
|
+
addToRemote?: boolean;
|
|
1482
|
+
id?: string;
|
|
1483
|
+
service?: string;
|
|
1484
|
+
process?: 'auto' | 'literal' | 'neural';
|
|
1485
|
+
}): Promise<string>;
|
|
1537
1486
|
/**
|
|
1538
1487
|
* Add Verb - Unified relationship creation between nouns
|
|
1539
1488
|
* Creates typed relationships with proper vector embeddings from metadata
|
|
@@ -1702,23 +1651,19 @@ export declare class BrainyData<T = any> implements BrainyDataInterface<T> {
|
|
|
1702
1651
|
* - brain.neural.clusterStream() - Progressive streaming
|
|
1703
1652
|
* - brain.neural.getLOD() - Level-of-detail for scale
|
|
1704
1653
|
*/
|
|
1705
|
-
get neural():
|
|
1654
|
+
get neural(): ImprovedNeuralAPI;
|
|
1706
1655
|
/**
|
|
1707
1656
|
* Simple similarity check (shorthand for neural.similar)
|
|
1708
1657
|
*/
|
|
1709
|
-
similar(a: any, b: any): Promise<number>;
|
|
1658
|
+
similar(a: any, b: any, options?: any): Promise<number>;
|
|
1710
1659
|
/**
|
|
1711
1660
|
* Get semantic clusters (shorthand for neural.clusters)
|
|
1712
1661
|
*/
|
|
1713
|
-
clusters(options?: any): Promise<any[]>;
|
|
1662
|
+
clusters(items?: any, options?: any): Promise<any[]>;
|
|
1714
1663
|
/**
|
|
1715
1664
|
* Get related items (shorthand for neural.neighbors)
|
|
1716
1665
|
*/
|
|
1717
|
-
related(id: string,
|
|
1718
|
-
/**
|
|
1719
|
-
* Get visualization data (shorthand for neural.visualize)
|
|
1720
|
-
*/
|
|
1721
|
-
visualize(options?: any): Promise<any>;
|
|
1666
|
+
related(id: string, options?: any): Promise<any[]>;
|
|
1722
1667
|
/**
|
|
1723
1668
|
* 🚀 TRIPLE INTELLIGENCE SEARCH - Natural Language & Complex Queries
|
|
1724
1669
|
* The revolutionary search that combines vector, graph, and metadata intelligence!
|