@soulcraft/brainy 3.47.1 → 3.49.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/dist/index.js CHANGED
@@ -108,9 +108,17 @@ import { NounType, VerbType } from './types/graphTypes.js';
108
108
  import { getNounTypes, getVerbTypes, getNounTypeMap, getVerbTypeMap } from './utils/typeUtils.js';
109
109
  // Export BrainyTypes for complete type management
110
110
  import { BrainyTypes, suggestType } from './utils/brainyTypes.js';
111
+ // Export Semantic Type Inference - THE ONE unified system (nouns + verbs)
112
+ import { inferTypes, inferNouns, inferVerbs, inferIntent, getSemanticTypeInference, SemanticTypeInference } from './query/semanticTypeInference.js';
111
113
  export { NounType, VerbType, getNounTypes, getVerbTypes, getNounTypeMap, getVerbTypeMap,
112
114
  // BrainyTypes - complete type management
113
- BrainyTypes, suggestType };
115
+ BrainyTypes, suggestType,
116
+ // Semantic Type Inference - Unified noun + verb inference
117
+ inferTypes, // Main function - returns all types (nouns + verbs)
118
+ inferNouns, // Convenience - noun types only
119
+ inferVerbs, // Convenience - verb types only
120
+ inferIntent, // Best for query understanding - returns {nouns, verbs}
121
+ getSemanticTypeInference, SemanticTypeInference };
114
122
  // Export MCP (Model Control Protocol) components
115
123
  import { BrainyMCPAdapter, MCPAugmentationToolset, BrainyMCPService } from './mcp/index.js'; // Import from mcp/index.js
116
124
  import { MCPRequestType, MCP_VERSION } from './types/mcpTypes.js';
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Pre-computed Keyword Embeddings for Unified Semantic Type Inference
3
+ *
4
+ * Generated by: scripts/buildKeywordEmbeddings.ts
5
+ * Generated on: 2025-10-16T17:40:14.690Z
6
+ * Total keywords: 1050 (716 nouns + 334 verbs)
7
+ * Canonical: 919, Synonyms: 131
8
+ * Embedding dimension: 384
9
+ * Total size: 1.54MB
10
+ *
11
+ * This file contains pre-computed semantic embeddings for ALL type inference keywords.
12
+ * Supports unified noun + verb semantic inference via SemanticTypeInference.
13
+ * Used for O(log n) semantic matching via HNSW index.
14
+ */
15
+ import { NounType, VerbType } from '../types/graphTypes.js';
16
+ import { Vector } from '../coreTypes.js';
17
+ export interface KeywordEmbedding {
18
+ keyword: string;
19
+ type: NounType | VerbType;
20
+ typeCategory: 'noun' | 'verb';
21
+ confidence: number;
22
+ isCanonical: boolean;
23
+ embedding: Vector;
24
+ }
25
+ export declare function getKeywordEmbeddings(): KeywordEmbedding[];
26
+ export declare function getKeywordCount(): number;
27
+ export declare function getNounKeywordCount(): number;
28
+ export declare function getVerbKeywordCount(): number;
29
+ export declare function getEmbeddingDimension(): number;