@soulcraft/brainy 2.15.0 → 3.0.1
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 +18 -0
- package/README.md +249 -152
- 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 +288 -7
- 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 +87 -8
- package/dist/augmentations/brainyAugmentation.js +159 -2
- package/dist/augmentations/cacheAugmentation.d.ts +6 -5
- package/dist/augmentations/cacheAugmentation.js +113 -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 +9 -11
- package/dist/augmentations/defaultAugmentations.js +4 -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/intelligentComputation.d.ts +1 -1
- package/dist/augmentations/display/intelligentComputation.js +4 -4
- package/dist/augmentations/entityRegistryAugmentation.d.ts +3 -1
- package/dist/augmentations/entityRegistryAugmentation.js +5 -1
- package/dist/augmentations/indexAugmentation.d.ts +3 -3
- package/dist/augmentations/indexAugmentation.js +2 -2
- package/dist/augmentations/intelligentVerbScoringAugmentation.d.ts +22 -6
- package/dist/augmentations/intelligentVerbScoringAugmentation.js +106 -23
- 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/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/intelligentTypeMatcher.d.ts +39 -59
- package/dist/augmentations/typeMatching/intelligentTypeMatcher.js +103 -389
- package/dist/augmentations/universalDisplayAugmentation.d.ts +2 -2
- package/dist/augmentations/universalDisplayAugmentation.js +2 -2
- package/dist/brainy-unified.d.ts +106 -0
- package/dist/brainy-unified.js +327 -0
- package/dist/brainy.d.ts +273 -0
- package/dist/brainy.js +1181 -0
- package/dist/brainyData.d.ts +29 -72
- package/dist/brainyData.js +350 -304
- package/dist/brainyDataV3.d.ts +186 -0
- package/dist/brainyDataV3.js +337 -0
- package/dist/browserFramework.d.ts +6 -6
- package/dist/browserFramework.js +11 -8
- package/dist/browserFramework.minimal.d.ts +5 -5
- package/dist/browserFramework.minimal.js +11 -8
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.js +3 -3
- package/dist/config/modelAutoConfig.d.ts +6 -7
- package/dist/config/modelAutoConfig.js +17 -76
- 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/EmbeddingManager.d.ts +0 -4
- package/dist/embeddings/EmbeddingManager.js +21 -26
- package/dist/errors/brainyError.d.ts +5 -1
- package/dist/errors/brainyError.js +12 -0
- package/dist/examples/basicUsage.js +3 -3
- 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 +6 -3
- package/dist/index.d.ts +12 -21
- package/dist/index.js +14 -22
- 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.js +90 -79
- 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/shared/default-augmentations.d.ts +3 -3
- package/dist/shared/default-augmentations.js +5 -5
- package/dist/storage/adapters/fileSystemStorage.d.ts +4 -0
- package/dist/storage/adapters/fileSystemStorage.js +54 -1
- package/dist/storage/adapters/memoryStorage.js +13 -8
- package/dist/storage/backwardCompatibility.d.ts +10 -78
- package/dist/storage/backwardCompatibility.js +17 -132
- package/dist/storage/baseStorage.d.ts +6 -0
- package/dist/storage/baseStorage.js +17 -0
- 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 +3 -3
- package/dist/types/brainyDataInterface.js +2 -2
- package/dist/types/graphTypes.js +2 -2
- package/dist/utils/cacheAutoConfig.d.ts +3 -3
- package/dist/utils/embedding.js +8 -14
- package/dist/utils/enhancedLogger.d.ts +104 -0
- package/dist/utils/enhancedLogger.js +232 -0
- 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/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 +34 -0
- package/dist/utils/typeValidation.js +247 -0
- package/package.json +14 -6
- package/scripts/download-models.cjs +6 -15
- package/dist/augmentations/walAugmentation.d.ts +0 -111
- package/dist/augmentations/walAugmentation.js +0 -519
- 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
|
@@ -1,396 +1,123 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* IntelligentTypeMatcher - Wrapper around BrainyTypes for testing
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* Features:
|
|
8
|
-
* - Semantic similarity matching using embeddings
|
|
9
|
-
* - Context-aware type detection
|
|
10
|
-
* - Confidence scoring
|
|
11
|
-
* - Caching for performance
|
|
12
|
-
*/
|
|
13
|
-
import { NounType, VerbType } from '../../types/graphTypes.js';
|
|
14
|
-
import { TransformerEmbedding } from '../../utils/embedding.js';
|
|
15
|
-
import { cosineDistance } from '../../utils/distance.js';
|
|
16
|
-
/**
|
|
17
|
-
* Type descriptions for semantic matching
|
|
18
|
-
* These descriptions are used to generate embeddings for each type
|
|
4
|
+
* Provides intelligent type detection using semantic embeddings
|
|
5
|
+
* for matching data to our 31 noun types and 40 verb types.
|
|
19
6
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
[NounType.Person]: 'person human individual user employee customer citizen member author creator agent actor participant',
|
|
23
|
-
[NounType.Organization]: 'organization company business corporation institution agency department team group committee board',
|
|
24
|
-
[NounType.Location]: 'location place address city country region area zone coordinate position site venue building',
|
|
25
|
-
[NounType.Thing]: 'thing object item product device equipment tool instrument asset artifact material physical tangible',
|
|
26
|
-
[NounType.Concept]: 'concept idea theory principle philosophy belief value abstract intangible notion thought',
|
|
27
|
-
[NounType.Event]: 'event occurrence incident activity happening meeting conference celebration milestone timestamp date',
|
|
28
|
-
// Digital/Content Types
|
|
29
|
-
[NounType.Document]: 'document file report article paper text pdf word contract agreement record documentation',
|
|
30
|
-
[NounType.Media]: 'media image photo video audio music podcast multimedia graphic visualization animation',
|
|
31
|
-
[NounType.File]: 'file digital data binary code script program software archive package bundle',
|
|
32
|
-
[NounType.Message]: 'message email chat communication notification alert announcement broadcast transmission',
|
|
33
|
-
[NounType.Content]: 'content information data text material resource publication post blog webpage',
|
|
34
|
-
// Collection Types
|
|
35
|
-
[NounType.Collection]: 'collection group set list array category folder directory catalog inventory database',
|
|
36
|
-
[NounType.Dataset]: 'dataset data table spreadsheet database records statistics metrics measurements analysis',
|
|
37
|
-
// Business/Application Types
|
|
38
|
-
[NounType.Product]: 'product item merchandise offering service feature application software solution package',
|
|
39
|
-
[NounType.Service]: 'service offering subscription support maintenance utility function capability',
|
|
40
|
-
[NounType.User]: 'user account profile member subscriber customer client participant identity credentials',
|
|
41
|
-
[NounType.Task]: 'task action todo item job assignment duty responsibility activity step procedure',
|
|
42
|
-
[NounType.Project]: 'project initiative program campaign effort endeavor plan scheme venture undertaking',
|
|
43
|
-
// Descriptive Types
|
|
44
|
-
[NounType.Process]: 'process workflow procedure method algorithm sequence pipeline operation routine protocol',
|
|
45
|
-
[NounType.State]: 'state status condition phase stage mode situation circumstance configuration setting',
|
|
46
|
-
[NounType.Role]: 'role position title function responsibility duty job capacity designation authority',
|
|
47
|
-
[NounType.Topic]: 'topic subject theme category tag keyword area domain field discipline specialty',
|
|
48
|
-
[NounType.Language]: 'language dialect locale tongue vernacular communication speech linguistics vocabulary',
|
|
49
|
-
[NounType.Currency]: 'currency money dollar euro pound yen bitcoin payment financial monetary unit',
|
|
50
|
-
[NounType.Measurement]: 'measurement metric quantity value amount size dimension weight height volume distance',
|
|
51
|
-
// Scientific/Research Types
|
|
52
|
-
[NounType.Hypothesis]: 'hypothesis theory proposition thesis assumption premise conjecture speculation prediction',
|
|
53
|
-
[NounType.Experiment]: 'experiment test trial study research investigation analysis observation examination',
|
|
54
|
-
// Legal/Regulatory Types
|
|
55
|
-
[NounType.Contract]: 'contract agreement deal treaty pact covenant license terms conditions policy',
|
|
56
|
-
[NounType.Regulation]: 'regulation law rule policy standard compliance requirement guideline ordinance statute',
|
|
57
|
-
// Technical Infrastructure Types
|
|
58
|
-
[NounType.Interface]: 'interface API endpoint protocol specification contract schema definition connection',
|
|
59
|
-
[NounType.Resource]: 'resource infrastructure server database storage compute memory bandwidth capacity asset'
|
|
60
|
-
};
|
|
61
|
-
const VERB_TYPE_DESCRIPTIONS = {
|
|
62
|
-
// Core Relationship Types
|
|
63
|
-
[VerbType.RelatedTo]: 'related connected associated linked correlated relevant pertinent applicable',
|
|
64
|
-
[VerbType.Contains]: 'contains includes holds stores encompasses comprises consists incorporates',
|
|
65
|
-
[VerbType.PartOf]: 'part component element member piece portion section segment constituent',
|
|
66
|
-
[VerbType.LocatedAt]: 'located situated positioned placed found exists resides occupies',
|
|
67
|
-
[VerbType.References]: 'references cites mentions points links refers quotes sources',
|
|
68
|
-
// Temporal/Causal Types
|
|
69
|
-
[VerbType.Precedes]: 'precedes before earlier prior previous antecedent preliminary foregoing',
|
|
70
|
-
[VerbType.Succeeds]: 'succeeds follows after later subsequent next ensuing succeeding',
|
|
71
|
-
[VerbType.Causes]: 'causes triggers induces produces generates results influences affects',
|
|
72
|
-
[VerbType.DependsOn]: 'depends requires needs relies necessitates contingent prerequisite',
|
|
73
|
-
[VerbType.Requires]: 'requires needs demands necessitates mandates obliges compels entails',
|
|
74
|
-
// Creation/Transformation Types
|
|
75
|
-
[VerbType.Creates]: 'creates makes produces generates builds constructs forms establishes',
|
|
76
|
-
[VerbType.Transforms]: 'transforms converts changes modifies alters transitions morphs evolves',
|
|
77
|
-
[VerbType.Becomes]: 'becomes turns evolves transforms changes transitions develops grows',
|
|
78
|
-
[VerbType.Modifies]: 'modifies changes updates alters edits revises adjusts adapts',
|
|
79
|
-
[VerbType.Consumes]: 'consumes uses utilizes depletes expends absorbs takes processes',
|
|
80
|
-
// Ownership/Attribution Types
|
|
81
|
-
[VerbType.Owns]: 'owns possesses holds controls manages administers governs maintains',
|
|
82
|
-
[VerbType.AttributedTo]: 'attributed credited assigned ascribed authored written composed',
|
|
83
|
-
[VerbType.CreatedBy]: 'created made produced generated built developed authored written',
|
|
84
|
-
[VerbType.BelongsTo]: 'belongs property possession part member affiliate associated owned',
|
|
85
|
-
// Social/Organizational Types
|
|
86
|
-
[VerbType.MemberOf]: 'member participant affiliate associate belongs joined enrolled registered',
|
|
87
|
-
[VerbType.WorksWith]: 'works collaborates cooperates partners teams assists helps supports',
|
|
88
|
-
[VerbType.FriendOf]: 'friend companion buddy pal acquaintance associate connection relationship',
|
|
89
|
-
[VerbType.Follows]: 'follows subscribes tracks monitors watches observes trails pursues',
|
|
90
|
-
[VerbType.Likes]: 'likes enjoys appreciates favors prefers admires values endorses',
|
|
91
|
-
[VerbType.ReportsTo]: 'reports answers subordinate accountable responsible supervised managed',
|
|
92
|
-
[VerbType.Supervises]: 'supervises manages oversees directs leads controls guides administers',
|
|
93
|
-
[VerbType.Mentors]: 'mentors teaches guides coaches instructs trains advises counsels',
|
|
94
|
-
[VerbType.Communicates]: 'communicates talks speaks messages contacts interacts corresponds exchanges',
|
|
95
|
-
// Descriptive/Functional Types
|
|
96
|
-
[VerbType.Describes]: 'describes explains details documents specifies outlines depicts characterizes',
|
|
97
|
-
[VerbType.Defines]: 'defines specifies establishes determines sets declares identifies designates',
|
|
98
|
-
[VerbType.Categorizes]: 'categorizes classifies groups sorts organizes arranges labels tags',
|
|
99
|
-
[VerbType.Measures]: 'measures quantifies gauges assesses evaluates calculates determines counts',
|
|
100
|
-
[VerbType.Evaluates]: 'evaluates assesses analyzes reviews examines appraises judges rates',
|
|
101
|
-
[VerbType.Uses]: 'uses utilizes employs applies operates handles manipulates exploits',
|
|
102
|
-
[VerbType.Implements]: 'implements executes realizes performs accomplishes carries delivers completes',
|
|
103
|
-
[VerbType.Extends]: 'extends expands enhances augments amplifies broadens enlarges develops',
|
|
104
|
-
// Enhanced Relationships
|
|
105
|
-
[VerbType.Inherits]: 'inherits derives extends receives obtains acquires succeeds legacy',
|
|
106
|
-
[VerbType.Conflicts]: 'conflicts contradicts opposes clashes disputes disagrees incompatible inconsistent',
|
|
107
|
-
[VerbType.Synchronizes]: 'synchronizes coordinates aligns harmonizes matches corresponds parallels coincides',
|
|
108
|
-
[VerbType.Competes]: 'competes rivals contends contests challenges opposes vies struggles'
|
|
109
|
-
};
|
|
7
|
+
import { VerbType } from '../../types/graphTypes.js';
|
|
8
|
+
import { getBrainyTypes } from './brainyTypes.js';
|
|
110
9
|
/**
|
|
111
|
-
* Intelligent
|
|
10
|
+
* Intelligent type matcher using semantic embeddings
|
|
112
11
|
*/
|
|
113
12
|
export class IntelligentTypeMatcher {
|
|
114
|
-
constructor() {
|
|
115
|
-
this.
|
|
116
|
-
this.
|
|
117
|
-
this.initialized = false;
|
|
13
|
+
constructor(options = {}) {
|
|
14
|
+
this.options = options;
|
|
15
|
+
this.brainyTypes = null;
|
|
118
16
|
this.cache = new Map();
|
|
119
|
-
this.
|
|
17
|
+
this.options = {
|
|
18
|
+
threshold: 0.3,
|
|
19
|
+
topK: 3,
|
|
20
|
+
useCache: true,
|
|
21
|
+
...options
|
|
22
|
+
};
|
|
120
23
|
}
|
|
121
24
|
/**
|
|
122
|
-
* Initialize the type matcher
|
|
25
|
+
* Initialize the type matcher
|
|
123
26
|
*/
|
|
124
27
|
async init() {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
await this.embedder.init();
|
|
128
|
-
// Generate embeddings for noun types
|
|
129
|
-
for (const [type, description] of Object.entries(NOUN_TYPE_DESCRIPTIONS)) {
|
|
130
|
-
const embedding = await this.embedder.embed(description);
|
|
131
|
-
this.nounEmbeddings.set(type, embedding);
|
|
132
|
-
}
|
|
133
|
-
// Generate embeddings for verb types
|
|
134
|
-
for (const [type, description] of Object.entries(VERB_TYPE_DESCRIPTIONS)) {
|
|
135
|
-
const embedding = await this.embedder.embed(description);
|
|
136
|
-
this.verbEmbeddings.set(type, embedding);
|
|
137
|
-
}
|
|
138
|
-
this.initialized = true;
|
|
28
|
+
this.brainyTypes = await getBrainyTypes();
|
|
29
|
+
await this.brainyTypes.init();
|
|
139
30
|
}
|
|
140
31
|
/**
|
|
141
|
-
*
|
|
32
|
+
* Dispose of resources
|
|
142
33
|
*/
|
|
143
|
-
async
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
// Check cache
|
|
148
|
-
const cacheKey = `noun:${textRepresentation}`;
|
|
149
|
-
if (this.cache.has(cacheKey)) {
|
|
150
|
-
return this.cache.get(cacheKey);
|
|
151
|
-
}
|
|
152
|
-
// Generate embedding for the input
|
|
153
|
-
const inputEmbedding = await this.embedder.embed(textRepresentation);
|
|
154
|
-
// Calculate similarities to all noun types
|
|
155
|
-
const similarities = [];
|
|
156
|
-
for (const [type, typeEmbedding] of this.nounEmbeddings.entries()) {
|
|
157
|
-
// Convert cosine distance to similarity (1 - distance)
|
|
158
|
-
const similarity = 1 - cosineDistance(inputEmbedding, typeEmbedding);
|
|
159
|
-
similarities.push({ type, similarity });
|
|
160
|
-
}
|
|
161
|
-
// Sort by similarity (highest first)
|
|
162
|
-
similarities.sort((a, b) => b.similarity - a.similarity);
|
|
163
|
-
// Apply heuristic rules for common patterns
|
|
164
|
-
const heuristicType = this.applyNounHeuristics(obj);
|
|
165
|
-
if (heuristicType) {
|
|
166
|
-
// Boost the heuristic type's confidence
|
|
167
|
-
const heuristicIndex = similarities.findIndex(s => s.type === heuristicType);
|
|
168
|
-
if (heuristicIndex > 0) {
|
|
169
|
-
similarities[heuristicIndex].similarity *= 1.2; // 20% boost
|
|
170
|
-
similarities.sort((a, b) => b.similarity - a.similarity);
|
|
171
|
-
}
|
|
34
|
+
async dispose() {
|
|
35
|
+
if (this.brainyTypes) {
|
|
36
|
+
await this.brainyTypes.dispose();
|
|
37
|
+
this.brainyTypes = null;
|
|
172
38
|
}
|
|
173
|
-
|
|
174
|
-
const result = {
|
|
175
|
-
type: similarities[0].type,
|
|
176
|
-
confidence: similarities[0].similarity,
|
|
177
|
-
reasoning: this.generateReasoning(obj, similarities[0].type, 'noun'),
|
|
178
|
-
alternatives: similarities.slice(1, 4).map(s => ({
|
|
179
|
-
type: s.type,
|
|
180
|
-
confidence: s.similarity
|
|
181
|
-
}))
|
|
182
|
-
};
|
|
183
|
-
// Cache result
|
|
184
|
-
this.cache.set(cacheKey, result);
|
|
185
|
-
return result;
|
|
39
|
+
this.cache.clear();
|
|
186
40
|
}
|
|
187
41
|
/**
|
|
188
|
-
* Match
|
|
42
|
+
* Match data to a noun type
|
|
189
43
|
*/
|
|
190
|
-
async
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
// Check cache
|
|
195
|
-
const cacheKey =
|
|
196
|
-
if (this.cache.has(cacheKey)) {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
//
|
|
208
|
-
|
|
209
|
-
//
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
// Create result
|
|
219
|
-
const result = {
|
|
220
|
-
type: similarities[0].type,
|
|
221
|
-
confidence: similarities[0].similarity,
|
|
222
|
-
reasoning: this.generateReasoning({ source: sourceObj, target: targetObj, hint: relationshipHint }, similarities[0].type, 'verb'),
|
|
223
|
-
alternatives: similarities.slice(1, 4).map(s => ({
|
|
224
|
-
type: s.type,
|
|
225
|
-
confidence: s.similarity
|
|
226
|
-
}))
|
|
44
|
+
async matchNounType(data) {
|
|
45
|
+
if (!this.brainyTypes) {
|
|
46
|
+
throw new Error('IntelligentTypeMatcher not initialized. Call init() first.');
|
|
47
|
+
}
|
|
48
|
+
// Check cache if enabled
|
|
49
|
+
const cacheKey = JSON.stringify(data);
|
|
50
|
+
if (this.options.useCache && this.cache.has(cacheKey)) {
|
|
51
|
+
const cached = this.cache.get(cacheKey);
|
|
52
|
+
return {
|
|
53
|
+
type: cached.type,
|
|
54
|
+
confidence: cached.confidence,
|
|
55
|
+
alternatives: cached.alternatives?.map(alt => ({
|
|
56
|
+
type: alt.type,
|
|
57
|
+
confidence: alt.confidence
|
|
58
|
+
})) || []
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
// Detect type using BrainyTypes
|
|
62
|
+
const result = await this.brainyTypes.matchNounType(data);
|
|
63
|
+
// Convert to expected format
|
|
64
|
+
const response = {
|
|
65
|
+
type: result.type,
|
|
66
|
+
confidence: result.confidence,
|
|
67
|
+
alternatives: result.alternatives?.map(alt => ({
|
|
68
|
+
type: alt.type,
|
|
69
|
+
confidence: alt.confidence
|
|
70
|
+
})) || []
|
|
227
71
|
};
|
|
228
|
-
// Cache result
|
|
229
|
-
this.
|
|
230
|
-
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Create text representation of an object for embedding
|
|
234
|
-
*/
|
|
235
|
-
createTextRepresentation(obj) {
|
|
236
|
-
const parts = [];
|
|
237
|
-
// Add type if available
|
|
238
|
-
if (typeof obj === 'object' && obj !== null) {
|
|
239
|
-
// Add field names and values
|
|
240
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
241
|
-
parts.push(key);
|
|
242
|
-
if (typeof value === 'string') {
|
|
243
|
-
parts.push(value.slice(0, 100)); // Limit string length
|
|
244
|
-
}
|
|
245
|
-
else if (typeof value === 'number' || typeof value === 'boolean') {
|
|
246
|
-
parts.push(String(value));
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
// Add special fields with higher weight
|
|
250
|
-
const importantFields = ['type', 'kind', 'category', 'class', 'name', 'title', 'description'];
|
|
251
|
-
for (const field of importantFields) {
|
|
252
|
-
if (obj[field]) {
|
|
253
|
-
parts.push(String(obj[field]));
|
|
254
|
-
parts.push(String(obj[field])); // Double weight for important fields
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
else if (typeof obj === 'string') {
|
|
259
|
-
parts.push(obj);
|
|
260
|
-
}
|
|
261
|
-
else {
|
|
262
|
-
parts.push(String(obj));
|
|
263
|
-
}
|
|
264
|
-
return parts.join(' ');
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* Create text representation of a relationship
|
|
268
|
-
*/
|
|
269
|
-
createRelationshipText(sourceObj, targetObj, relationshipHint) {
|
|
270
|
-
const parts = [];
|
|
271
|
-
if (relationshipHint) {
|
|
272
|
-
parts.push(relationshipHint);
|
|
273
|
-
parts.push(relationshipHint); // Double weight for explicit hint
|
|
274
|
-
}
|
|
275
|
-
// Add source context
|
|
276
|
-
if (sourceObj) {
|
|
277
|
-
parts.push('source:');
|
|
278
|
-
parts.push(this.getObjectSummary(sourceObj));
|
|
279
|
-
}
|
|
280
|
-
// Add target context
|
|
281
|
-
if (targetObj) {
|
|
282
|
-
parts.push('target:');
|
|
283
|
-
parts.push(this.getObjectSummary(targetObj));
|
|
284
|
-
}
|
|
285
|
-
return parts.join(' ');
|
|
286
|
-
}
|
|
287
|
-
/**
|
|
288
|
-
* Get a brief summary of an object
|
|
289
|
-
*/
|
|
290
|
-
getObjectSummary(obj) {
|
|
291
|
-
if (typeof obj === 'string')
|
|
292
|
-
return obj.slice(0, 50);
|
|
293
|
-
if (typeof obj !== 'object' || obj === null)
|
|
294
|
-
return String(obj);
|
|
295
|
-
const summary = [];
|
|
296
|
-
const fields = ['type', 'name', 'title', 'id', 'category', 'kind'];
|
|
297
|
-
for (const field of fields) {
|
|
298
|
-
if (obj[field]) {
|
|
299
|
-
summary.push(String(obj[field]));
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
return summary.join(' ').slice(0, 100);
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* Apply heuristic rules for noun type detection
|
|
306
|
-
*/
|
|
307
|
-
applyNounHeuristics(obj) {
|
|
308
|
-
if (typeof obj !== 'object' || obj === null)
|
|
309
|
-
return null;
|
|
310
|
-
// Person heuristics
|
|
311
|
-
if (obj.email || obj.firstName || obj.lastName || obj.username || obj.age || obj.gender) {
|
|
312
|
-
return NounType.Person;
|
|
313
|
-
}
|
|
314
|
-
// Organization heuristics
|
|
315
|
-
if (obj.companyName || obj.organizationId || obj.employees || obj.industry) {
|
|
316
|
-
return NounType.Organization;
|
|
317
|
-
}
|
|
318
|
-
// Location heuristics
|
|
319
|
-
if (obj.latitude || obj.longitude || obj.address || obj.city || obj.country || obj.coordinates) {
|
|
320
|
-
return NounType.Location;
|
|
321
|
-
}
|
|
322
|
-
// Document heuristics
|
|
323
|
-
if (obj.content && (obj.title || obj.author) || obj.documentType || obj.pages) {
|
|
324
|
-
return NounType.Document;
|
|
325
|
-
}
|
|
326
|
-
// Event heuristics
|
|
327
|
-
if (obj.startTime || obj.endTime || obj.date || obj.eventType || obj.attendees) {
|
|
328
|
-
return NounType.Event;
|
|
329
|
-
}
|
|
330
|
-
// Product heuristics
|
|
331
|
-
if (obj.price || obj.sku || obj.inventory || obj.productId) {
|
|
332
|
-
return NounType.Product;
|
|
333
|
-
}
|
|
334
|
-
// Task heuristics
|
|
335
|
-
if (obj.status && (obj.assignee || obj.dueDate) || obj.priority || obj.completed !== undefined) {
|
|
336
|
-
return NounType.Task;
|
|
337
|
-
}
|
|
338
|
-
// Media heuristics
|
|
339
|
-
if (obj.url && (obj.url.match(/\.(jpg|jpeg|png|gif|mp4|mp3|wav)/i))) {
|
|
340
|
-
return NounType.Media;
|
|
341
|
-
}
|
|
342
|
-
// Dataset heuristics
|
|
343
|
-
if (Array.isArray(obj.data) || obj.rows || obj.columns || obj.schema) {
|
|
344
|
-
return NounType.Dataset;
|
|
345
|
-
}
|
|
346
|
-
return null;
|
|
347
|
-
}
|
|
348
|
-
/**
|
|
349
|
-
* Apply heuristic rules for verb type detection
|
|
350
|
-
*/
|
|
351
|
-
applyVerbHeuristics(sourceObj, targetObj, relationshipHint) {
|
|
352
|
-
if (!relationshipHint)
|
|
353
|
-
return null;
|
|
354
|
-
const hint = relationshipHint.toLowerCase();
|
|
355
|
-
// Ownership patterns
|
|
356
|
-
if (hint.includes('own') || hint.includes('possess') || hint.includes('has')) {
|
|
357
|
-
return VerbType.Owns;
|
|
358
|
-
}
|
|
359
|
-
// Creation patterns
|
|
360
|
-
if (hint.includes('create') || hint.includes('made') || hint.includes('authored')) {
|
|
361
|
-
return VerbType.Creates;
|
|
362
|
-
}
|
|
363
|
-
// Containment patterns
|
|
364
|
-
if (hint.includes('contain') || hint.includes('include') || hint.includes('has')) {
|
|
365
|
-
return VerbType.Contains;
|
|
72
|
+
// Cache the result if enabled
|
|
73
|
+
if (this.options.useCache) {
|
|
74
|
+
this.cache.set(cacheKey, result);
|
|
366
75
|
}
|
|
367
|
-
|
|
368
|
-
if (hint.includes('member') || hint.includes('belong') || hint.includes('part')) {
|
|
369
|
-
return VerbType.MemberOf;
|
|
370
|
-
}
|
|
371
|
-
// Reference patterns
|
|
372
|
-
if (hint.includes('refer') || hint.includes('cite') || hint.includes('link')) {
|
|
373
|
-
return VerbType.References;
|
|
374
|
-
}
|
|
375
|
-
// Dependency patterns
|
|
376
|
-
if (hint.includes('depend') || hint.includes('require') || hint.includes('need')) {
|
|
377
|
-
return VerbType.DependsOn;
|
|
378
|
-
}
|
|
379
|
-
return null;
|
|
76
|
+
return response;
|
|
380
77
|
}
|
|
381
78
|
/**
|
|
382
|
-
*
|
|
79
|
+
* Match a relationship to a verb type
|
|
383
80
|
*/
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
81
|
+
async matchVerbType(source, target, relationship) {
|
|
82
|
+
if (!this.brainyTypes) {
|
|
83
|
+
throw new Error('IntelligentTypeMatcher not initialized. Call init() first.');
|
|
84
|
+
}
|
|
85
|
+
// Create context for verb detection
|
|
86
|
+
const context = {
|
|
87
|
+
source,
|
|
88
|
+
target,
|
|
89
|
+
relationship: relationship || 'related',
|
|
90
|
+
description: relationship || ''
|
|
91
|
+
};
|
|
92
|
+
// Check cache if enabled
|
|
93
|
+
const cacheKey = JSON.stringify(context);
|
|
94
|
+
if (this.options.useCache && this.cache.has(cacheKey)) {
|
|
95
|
+
const cached = this.cache.get(cacheKey);
|
|
96
|
+
return {
|
|
97
|
+
type: cached.type || VerbType.RelatedTo,
|
|
98
|
+
confidence: cached.confidence,
|
|
99
|
+
alternatives: cached.alternatives?.map(alt => ({
|
|
100
|
+
type: alt.type || VerbType.RelatedTo,
|
|
101
|
+
confidence: alt.confidence
|
|
102
|
+
})) || []
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
// Detect verb type using BrainyTypes
|
|
106
|
+
const result = await this.brainyTypes.matchVerbType(context.source, context.target, context.relationship);
|
|
107
|
+
// Convert to expected format
|
|
108
|
+
const response = {
|
|
109
|
+
type: result.type || VerbType.RelatedTo,
|
|
110
|
+
confidence: result.confidence,
|
|
111
|
+
alternatives: result.alternatives?.map(alt => ({
|
|
112
|
+
type: alt.type || VerbType.RelatedTo,
|
|
113
|
+
confidence: alt.confidence
|
|
114
|
+
})) || []
|
|
115
|
+
};
|
|
116
|
+
// Cache the result if enabled
|
|
117
|
+
if (this.options.useCache) {
|
|
118
|
+
this.cache.set(cacheKey, result);
|
|
393
119
|
}
|
|
120
|
+
return response;
|
|
394
121
|
}
|
|
395
122
|
/**
|
|
396
123
|
* Clear the cache
|
|
@@ -399,27 +126,14 @@ export class IntelligentTypeMatcher {
|
|
|
399
126
|
this.cache.clear();
|
|
400
127
|
}
|
|
401
128
|
/**
|
|
402
|
-
*
|
|
129
|
+
* Get cache statistics
|
|
403
130
|
*/
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
/**
|
|
412
|
-
* Singleton instance for efficient reuse
|
|
413
|
-
*/
|
|
414
|
-
let globalMatcher = null;
|
|
415
|
-
/**
|
|
416
|
-
* Get or create the global type matcher instance
|
|
417
|
-
*/
|
|
418
|
-
export async function getTypeMatcher() {
|
|
419
|
-
if (!globalMatcher) {
|
|
420
|
-
globalMatcher = new IntelligentTypeMatcher();
|
|
421
|
-
await globalMatcher.init();
|
|
131
|
+
getCacheStats() {
|
|
132
|
+
return {
|
|
133
|
+
size: this.cache.size,
|
|
134
|
+
maxSize: 1000 // Default max cache size
|
|
135
|
+
};
|
|
422
136
|
}
|
|
423
|
-
return globalMatcher;
|
|
424
137
|
}
|
|
138
|
+
export default IntelligentTypeMatcher;
|
|
425
139
|
//# sourceMappingURL=intelligentTypeMatcher.js.map
|
|
@@ -72,12 +72,12 @@ export declare class UniversalDisplayAugmentation extends BaseAugmentation {
|
|
|
72
72
|
private computationEngine;
|
|
73
73
|
private displayCache;
|
|
74
74
|
private requestDeduplicator;
|
|
75
|
-
|
|
75
|
+
protected config: DisplayConfig;
|
|
76
76
|
protected context: AugmentationContext | undefined;
|
|
77
77
|
constructor(config?: Partial<DisplayConfig>);
|
|
78
78
|
/**
|
|
79
79
|
* Initialize the augmentation with AI components
|
|
80
|
-
* @param context
|
|
80
|
+
* @param context Brainy context
|
|
81
81
|
*/
|
|
82
82
|
initialize(context: AugmentationContext): Promise<void>;
|
|
83
83
|
/**
|
|
@@ -44,7 +44,7 @@ export class UniversalDisplayAugmentation extends BaseAugmentation {
|
|
|
44
44
|
reads: '*', // Read all user data for intelligent analysis
|
|
45
45
|
writes: ['_display'] // Cache computed fields in isolated namespace
|
|
46
46
|
};
|
|
47
|
-
this.operations = ['get', 'search', 'findSimilar', 'getVerb', 'addNoun', 'addVerb'];
|
|
47
|
+
this.operations = ['get', 'search', 'find', 'similar', 'findSimilar', 'getVerb', 'add', 'addNoun', 'addVerb', 'relate'];
|
|
48
48
|
// Augmentation metadata
|
|
49
49
|
this.category = 'core';
|
|
50
50
|
this.description = 'AI-powered intelligent display fields for enhanced data visualization';
|
|
@@ -78,7 +78,7 @@ export class UniversalDisplayAugmentation extends BaseAugmentation {
|
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
80
|
* Initialize the augmentation with AI components
|
|
81
|
-
* @param context
|
|
81
|
+
* @param context Brainy context
|
|
82
82
|
*/
|
|
83
83
|
async initialize(context) {
|
|
84
84
|
if (!this.config.enabled) {
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🧠 Brainy 3.0 - UNIFIED FIND IMPLEMENTATION
|
|
3
|
+
*
|
|
4
|
+
* REAL CODE - NO MOCKS - NO STUBS - PRODUCTION READY
|
|
5
|
+
* O(log n) performance with Triple Intelligence
|
|
6
|
+
*/
|
|
7
|
+
import { Vector } from './coreTypes.js';
|
|
8
|
+
/**
|
|
9
|
+
* Core types
|
|
10
|
+
*/
|
|
11
|
+
export interface Entity<T = any> {
|
|
12
|
+
id: string;
|
|
13
|
+
data: T;
|
|
14
|
+
vector?: Vector;
|
|
15
|
+
metadata?: Record<string, any>;
|
|
16
|
+
type?: string;
|
|
17
|
+
service?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface Result<T = any> {
|
|
20
|
+
id: string;
|
|
21
|
+
score: number;
|
|
22
|
+
entity: Entity<T>;
|
|
23
|
+
}
|
|
24
|
+
export interface FindParams<T = any> {
|
|
25
|
+
id?: string;
|
|
26
|
+
ids?: string[];
|
|
27
|
+
query?: string;
|
|
28
|
+
vector?: Vector;
|
|
29
|
+
near?: {
|
|
30
|
+
id?: string;
|
|
31
|
+
vector?: Vector;
|
|
32
|
+
threshold?: number;
|
|
33
|
+
limit?: number;
|
|
34
|
+
};
|
|
35
|
+
where?: Record<string, any>;
|
|
36
|
+
type?: string | string[];
|
|
37
|
+
service?: string;
|
|
38
|
+
connected?: {
|
|
39
|
+
from: string;
|
|
40
|
+
to?: string;
|
|
41
|
+
type?: string;
|
|
42
|
+
direction?: 'in' | 'out' | 'both';
|
|
43
|
+
maxDepth?: number;
|
|
44
|
+
};
|
|
45
|
+
limit?: number;
|
|
46
|
+
offset?: number;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* UNIFIED BRAINY CLASS - REAL IMPLEMENTATION
|
|
50
|
+
*/
|
|
51
|
+
export declare class Brainy<T = any> {
|
|
52
|
+
private index;
|
|
53
|
+
private storage;
|
|
54
|
+
private embedder;
|
|
55
|
+
private initialized;
|
|
56
|
+
constructor(config?: any);
|
|
57
|
+
/**
|
|
58
|
+
* Initialize Brainy
|
|
59
|
+
*/
|
|
60
|
+
init(): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Add entity
|
|
63
|
+
*/
|
|
64
|
+
add(params: {
|
|
65
|
+
data: T;
|
|
66
|
+
metadata?: any;
|
|
67
|
+
type?: string;
|
|
68
|
+
}): Promise<string>;
|
|
69
|
+
/**
|
|
70
|
+
* Get entity by ID
|
|
71
|
+
*/
|
|
72
|
+
get(id: string): Promise<Entity<T> | null>;
|
|
73
|
+
/**
|
|
74
|
+
* UNIFIED FIND - Real Triple Intelligence Implementation
|
|
75
|
+
* O(log n) performance with Reciprocal Rank Fusion
|
|
76
|
+
*/
|
|
77
|
+
find(params: string | FindParams<T>): Promise<Result<T>[]>;
|
|
78
|
+
/**
|
|
79
|
+
* Search method for NLP compatibility
|
|
80
|
+
*/
|
|
81
|
+
search(query: string | any, limit?: number, options?: any): Promise<Result<T>[]>;
|
|
82
|
+
/**
|
|
83
|
+
* Parse natural language query
|
|
84
|
+
*/
|
|
85
|
+
private parseNaturalLanguage;
|
|
86
|
+
/**
|
|
87
|
+
* Vector Search - O(log n) via HNSW
|
|
88
|
+
*/
|
|
89
|
+
private vectorSearch;
|
|
90
|
+
/**
|
|
91
|
+
* Metadata Search - O(n) for now, but could be indexed
|
|
92
|
+
*/
|
|
93
|
+
private metadataSearch;
|
|
94
|
+
/**
|
|
95
|
+
* Graph Traversal - O(k) where k = edges traversed
|
|
96
|
+
*/
|
|
97
|
+
private graphTraversal;
|
|
98
|
+
/**
|
|
99
|
+
* Reciprocal Rank Fusion - Google's algorithm
|
|
100
|
+
*/
|
|
101
|
+
private reciprocalRankFusion;
|
|
102
|
+
/**
|
|
103
|
+
* Ensure initialized
|
|
104
|
+
*/
|
|
105
|
+
private ensureInitialized;
|
|
106
|
+
}
|