2025-08-26 12:32:21 -07:00
/ * *
refactor: remove augmentation system and semantic type matching
Remove the entire augmentation pipeline infrastructure (52 files,
~15,000 lines) and the semantic type matching system. These were
unused middleware layers adding complexity without value.
What was removed:
- src/augmentations/ directory (all augmentation implementations)
- src/augmentationManager.ts (pipeline orchestrator)
- src/types/augmentations.ts, src/types/pipelineTypes.ts
- src/shared/default-augmentations.ts
- Semantic type suggestion (BrainyTypes.suggestNoun/suggestVerb)
- src/utils/typeMatching/ (embedding-based type matcher)
What was preserved by relocating:
- Import handlers (CSV, PDF, Excel) -> src/importers/handlers/
- NeuralImportAugmentation -> src/cortex/neuralImportAugmentation.ts
- Type matching utilities -> heuristic inference in consumers
What was simplified:
- brainy.ts: operations call storage directly (no execute() wrapper)
- IntegrationBase: standalone class (no BaseAugmentation parent)
- BrainyTypes: validation-only (nouns, verbs, isValid*, get*)
- Pipeline: direct execution (no augmentation interception)
- index.ts: removed TypeSuggestion, suggestType exports
- package.json: removed stale types/augmentations export
Build passes, 1176 tests pass, 0 failures.
2026-02-01 10:48:56 -08:00
* Neural Import - AI - Powered Data Understanding
*
* Standalone implementation for intelligent data processing .
2025-08-26 12:32:21 -07:00
* /
import { NounType , VerbType } from '../types/graphTypes.js'
import * as fs from '../universal/fs.js'
import * as path from '../universal/path.js'
feat: Universal Import with intelligent type matching (v2.1.0)
✨ ONE universal import method for everything
- Auto-detects files, URLs, and raw data
- Intelligent noun/verb type matching using embeddings
- Support for JSON, CSV, YAML, and text formats
- Zero configuration required
🧠 Intelligent Type Matching
- Uses semantic embeddings to match 31 noun types
- Automatically detects 40 verb relationship types
- Confidence scores for type predictions
- Caching for improved performance
📦 Import Manager
- Centralized import logic with lazy loading
- Integrates NeuralImportAugmentation for AI processing
- Proper CSV parsing with quote handling
- Basic YAML support
🎯 Simplified API
- brain.import() - ONE method that handles everything
- Auto-detection of URLs and file paths
- Backwards compatible with existing code
- Clean, modern, delightful developer experience
📚 Documentation
- Comprehensive import guide in docs/guides/import-anything.md
- Examples for every format and use case
- Philosophy of simplicity and zero config
✅ Tests
- Full unit test coverage for import functionality
- Type matching tests for all 31 nouns and 40 verbs
- Tests for CSV, YAML, JSON, and text formats
BREAKING CHANGES: None - fully backward compatible
2025-08-27 12:11:05 -07:00
import { prodLog } from '../utils/logger.js'
2025-08-26 12:32:21 -07:00
// Neural Import Analysis Types
export interface NeuralAnalysisResult {
detectedEntities : DetectedEntity [ ]
detectedRelationships : DetectedRelationship [ ]
confidence : number
insights : NeuralInsight [ ]
}
export interface DetectedEntity {
originalData : any
nounType : string
confidence : number
suggestedId : string
reasoning : string
alternativeTypes : Array < { type : string , confidence : number } >
}
export interface DetectedRelationship {
sourceId : string
targetId : string
verbType : string
confidence : number
weight : number
reasoning : string
context : string
metadata? : Record < string , any >
}
export interface NeuralInsight {
type : 'hierarchy' | 'cluster' | 'pattern' | 'anomaly' | 'opportunity'
description : string
confidence : number
affectedEntities : string [ ]
recommendation? : string
}
export interface NeuralImportConfig {
confidenceThreshold : number
enableWeights : boolean
skipDuplicates : boolean
categoryFilter? : string [ ]
dataType? : string
}
/ * *
* Neural Import Augmentation - Unified Implementation
* Processes data with AI before storage operations
* /
refactor: remove augmentation system and semantic type matching
Remove the entire augmentation pipeline infrastructure (52 files,
~15,000 lines) and the semantic type matching system. These were
unused middleware layers adding complexity without value.
What was removed:
- src/augmentations/ directory (all augmentation implementations)
- src/augmentationManager.ts (pipeline orchestrator)
- src/types/augmentations.ts, src/types/pipelineTypes.ts
- src/shared/default-augmentations.ts
- Semantic type suggestion (BrainyTypes.suggestNoun/suggestVerb)
- src/utils/typeMatching/ (embedding-based type matcher)
What was preserved by relocating:
- Import handlers (CSV, PDF, Excel) -> src/importers/handlers/
- NeuralImportAugmentation -> src/cortex/neuralImportAugmentation.ts
- Type matching utilities -> heuristic inference in consumers
What was simplified:
- brainy.ts: operations call storage directly (no execute() wrapper)
- IntegrationBase: standalone class (no BaseAugmentation parent)
- BrainyTypes: validation-only (nouns, verbs, isValid*, get*)
- Pipeline: direct execution (no augmentation interception)
- index.ts: removed TypeSuggestion, suggestType exports
- package.json: removed stale types/augmentations export
Build passes, 1176 tests pass, 0 failures.
2026-02-01 10:48:56 -08:00
export class NeuralImportAugmentation {
2025-08-26 12:32:21 -07:00
readonly name = 'neural-import'
refactor: remove augmentation system and semantic type matching
Remove the entire augmentation pipeline infrastructure (52 files,
~15,000 lines) and the semantic type matching system. These were
unused middleware layers adding complexity without value.
What was removed:
- src/augmentations/ directory (all augmentation implementations)
- src/augmentationManager.ts (pipeline orchestrator)
- src/types/augmentations.ts, src/types/pipelineTypes.ts
- src/shared/default-augmentations.ts
- Semantic type suggestion (BrainyTypes.suggestNoun/suggestVerb)
- src/utils/typeMatching/ (embedding-based type matcher)
What was preserved by relocating:
- Import handlers (CSV, PDF, Excel) -> src/importers/handlers/
- NeuralImportAugmentation -> src/cortex/neuralImportAugmentation.ts
- Type matching utilities -> heuristic inference in consumers
What was simplified:
- brainy.ts: operations call storage directly (no execute() wrapper)
- IntegrationBase: standalone class (no BaseAugmentation parent)
- BrainyTypes: validation-only (nouns, verbs, isValid*, get*)
- Pipeline: direct execution (no augmentation interception)
- index.ts: removed TypeSuggestion, suggestType exports
- package.json: removed stale types/augmentations export
Build passes, 1176 tests pass, 0 failures.
2026-02-01 10:48:56 -08:00
private operations = [ 'add' , 'addNoun' , 'addVerb' , 'all' ]
2025-09-11 16:23:32 -07:00
protected config : NeuralImportConfig
2025-08-26 12:32:21 -07:00
private analysisCache = new Map < string , NeuralAnalysisResult > ( )
refactor: remove augmentation system and semantic type matching
Remove the entire augmentation pipeline infrastructure (52 files,
~15,000 lines) and the semantic type matching system. These were
unused middleware layers adding complexity without value.
What was removed:
- src/augmentations/ directory (all augmentation implementations)
- src/augmentationManager.ts (pipeline orchestrator)
- src/types/augmentations.ts, src/types/pipelineTypes.ts
- src/shared/default-augmentations.ts
- Semantic type suggestion (BrainyTypes.suggestNoun/suggestVerb)
- src/utils/typeMatching/ (embedding-based type matcher)
What was preserved by relocating:
- Import handlers (CSV, PDF, Excel) -> src/importers/handlers/
- NeuralImportAugmentation -> src/cortex/neuralImportAugmentation.ts
- Type matching utilities -> heuristic inference in consumers
What was simplified:
- brainy.ts: operations call storage directly (no execute() wrapper)
- IntegrationBase: standalone class (no BaseAugmentation parent)
- BrainyTypes: validation-only (nouns, verbs, isValid*, get*)
- Pipeline: direct execution (no augmentation interception)
- index.ts: removed TypeSuggestion, suggestType exports
- package.json: removed stale types/augmentations export
Build passes, 1176 tests pass, 0 failures.
2026-02-01 10:48:56 -08:00
private context ? : { brain : any }
2025-08-26 12:32:21 -07:00
constructor ( config : Partial < NeuralImportConfig > = { } ) {
this . config = {
confidenceThreshold : 0.7 ,
enableWeights : true ,
skipDuplicates : true ,
dataType : 'json' ,
. . . config
}
}
refactor: remove augmentation system and semantic type matching
Remove the entire augmentation pipeline infrastructure (52 files,
~15,000 lines) and the semantic type matching system. These were
unused middleware layers adding complexity without value.
What was removed:
- src/augmentations/ directory (all augmentation implementations)
- src/augmentationManager.ts (pipeline orchestrator)
- src/types/augmentations.ts, src/types/pipelineTypes.ts
- src/shared/default-augmentations.ts
- Semantic type suggestion (BrainyTypes.suggestNoun/suggestVerb)
- src/utils/typeMatching/ (embedding-based type matcher)
What was preserved by relocating:
- Import handlers (CSV, PDF, Excel) -> src/importers/handlers/
- NeuralImportAugmentation -> src/cortex/neuralImportAugmentation.ts
- Type matching utilities -> heuristic inference in consumers
What was simplified:
- brainy.ts: operations call storage directly (no execute() wrapper)
- IntegrationBase: standalone class (no BaseAugmentation parent)
- BrainyTypes: validation-only (nouns, verbs, isValid*, get*)
- Pipeline: direct execution (no augmentation interception)
- index.ts: removed TypeSuggestion, suggestType exports
- package.json: removed stale types/augmentations export
Build passes, 1176 tests pass, 0 failures.
2026-02-01 10:48:56 -08:00
async init ( ) : Promise < void > {
// No external dependencies to initialize
2025-08-26 12:32:21 -07:00
}
refactor: remove augmentation system and semantic type matching
Remove the entire augmentation pipeline infrastructure (52 files,
~15,000 lines) and the semantic type matching system. These were
unused middleware layers adding complexity without value.
What was removed:
- src/augmentations/ directory (all augmentation implementations)
- src/augmentationManager.ts (pipeline orchestrator)
- src/types/augmentations.ts, src/types/pipelineTypes.ts
- src/shared/default-augmentations.ts
- Semantic type suggestion (BrainyTypes.suggestNoun/suggestVerb)
- src/utils/typeMatching/ (embedding-based type matcher)
What was preserved by relocating:
- Import handlers (CSV, PDF, Excel) -> src/importers/handlers/
- NeuralImportAugmentation -> src/cortex/neuralImportAugmentation.ts
- Type matching utilities -> heuristic inference in consumers
What was simplified:
- brainy.ts: operations call storage directly (no execute() wrapper)
- IntegrationBase: standalone class (no BaseAugmentation parent)
- BrainyTypes: validation-only (nouns, verbs, isValid*, get*)
- Pipeline: direct execution (no augmentation interception)
- index.ts: removed TypeSuggestion, suggestType exports
- package.json: removed stale types/augmentations export
Build passes, 1176 tests pass, 0 failures.
2026-02-01 10:48:56 -08:00
private log ( message : string , _level? : string ) : void {
// Silent by default
2025-08-26 12:32:21 -07:00
}
/ * *
* Execute augmentation - process data with AI before storage
* /
async execute < T = any > (
operation : string ,
params : any ,
next : ( ) = > Promise < T >
) : Promise < T > {
// Only process on add operations
2026-06-11 14:51:00 -07:00
if ( ! this . operations . includes ( operation ) ) {
2025-08-26 12:32:21 -07:00
return next ( )
}
try {
// Extract data from params based on operation
const rawData = this . extractRawData ( operation , params )
if ( ! rawData ) {
return next ( )
}
// Perform neural analysis
const analysis = await this . performNeuralAnalysis ( rawData , this . config )
// Enhance params with neural insights
if ( params . metadata ) {
params . metadata . _neuralProcessed = true
params . metadata . _neuralConfidence = analysis . confidence
params . metadata . _detectedEntities = analysis . detectedEntities . length
params . metadata . _detectedRelationships = analysis . detectedRelationships . length
params . metadata . _neuralInsights = analysis . insights
} else if ( typeof params === 'object' ) {
params . metadata = {
_neuralProcessed : true ,
_neuralConfidence : analysis.confidence ,
_detectedEntities : analysis.detectedEntities.length ,
_detectedRelationships : analysis.detectedRelationships.length ,
_neuralInsights : analysis.insights
}
}
// Store neural analysis for later retrieval
await this . storeNeuralAnalysis ( analysis )
// If we detected entities/relationships, potentially add them
if ( this . context ? . brain && analysis . detectedEntities . length > 0 ) {
// This could automatically create entities/relationships
// But for now, just enhance the metadata
this . log ( ` Detected ${ analysis . detectedEntities . length } entities and ${ analysis . detectedRelationships . length } relationships ` )
}
// Continue with enhanced data
return next ( )
} catch ( error ) {
this . log ( ` Neural analysis failed: ${ error } ` , 'warn' )
// Continue without neural processing
return next ( )
}
}
/ * *
* Extract raw data from operation params
* /
private extractRawData ( operation : string , params : any ) : any {
switch ( operation ) {
case 'add' :
return params . content || params . data || params
case 'addNoun' :
return params . noun || params . data || params
case 'addVerb' :
return params . verb || params
case 'addBatch' :
return params . items || params . batch || params
default :
return null
}
}
/ * *
* Get the full neural analysis result ( for external use )
* /
async getNeuralAnalysis ( rawData : Buffer | string , dataType? : string ) : Promise < NeuralAnalysisResult > {
const parsedData = await this . parseRawData ( rawData , dataType || this . config . dataType || 'json' )
return await this . performNeuralAnalysis ( parsedData , this . config )
}
/ * *
* Parse raw data based on type
* /
private async parseRawData ( rawData : Buffer | string , dataType : string ) : Promise < any [ ] > {
const content = typeof rawData === 'string' ? rawData : rawData.toString ( 'utf8' )
switch ( dataType . toLowerCase ( ) ) {
case 'json' :
try {
const jsonData = JSON . parse ( content )
return Array . isArray ( jsonData ) ? jsonData : [ jsonData ]
} catch {
// If JSON parse fails, treat as text
return [ { text : content } ]
}
case 'csv' :
return this . parseCSV ( content )
case 'yaml' :
case 'yml' :
feat: Universal Import with intelligent type matching (v2.1.0)
✨ ONE universal import method for everything
- Auto-detects files, URLs, and raw data
- Intelligent noun/verb type matching using embeddings
- Support for JSON, CSV, YAML, and text formats
- Zero configuration required
🧠 Intelligent Type Matching
- Uses semantic embeddings to match 31 noun types
- Automatically detects 40 verb relationship types
- Confidence scores for type predictions
- Caching for improved performance
📦 Import Manager
- Centralized import logic with lazy loading
- Integrates NeuralImportAugmentation for AI processing
- Proper CSV parsing with quote handling
- Basic YAML support
🎯 Simplified API
- brain.import() - ONE method that handles everything
- Auto-detection of URLs and file paths
- Backwards compatible with existing code
- Clean, modern, delightful developer experience
📚 Documentation
- Comprehensive import guide in docs/guides/import-anything.md
- Examples for every format and use case
- Philosophy of simplicity and zero config
✅ Tests
- Full unit test coverage for import functionality
- Type matching tests for all 31 nouns and 40 verbs
- Tests for CSV, YAML, JSON, and text formats
BREAKING CHANGES: None - fully backward compatible
2025-08-27 12:11:05 -07:00
return this . parseYAML ( content )
2025-08-26 12:32:21 -07:00
case 'txt' :
case 'text' :
// Split text into sentences/paragraphs for analysis
return content . split ( /\n+/ ) . filter ( line = > line . trim ( ) ) . map ( line = > ( { text : line } ) )
default :
// Unknown type, treat as text
return [ { text : content } ]
}
}
/ * *
feat: Universal Import with intelligent type matching (v2.1.0)
✨ ONE universal import method for everything
- Auto-detects files, URLs, and raw data
- Intelligent noun/verb type matching using embeddings
- Support for JSON, CSV, YAML, and text formats
- Zero configuration required
🧠 Intelligent Type Matching
- Uses semantic embeddings to match 31 noun types
- Automatically detects 40 verb relationship types
- Confidence scores for type predictions
- Caching for improved performance
📦 Import Manager
- Centralized import logic with lazy loading
- Integrates NeuralImportAugmentation for AI processing
- Proper CSV parsing with quote handling
- Basic YAML support
🎯 Simplified API
- brain.import() - ONE method that handles everything
- Auto-detection of URLs and file paths
- Backwards compatible with existing code
- Clean, modern, delightful developer experience
📚 Documentation
- Comprehensive import guide in docs/guides/import-anything.md
- Examples for every format and use case
- Philosophy of simplicity and zero config
✅ Tests
- Full unit test coverage for import functionality
- Type matching tests for all 31 nouns and 40 verbs
- Tests for CSV, YAML, JSON, and text formats
BREAKING CHANGES: None - fully backward compatible
2025-08-27 12:11:05 -07:00
* Parse CSV data - handles quoted values , escaped quotes , and edge cases
2025-08-26 12:32:21 -07:00
* /
private parseCSV ( content : string ) : any [ ] {
feat: Universal Import with intelligent type matching (v2.1.0)
✨ ONE universal import method for everything
- Auto-detects files, URLs, and raw data
- Intelligent noun/verb type matching using embeddings
- Support for JSON, CSV, YAML, and text formats
- Zero configuration required
🧠 Intelligent Type Matching
- Uses semantic embeddings to match 31 noun types
- Automatically detects 40 verb relationship types
- Confidence scores for type predictions
- Caching for improved performance
📦 Import Manager
- Centralized import logic with lazy loading
- Integrates NeuralImportAugmentation for AI processing
- Proper CSV parsing with quote handling
- Basic YAML support
🎯 Simplified API
- brain.import() - ONE method that handles everything
- Auto-detection of URLs and file paths
- Backwards compatible with existing code
- Clean, modern, delightful developer experience
📚 Documentation
- Comprehensive import guide in docs/guides/import-anything.md
- Examples for every format and use case
- Philosophy of simplicity and zero config
✅ Tests
- Full unit test coverage for import functionality
- Type matching tests for all 31 nouns and 40 verbs
- Tests for CSV, YAML, JSON, and text formats
BREAKING CHANGES: None - fully backward compatible
2025-08-27 12:11:05 -07:00
const lines = content . split ( '\n' )
2025-08-26 12:32:21 -07:00
if ( lines . length === 0 ) return [ ]
feat: Universal Import with intelligent type matching (v2.1.0)
✨ ONE universal import method for everything
- Auto-detects files, URLs, and raw data
- Intelligent noun/verb type matching using embeddings
- Support for JSON, CSV, YAML, and text formats
- Zero configuration required
🧠 Intelligent Type Matching
- Uses semantic embeddings to match 31 noun types
- Automatically detects 40 verb relationship types
- Confidence scores for type predictions
- Caching for improved performance
📦 Import Manager
- Centralized import logic with lazy loading
- Integrates NeuralImportAugmentation for AI processing
- Proper CSV parsing with quote handling
- Basic YAML support
🎯 Simplified API
- brain.import() - ONE method that handles everything
- Auto-detection of URLs and file paths
- Backwards compatible with existing code
- Clean, modern, delightful developer experience
📚 Documentation
- Comprehensive import guide in docs/guides/import-anything.md
- Examples for every format and use case
- Philosophy of simplicity and zero config
✅ Tests
- Full unit test coverage for import functionality
- Type matching tests for all 31 nouns and 40 verbs
- Tests for CSV, YAML, JSON, and text formats
BREAKING CHANGES: None - fully backward compatible
2025-08-27 12:11:05 -07:00
// Parse a CSV line handling quotes
const parseLine = ( line : string ) : string [ ] = > {
const result : string [ ] = [ ]
let current = ''
let inQuotes = false
let i = 0
while ( i < line . length ) {
const char = line [ i ]
const nextChar = line [ i + 1 ]
if ( char === '"' ) {
if ( inQuotes && nextChar === '"' ) {
// Escaped quote
current += '"'
i += 2
} else {
// Toggle quote mode
inQuotes = ! inQuotes
i ++
}
} else if ( char === ',' && ! inQuotes ) {
// Field separator
result . push ( current . trim ( ) )
current = ''
i ++
} else {
current += char
i ++
}
}
// Add last field
result . push ( current . trim ( ) )
return result
}
// Parse headers
const headers = parseLine ( lines [ 0 ] )
2025-08-26 12:32:21 -07:00
const data = [ ]
feat: Universal Import with intelligent type matching (v2.1.0)
✨ ONE universal import method for everything
- Auto-detects files, URLs, and raw data
- Intelligent noun/verb type matching using embeddings
- Support for JSON, CSV, YAML, and text formats
- Zero configuration required
🧠 Intelligent Type Matching
- Uses semantic embeddings to match 31 noun types
- Automatically detects 40 verb relationship types
- Confidence scores for type predictions
- Caching for improved performance
📦 Import Manager
- Centralized import logic with lazy loading
- Integrates NeuralImportAugmentation for AI processing
- Proper CSV parsing with quote handling
- Basic YAML support
🎯 Simplified API
- brain.import() - ONE method that handles everything
- Auto-detection of URLs and file paths
- Backwards compatible with existing code
- Clean, modern, delightful developer experience
📚 Documentation
- Comprehensive import guide in docs/guides/import-anything.md
- Examples for every format and use case
- Philosophy of simplicity and zero config
✅ Tests
- Full unit test coverage for import functionality
- Type matching tests for all 31 nouns and 40 verbs
- Tests for CSV, YAML, JSON, and text formats
BREAKING CHANGES: None - fully backward compatible
2025-08-27 12:11:05 -07:00
// Parse data rows
2025-08-26 12:32:21 -07:00
for ( let i = 1 ; i < lines . length ; i ++ ) {
feat: Universal Import with intelligent type matching (v2.1.0)
✨ ONE universal import method for everything
- Auto-detects files, URLs, and raw data
- Intelligent noun/verb type matching using embeddings
- Support for JSON, CSV, YAML, and text formats
- Zero configuration required
🧠 Intelligent Type Matching
- Uses semantic embeddings to match 31 noun types
- Automatically detects 40 verb relationship types
- Confidence scores for type predictions
- Caching for improved performance
📦 Import Manager
- Centralized import logic with lazy loading
- Integrates NeuralImportAugmentation for AI processing
- Proper CSV parsing with quote handling
- Basic YAML support
🎯 Simplified API
- brain.import() - ONE method that handles everything
- Auto-detection of URLs and file paths
- Backwards compatible with existing code
- Clean, modern, delightful developer experience
📚 Documentation
- Comprehensive import guide in docs/guides/import-anything.md
- Examples for every format and use case
- Philosophy of simplicity and zero config
✅ Tests
- Full unit test coverage for import functionality
- Type matching tests for all 31 nouns and 40 verbs
- Tests for CSV, YAML, JSON, and text formats
BREAKING CHANGES: None - fully backward compatible
2025-08-27 12:11:05 -07:00
const line = lines [ i ] . trim ( )
if ( ! line ) continue // Skip empty lines
const values = parseLine ( line )
2025-08-26 12:32:21 -07:00
const row : any = { }
feat: Universal Import with intelligent type matching (v2.1.0)
✨ ONE universal import method for everything
- Auto-detects files, URLs, and raw data
- Intelligent noun/verb type matching using embeddings
- Support for JSON, CSV, YAML, and text formats
- Zero configuration required
🧠 Intelligent Type Matching
- Uses semantic embeddings to match 31 noun types
- Automatically detects 40 verb relationship types
- Confidence scores for type predictions
- Caching for improved performance
📦 Import Manager
- Centralized import logic with lazy loading
- Integrates NeuralImportAugmentation for AI processing
- Proper CSV parsing with quote handling
- Basic YAML support
🎯 Simplified API
- brain.import() - ONE method that handles everything
- Auto-detection of URLs and file paths
- Backwards compatible with existing code
- Clean, modern, delightful developer experience
📚 Documentation
- Comprehensive import guide in docs/guides/import-anything.md
- Examples for every format and use case
- Philosophy of simplicity and zero config
✅ Tests
- Full unit test coverage for import functionality
- Type matching tests for all 31 nouns and 40 verbs
- Tests for CSV, YAML, JSON, and text formats
BREAKING CHANGES: None - fully backward compatible
2025-08-27 12:11:05 -07:00
2025-08-26 12:32:21 -07:00
headers . forEach ( ( header , index ) = > {
feat: Universal Import with intelligent type matching (v2.1.0)
✨ ONE universal import method for everything
- Auto-detects files, URLs, and raw data
- Intelligent noun/verb type matching using embeddings
- Support for JSON, CSV, YAML, and text formats
- Zero configuration required
🧠 Intelligent Type Matching
- Uses semantic embeddings to match 31 noun types
- Automatically detects 40 verb relationship types
- Confidence scores for type predictions
- Caching for improved performance
📦 Import Manager
- Centralized import logic with lazy loading
- Integrates NeuralImportAugmentation for AI processing
- Proper CSV parsing with quote handling
- Basic YAML support
🎯 Simplified API
- brain.import() - ONE method that handles everything
- Auto-detection of URLs and file paths
- Backwards compatible with existing code
- Clean, modern, delightful developer experience
📚 Documentation
- Comprehensive import guide in docs/guides/import-anything.md
- Examples for every format and use case
- Philosophy of simplicity and zero config
✅ Tests
- Full unit test coverage for import functionality
- Type matching tests for all 31 nouns and 40 verbs
- Tests for CSV, YAML, JSON, and text formats
BREAKING CHANGES: None - fully backward compatible
2025-08-27 12:11:05 -07:00
const value = values [ index ] || ''
// Try to parse numbers
const num = Number ( value )
row [ header ] = ! isNaN ( num ) && value !== '' ? num : value
2025-08-26 12:32:21 -07:00
} )
feat: Universal Import with intelligent type matching (v2.1.0)
✨ ONE universal import method for everything
- Auto-detects files, URLs, and raw data
- Intelligent noun/verb type matching using embeddings
- Support for JSON, CSV, YAML, and text formats
- Zero configuration required
🧠 Intelligent Type Matching
- Uses semantic embeddings to match 31 noun types
- Automatically detects 40 verb relationship types
- Confidence scores for type predictions
- Caching for improved performance
📦 Import Manager
- Centralized import logic with lazy loading
- Integrates NeuralImportAugmentation for AI processing
- Proper CSV parsing with quote handling
- Basic YAML support
🎯 Simplified API
- brain.import() - ONE method that handles everything
- Auto-detection of URLs and file paths
- Backwards compatible with existing code
- Clean, modern, delightful developer experience
📚 Documentation
- Comprehensive import guide in docs/guides/import-anything.md
- Examples for every format and use case
- Philosophy of simplicity and zero config
✅ Tests
- Full unit test coverage for import functionality
- Type matching tests for all 31 nouns and 40 verbs
- Tests for CSV, YAML, JSON, and text formats
BREAKING CHANGES: None - fully backward compatible
2025-08-27 12:11:05 -07:00
2025-08-26 12:32:21 -07:00
data . push ( row )
}
return data
}
feat: Universal Import with intelligent type matching (v2.1.0)
✨ ONE universal import method for everything
- Auto-detects files, URLs, and raw data
- Intelligent noun/verb type matching using embeddings
- Support for JSON, CSV, YAML, and text formats
- Zero configuration required
🧠 Intelligent Type Matching
- Uses semantic embeddings to match 31 noun types
- Automatically detects 40 verb relationship types
- Confidence scores for type predictions
- Caching for improved performance
📦 Import Manager
- Centralized import logic with lazy loading
- Integrates NeuralImportAugmentation for AI processing
- Proper CSV parsing with quote handling
- Basic YAML support
🎯 Simplified API
- brain.import() - ONE method that handles everything
- Auto-detection of URLs and file paths
- Backwards compatible with existing code
- Clean, modern, delightful developer experience
📚 Documentation
- Comprehensive import guide in docs/guides/import-anything.md
- Examples for every format and use case
- Philosophy of simplicity and zero config
✅ Tests
- Full unit test coverage for import functionality
- Type matching tests for all 31 nouns and 40 verbs
- Tests for CSV, YAML, JSON, and text formats
BREAKING CHANGES: None - fully backward compatible
2025-08-27 12:11:05 -07:00
/ * *
* Parse YAML data
* /
private parseYAML ( content : string ) : any [ ] {
try {
// Simple YAML parser for basic structures
// For full YAML support, we'd use js-yaml library
const lines = content . split ( '\n' )
const result : any [ ] = [ ]
let currentObject : any = null
let currentIndent = 0
for ( const line of lines ) {
const trimmed = line . trim ( )
if ( ! trimmed || trimmed . startsWith ( '#' ) ) continue // Skip empty lines and comments
// Calculate indentation
const indent = line . length - line . trimStart ( ) . length
// Check for array item
if ( trimmed . startsWith ( '- ' ) ) {
const value = trimmed . substring ( 2 ) . trim ( )
if ( indent === 0 ) {
// Top-level array item
if ( value . includes ( ':' ) ) {
// Object in array
currentObject = { }
result . push ( currentObject )
const [ key , val ] = value . split ( ':' ) . map ( s = > s . trim ( ) )
currentObject [ key ] = this . parseYAMLValue ( val )
} else {
result . push ( this . parseYAMLValue ( value ) )
}
} else if ( currentObject ) {
// Nested array
const lastKey = Object . keys ( currentObject ) . pop ( )
if ( lastKey ) {
if ( ! Array . isArray ( currentObject [ lastKey ] ) ) {
currentObject [ lastKey ] = [ ]
}
currentObject [ lastKey ] . push ( this . parseYAMLValue ( value ) )
}
}
} else if ( trimmed . includes ( ':' ) ) {
// Key-value pair
const colonIndex = trimmed . indexOf ( ':' )
const key = trimmed . substring ( 0 , colonIndex ) . trim ( )
const value = trimmed . substring ( colonIndex + 1 ) . trim ( )
if ( indent === 0 ) {
// Top-level object
if ( ! currentObject ) {
currentObject = { }
result . push ( currentObject )
}
currentObject [ key ] = this . parseYAMLValue ( value )
currentIndent = 0
} else if ( currentObject ) {
// Nested object
if ( indent > currentIndent && ! value ) {
// Start of nested object
const lastKey = Object . keys ( currentObject ) . pop ( )
if ( lastKey ) {
currentObject [ lastKey ] = { [ key ] : '' }
}
} else {
currentObject [ key ] = this . parseYAMLValue ( value )
}
currentIndent = indent
}
}
}
// If we built a single object and not an array, wrap it
if ( result . length === 0 && currentObject ) {
result . push ( currentObject )
}
return result . length > 0 ? result : [ { text : content } ]
} catch ( error ) {
prodLog . warn ( 'YAML parsing failed, treating as text:' , error )
return [ { text : content } ]
}
}
/ * *
* Parse a YAML value ( handle strings , numbers , booleans , null )
* /
private parseYAMLValue ( value : string ) : any {
if ( ! value || value === '~' || value === 'null' ) return null
if ( value === 'true' ) return true
if ( value === 'false' ) return false
// Remove quotes if present
if ( ( value . startsWith ( '"' ) && value . endsWith ( '"' ) ) ||
( value . startsWith ( "'" ) && value . endsWith ( "'" ) ) ) {
return value . slice ( 1 , - 1 )
}
// Try to parse as number
const num = Number ( value )
if ( ! isNaN ( num ) && value !== '' ) return num
return value
}
2025-08-26 12:32:21 -07:00
/ * *
* Perform neural analysis on parsed data
* /
private async performNeuralAnalysis ( data : any [ ] , config? : any ) : Promise < NeuralAnalysisResult > {
const detectedEntities : DetectedEntity [ ] = [ ]
const detectedRelationships : DetectedRelationship [ ] = [ ]
const insights : NeuralInsight [ ] = [ ]
// Simple entity detection (in real implementation, would use ML)
for ( const item of data ) {
if ( typeof item === 'object' ) {
// Detect entities from object properties
const entityId = item . id || item . name || item . title || ` entity_ ${ Date . now ( ) } _ ${ Math . random ( ) } `
detectedEntities . push ( {
originalData : item ,
feat: Universal Import with intelligent type matching (v2.1.0)
✨ ONE universal import method for everything
- Auto-detects files, URLs, and raw data
- Intelligent noun/verb type matching using embeddings
- Support for JSON, CSV, YAML, and text formats
- Zero configuration required
🧠 Intelligent Type Matching
- Uses semantic embeddings to match 31 noun types
- Automatically detects 40 verb relationship types
- Confidence scores for type predictions
- Caching for improved performance
📦 Import Manager
- Centralized import logic with lazy loading
- Integrates NeuralImportAugmentation for AI processing
- Proper CSV parsing with quote handling
- Basic YAML support
🎯 Simplified API
- brain.import() - ONE method that handles everything
- Auto-detection of URLs and file paths
- Backwards compatible with existing code
- Clean, modern, delightful developer experience
📚 Documentation
- Comprehensive import guide in docs/guides/import-anything.md
- Examples for every format and use case
- Philosophy of simplicity and zero config
✅ Tests
- Full unit test coverage for import functionality
- Type matching tests for all 31 nouns and 40 verbs
- Tests for CSV, YAML, JSON, and text formats
BREAKING CHANGES: None - fully backward compatible
2025-08-27 12:11:05 -07:00
nounType : await this . inferNounType ( item ) ,
2025-08-26 12:32:21 -07:00
confidence : 0.85 ,
suggestedId : String ( entityId ) ,
reasoning : 'Detected from structured data' ,
alternativeTypes : [ ]
} )
// Detect relationships from references
feat: Universal Import with intelligent type matching (v2.1.0)
✨ ONE universal import method for everything
- Auto-detects files, URLs, and raw data
- Intelligent noun/verb type matching using embeddings
- Support for JSON, CSV, YAML, and text formats
- Zero configuration required
🧠 Intelligent Type Matching
- Uses semantic embeddings to match 31 noun types
- Automatically detects 40 verb relationship types
- Confidence scores for type predictions
- Caching for improved performance
📦 Import Manager
- Centralized import logic with lazy loading
- Integrates NeuralImportAugmentation for AI processing
- Proper CSV parsing with quote handling
- Basic YAML support
🎯 Simplified API
- brain.import() - ONE method that handles everything
- Auto-detection of URLs and file paths
- Backwards compatible with existing code
- Clean, modern, delightful developer experience
📚 Documentation
- Comprehensive import guide in docs/guides/import-anything.md
- Examples for every format and use case
- Philosophy of simplicity and zero config
✅ Tests
- Full unit test coverage for import functionality
- Type matching tests for all 31 nouns and 40 verbs
- Tests for CSV, YAML, JSON, and text formats
BREAKING CHANGES: None - fully backward compatible
2025-08-27 12:11:05 -07:00
await this . detectRelationships ( item , entityId , detectedRelationships )
2025-08-26 12:32:21 -07:00
}
}
// Generate insights
if ( detectedEntities . length > 10 ) {
insights . push ( {
type : 'pattern' ,
description : ` Large dataset with ${ detectedEntities . length } entities detected ` ,
confidence : 0.9 ,
affectedEntities : detectedEntities.slice ( 0 , 5 ) . map ( e = > e . suggestedId ) ,
recommendation : 'Consider batch processing for optimal performance'
} )
}
// Look for clusters
const typeGroups = this . groupByType ( detectedEntities )
if ( Object . keys ( typeGroups ) . length > 1 ) {
insights . push ( {
type : 'cluster' ,
description : ` Multiple entity types detected: ${ Object . keys ( typeGroups ) . join ( ', ' ) } ` ,
confidence : 0.8 ,
affectedEntities : [ ] ,
recommendation : 'Data contains diverse entity types suitable for graph analysis'
} )
}
return {
detectedEntities ,
detectedRelationships ,
confidence : detectedEntities.length > 0 ? 0.85 : 0.5 ,
insights
}
}
/ * *
refactor: remove augmentation system and semantic type matching
Remove the entire augmentation pipeline infrastructure (52 files,
~15,000 lines) and the semantic type matching system. These were
unused middleware layers adding complexity without value.
What was removed:
- src/augmentations/ directory (all augmentation implementations)
- src/augmentationManager.ts (pipeline orchestrator)
- src/types/augmentations.ts, src/types/pipelineTypes.ts
- src/shared/default-augmentations.ts
- Semantic type suggestion (BrainyTypes.suggestNoun/suggestVerb)
- src/utils/typeMatching/ (embedding-based type matcher)
What was preserved by relocating:
- Import handlers (CSV, PDF, Excel) -> src/importers/handlers/
- NeuralImportAugmentation -> src/cortex/neuralImportAugmentation.ts
- Type matching utilities -> heuristic inference in consumers
What was simplified:
- brainy.ts: operations call storage directly (no execute() wrapper)
- IntegrationBase: standalone class (no BaseAugmentation parent)
- BrainyTypes: validation-only (nouns, verbs, isValid*, get*)
- Pipeline: direct execution (no augmentation interception)
- index.ts: removed TypeSuggestion, suggestType exports
- package.json: removed stale types/augmentations export
Build passes, 1176 tests pass, 0 failures.
2026-02-01 10:48:56 -08:00
* Infer noun type from object structure using field heuristics
2025-08-26 12:32:21 -07:00
* /
feat: Universal Import with intelligent type matching (v2.1.0)
✨ ONE universal import method for everything
- Auto-detects files, URLs, and raw data
- Intelligent noun/verb type matching using embeddings
- Support for JSON, CSV, YAML, and text formats
- Zero configuration required
🧠 Intelligent Type Matching
- Uses semantic embeddings to match 31 noun types
- Automatically detects 40 verb relationship types
- Confidence scores for type predictions
- Caching for improved performance
📦 Import Manager
- Centralized import logic with lazy loading
- Integrates NeuralImportAugmentation for AI processing
- Proper CSV parsing with quote handling
- Basic YAML support
🎯 Simplified API
- brain.import() - ONE method that handles everything
- Auto-detection of URLs and file paths
- Backwards compatible with existing code
- Clean, modern, delightful developer experience
📚 Documentation
- Comprehensive import guide in docs/guides/import-anything.md
- Examples for every format and use case
- Philosophy of simplicity and zero config
✅ Tests
- Full unit test coverage for import functionality
- Type matching tests for all 31 nouns and 40 verbs
- Tests for CSV, YAML, JSON, and text formats
BREAKING CHANGES: None - fully backward compatible
2025-08-27 12:11:05 -07:00
private async inferNounType ( obj : any ) : Promise < string > {
refactor: remove augmentation system and semantic type matching
Remove the entire augmentation pipeline infrastructure (52 files,
~15,000 lines) and the semantic type matching system. These were
unused middleware layers adding complexity without value.
What was removed:
- src/augmentations/ directory (all augmentation implementations)
- src/augmentationManager.ts (pipeline orchestrator)
- src/types/augmentations.ts, src/types/pipelineTypes.ts
- src/shared/default-augmentations.ts
- Semantic type suggestion (BrainyTypes.suggestNoun/suggestVerb)
- src/utils/typeMatching/ (embedding-based type matcher)
What was preserved by relocating:
- Import handlers (CSV, PDF, Excel) -> src/importers/handlers/
- NeuralImportAugmentation -> src/cortex/neuralImportAugmentation.ts
- Type matching utilities -> heuristic inference in consumers
What was simplified:
- brainy.ts: operations call storage directly (no execute() wrapper)
- IntegrationBase: standalone class (no BaseAugmentation parent)
- BrainyTypes: validation-only (nouns, verbs, isValid*, get*)
- Pipeline: direct execution (no augmentation interception)
- index.ts: removed TypeSuggestion, suggestType exports
- package.json: removed stale types/augmentations export
Build passes, 1176 tests pass, 0 failures.
2026-02-01 10:48:56 -08:00
if ( typeof obj !== 'object' || obj === null ) return NounType . Thing
// Check for explicit type field
if ( obj . type && typeof obj . type === 'string' ) {
const normalized = obj . type . charAt ( 0 ) . toUpperCase ( ) + obj . type . slice ( 1 )
if ( Object . values ( NounType ) . includes ( normalized as NounType ) ) {
return normalized as NounType
}
feat: Universal Import with intelligent type matching (v2.1.0)
✨ ONE universal import method for everything
- Auto-detects files, URLs, and raw data
- Intelligent noun/verb type matching using embeddings
- Support for JSON, CSV, YAML, and text formats
- Zero configuration required
🧠 Intelligent Type Matching
- Uses semantic embeddings to match 31 noun types
- Automatically detects 40 verb relationship types
- Confidence scores for type predictions
- Caching for improved performance
📦 Import Manager
- Centralized import logic with lazy loading
- Integrates NeuralImportAugmentation for AI processing
- Proper CSV parsing with quote handling
- Basic YAML support
🎯 Simplified API
- brain.import() - ONE method that handles everything
- Auto-detection of URLs and file paths
- Backwards compatible with existing code
- Clean, modern, delightful developer experience
📚 Documentation
- Comprehensive import guide in docs/guides/import-anything.md
- Examples for every format and use case
- Philosophy of simplicity and zero config
✅ Tests
- Full unit test coverage for import functionality
- Type matching tests for all 31 nouns and 40 verbs
- Tests for CSV, YAML, JSON, and text formats
BREAKING CHANGES: None - fully backward compatible
2025-08-27 12:11:05 -07:00
}
refactor: remove augmentation system and semantic type matching
Remove the entire augmentation pipeline infrastructure (52 files,
~15,000 lines) and the semantic type matching system. These were
unused middleware layers adding complexity without value.
What was removed:
- src/augmentations/ directory (all augmentation implementations)
- src/augmentationManager.ts (pipeline orchestrator)
- src/types/augmentations.ts, src/types/pipelineTypes.ts
- src/shared/default-augmentations.ts
- Semantic type suggestion (BrainyTypes.suggestNoun/suggestVerb)
- src/utils/typeMatching/ (embedding-based type matcher)
What was preserved by relocating:
- Import handlers (CSV, PDF, Excel) -> src/importers/handlers/
- NeuralImportAugmentation -> src/cortex/neuralImportAugmentation.ts
- Type matching utilities -> heuristic inference in consumers
What was simplified:
- brainy.ts: operations call storage directly (no execute() wrapper)
- IntegrationBase: standalone class (no BaseAugmentation parent)
- BrainyTypes: validation-only (nouns, verbs, isValid*, get*)
- Pipeline: direct execution (no augmentation interception)
- index.ts: removed TypeSuggestion, suggestType exports
- package.json: removed stale types/augmentations export
Build passes, 1176 tests pass, 0 failures.
2026-02-01 10:48:56 -08:00
if ( obj . email || obj . firstName || obj . lastName || obj . username ) return NounType . Person
if ( obj . companyName || obj . organizationId || obj . employees ) return NounType . Organization
if ( obj . latitude || obj . longitude || obj . address || obj . city ) return NounType . Location
if ( ( obj . content && ( obj . title || obj . author ) ) || obj . pages ) return NounType . Document
if ( obj . startTime || obj . endTime || obj . date || obj . attendees ) return NounType . Event
if ( obj . price || obj . sku || obj . productId ) return NounType . Product
if ( ( obj . status && obj . assignee ) || obj . priority ) return NounType . Task
if ( Array . isArray ( obj . data ) || obj . rows || obj . columns ) return NounType . Dataset
return NounType . Thing
2025-08-26 12:32:21 -07:00
}
/ * *
* Detect relationships from object references
* /
feat: Universal Import with intelligent type matching (v2.1.0)
✨ ONE universal import method for everything
- Auto-detects files, URLs, and raw data
- Intelligent noun/verb type matching using embeddings
- Support for JSON, CSV, YAML, and text formats
- Zero configuration required
🧠 Intelligent Type Matching
- Uses semantic embeddings to match 31 noun types
- Automatically detects 40 verb relationship types
- Confidence scores for type predictions
- Caching for improved performance
📦 Import Manager
- Centralized import logic with lazy loading
- Integrates NeuralImportAugmentation for AI processing
- Proper CSV parsing with quote handling
- Basic YAML support
🎯 Simplified API
- brain.import() - ONE method that handles everything
- Auto-detection of URLs and file paths
- Backwards compatible with existing code
- Clean, modern, delightful developer experience
📚 Documentation
- Comprehensive import guide in docs/guides/import-anything.md
- Examples for every format and use case
- Philosophy of simplicity and zero config
✅ Tests
- Full unit test coverage for import functionality
- Type matching tests for all 31 nouns and 40 verbs
- Tests for CSV, YAML, JSON, and text formats
BREAKING CHANGES: None - fully backward compatible
2025-08-27 12:11:05 -07:00
private async detectRelationships ( obj : any , sourceId : string , relationships : DetectedRelationship [ ] ) : Promise < void > {
2025-08-26 12:32:21 -07:00
// Look for reference patterns
for ( const [ key , value ] of Object . entries ( obj ) ) {
if ( key . endsWith ( 'Id' ) || key . endsWith ( '_id' ) || key === 'parentId' || key === 'userId' ) {
relationships . push ( {
sourceId ,
targetId : String ( value ) ,
feat: Universal Import with intelligent type matching (v2.1.0)
✨ ONE universal import method for everything
- Auto-detects files, URLs, and raw data
- Intelligent noun/verb type matching using embeddings
- Support for JSON, CSV, YAML, and text formats
- Zero configuration required
🧠 Intelligent Type Matching
- Uses semantic embeddings to match 31 noun types
- Automatically detects 40 verb relationship types
- Confidence scores for type predictions
- Caching for improved performance
📦 Import Manager
- Centralized import logic with lazy loading
- Integrates NeuralImportAugmentation for AI processing
- Proper CSV parsing with quote handling
- Basic YAML support
🎯 Simplified API
- brain.import() - ONE method that handles everything
- Auto-detection of URLs and file paths
- Backwards compatible with existing code
- Clean, modern, delightful developer experience
📚 Documentation
- Comprehensive import guide in docs/guides/import-anything.md
- Examples for every format and use case
- Philosophy of simplicity and zero config
✅ Tests
- Full unit test coverage for import functionality
- Type matching tests for all 31 nouns and 40 verbs
- Tests for CSV, YAML, JSON, and text formats
BREAKING CHANGES: None - fully backward compatible
2025-08-27 12:11:05 -07:00
verbType : await this . inferVerbType ( key , obj , { id : value } ) ,
2025-08-26 12:32:21 -07:00
confidence : 0.75 ,
weight : 1 ,
reasoning : ` Reference detected in field: ${ key } ` ,
context : key
} )
}
// Array of IDs
if ( Array . isArray ( value ) && value . length > 0 && typeof value [ 0 ] === 'string' ) {
if ( key . endsWith ( 'Ids' ) || key . endsWith ( '_ids' ) ) {
for ( const targetId of value ) {
relationships . push ( {
sourceId ,
targetId : String ( targetId ) ,
feat: Universal Import with intelligent type matching (v2.1.0)
✨ ONE universal import method for everything
- Auto-detects files, URLs, and raw data
- Intelligent noun/verb type matching using embeddings
- Support for JSON, CSV, YAML, and text formats
- Zero configuration required
🧠 Intelligent Type Matching
- Uses semantic embeddings to match 31 noun types
- Automatically detects 40 verb relationship types
- Confidence scores for type predictions
- Caching for improved performance
📦 Import Manager
- Centralized import logic with lazy loading
- Integrates NeuralImportAugmentation for AI processing
- Proper CSV parsing with quote handling
- Basic YAML support
🎯 Simplified API
- brain.import() - ONE method that handles everything
- Auto-detection of URLs and file paths
- Backwards compatible with existing code
- Clean, modern, delightful developer experience
📚 Documentation
- Comprehensive import guide in docs/guides/import-anything.md
- Examples for every format and use case
- Philosophy of simplicity and zero config
✅ Tests
- Full unit test coverage for import functionality
- Type matching tests for all 31 nouns and 40 verbs
- Tests for CSV, YAML, JSON, and text formats
BREAKING CHANGES: None - fully backward compatible
2025-08-27 12:11:05 -07:00
verbType : await this . inferVerbType ( key , obj , { id : targetId } ) ,
2025-08-26 12:32:21 -07:00
confidence : 0.7 ,
weight : 1 ,
reasoning : ` Array reference in field: ${ key } ` ,
context : key
} )
}
}
}
}
}
/ * *
refactor: remove augmentation system and semantic type matching
Remove the entire augmentation pipeline infrastructure (52 files,
~15,000 lines) and the semantic type matching system. These were
unused middleware layers adding complexity without value.
What was removed:
- src/augmentations/ directory (all augmentation implementations)
- src/augmentationManager.ts (pipeline orchestrator)
- src/types/augmentations.ts, src/types/pipelineTypes.ts
- src/shared/default-augmentations.ts
- Semantic type suggestion (BrainyTypes.suggestNoun/suggestVerb)
- src/utils/typeMatching/ (embedding-based type matcher)
What was preserved by relocating:
- Import handlers (CSV, PDF, Excel) -> src/importers/handlers/
- NeuralImportAugmentation -> src/cortex/neuralImportAugmentation.ts
- Type matching utilities -> heuristic inference in consumers
What was simplified:
- brainy.ts: operations call storage directly (no execute() wrapper)
- IntegrationBase: standalone class (no BaseAugmentation parent)
- BrainyTypes: validation-only (nouns, verbs, isValid*, get*)
- Pipeline: direct execution (no augmentation interception)
- index.ts: removed TypeSuggestion, suggestType exports
- package.json: removed stale types/augmentations export
Build passes, 1176 tests pass, 0 failures.
2026-02-01 10:48:56 -08:00
* Infer verb type from field name using common patterns
2025-08-26 12:32:21 -07:00
* /
refactor: remove augmentation system and semantic type matching
Remove the entire augmentation pipeline infrastructure (52 files,
~15,000 lines) and the semantic type matching system. These were
unused middleware layers adding complexity without value.
What was removed:
- src/augmentations/ directory (all augmentation implementations)
- src/augmentationManager.ts (pipeline orchestrator)
- src/types/augmentations.ts, src/types/pipelineTypes.ts
- src/shared/default-augmentations.ts
- Semantic type suggestion (BrainyTypes.suggestNoun/suggestVerb)
- src/utils/typeMatching/ (embedding-based type matcher)
What was preserved by relocating:
- Import handlers (CSV, PDF, Excel) -> src/importers/handlers/
- NeuralImportAugmentation -> src/cortex/neuralImportAugmentation.ts
- Type matching utilities -> heuristic inference in consumers
What was simplified:
- brainy.ts: operations call storage directly (no execute() wrapper)
- IntegrationBase: standalone class (no BaseAugmentation parent)
- BrainyTypes: validation-only (nouns, verbs, isValid*, get*)
- Pipeline: direct execution (no augmentation interception)
- index.ts: removed TypeSuggestion, suggestType exports
- package.json: removed stale types/augmentations export
Build passes, 1176 tests pass, 0 failures.
2026-02-01 10:48:56 -08:00
private async inferVerbType ( fieldName : string , _sourceObj? : any , _targetObj? : any ) : Promise < string > {
const field = fieldName . toLowerCase ( )
if ( field . includes ( 'parent' ) || field . includes ( 'child' ) || field . includes ( 'contain' ) ) {
return VerbType . Contains
feat: Universal Import with intelligent type matching (v2.1.0)
✨ ONE universal import method for everything
- Auto-detects files, URLs, and raw data
- Intelligent noun/verb type matching using embeddings
- Support for JSON, CSV, YAML, and text formats
- Zero configuration required
🧠 Intelligent Type Matching
- Uses semantic embeddings to match 31 noun types
- Automatically detects 40 verb relationship types
- Confidence scores for type predictions
- Caching for improved performance
📦 Import Manager
- Centralized import logic with lazy loading
- Integrates NeuralImportAugmentation for AI processing
- Proper CSV parsing with quote handling
- Basic YAML support
🎯 Simplified API
- brain.import() - ONE method that handles everything
- Auto-detection of URLs and file paths
- Backwards compatible with existing code
- Clean, modern, delightful developer experience
📚 Documentation
- Comprehensive import guide in docs/guides/import-anything.md
- Examples for every format and use case
- Philosophy of simplicity and zero config
✅ Tests
- Full unit test coverage for import functionality
- Type matching tests for all 31 nouns and 40 verbs
- Tests for CSV, YAML, JSON, and text formats
BREAKING CHANGES: None - fully backward compatible
2025-08-27 12:11:05 -07:00
}
refactor: remove augmentation system and semantic type matching
Remove the entire augmentation pipeline infrastructure (52 files,
~15,000 lines) and the semantic type matching system. These were
unused middleware layers adding complexity without value.
What was removed:
- src/augmentations/ directory (all augmentation implementations)
- src/augmentationManager.ts (pipeline orchestrator)
- src/types/augmentations.ts, src/types/pipelineTypes.ts
- src/shared/default-augmentations.ts
- Semantic type suggestion (BrainyTypes.suggestNoun/suggestVerb)
- src/utils/typeMatching/ (embedding-based type matcher)
What was preserved by relocating:
- Import handlers (CSV, PDF, Excel) -> src/importers/handlers/
- NeuralImportAugmentation -> src/cortex/neuralImportAugmentation.ts
- Type matching utilities -> heuristic inference in consumers
What was simplified:
- brainy.ts: operations call storage directly (no execute() wrapper)
- IntegrationBase: standalone class (no BaseAugmentation parent)
- BrainyTypes: validation-only (nouns, verbs, isValid*, get*)
- Pipeline: direct execution (no augmentation interception)
- index.ts: removed TypeSuggestion, suggestType exports
- package.json: removed stale types/augmentations export
Build passes, 1176 tests pass, 0 failures.
2026-02-01 10:48:56 -08:00
if ( field . includes ( 'owner' ) || field . includes ( 'created' ) || field . includes ( 'author' ) ) {
return VerbType . Creates
feat: Universal Import with intelligent type matching (v2.1.0)
✨ ONE universal import method for everything
- Auto-detects files, URLs, and raw data
- Intelligent noun/verb type matching using embeddings
- Support for JSON, CSV, YAML, and text formats
- Zero configuration required
🧠 Intelligent Type Matching
- Uses semantic embeddings to match 31 noun types
- Automatically detects 40 verb relationship types
- Confidence scores for type predictions
- Caching for improved performance
📦 Import Manager
- Centralized import logic with lazy loading
- Integrates NeuralImportAugmentation for AI processing
- Proper CSV parsing with quote handling
- Basic YAML support
🎯 Simplified API
- brain.import() - ONE method that handles everything
- Auto-detection of URLs and file paths
- Backwards compatible with existing code
- Clean, modern, delightful developer experience
📚 Documentation
- Comprehensive import guide in docs/guides/import-anything.md
- Examples for every format and use case
- Philosophy of simplicity and zero config
✅ Tests
- Full unit test coverage for import functionality
- Type matching tests for all 31 nouns and 40 verbs
- Tests for CSV, YAML, JSON, and text formats
BREAKING CHANGES: None - fully backward compatible
2025-08-27 12:11:05 -07:00
}
refactor: remove augmentation system and semantic type matching
Remove the entire augmentation pipeline infrastructure (52 files,
~15,000 lines) and the semantic type matching system. These were
unused middleware layers adding complexity without value.
What was removed:
- src/augmentations/ directory (all augmentation implementations)
- src/augmentationManager.ts (pipeline orchestrator)
- src/types/augmentations.ts, src/types/pipelineTypes.ts
- src/shared/default-augmentations.ts
- Semantic type suggestion (BrainyTypes.suggestNoun/suggestVerb)
- src/utils/typeMatching/ (embedding-based type matcher)
What was preserved by relocating:
- Import handlers (CSV, PDF, Excel) -> src/importers/handlers/
- NeuralImportAugmentation -> src/cortex/neuralImportAugmentation.ts
- Type matching utilities -> heuristic inference in consumers
What was simplified:
- brainy.ts: operations call storage directly (no execute() wrapper)
- IntegrationBase: standalone class (no BaseAugmentation parent)
- BrainyTypes: validation-only (nouns, verbs, isValid*, get*)
- Pipeline: direct execution (no augmentation interception)
- index.ts: removed TypeSuggestion, suggestType exports
- package.json: removed stale types/augmentations export
Build passes, 1176 tests pass, 0 failures.
2026-02-01 10:48:56 -08:00
if ( field . includes ( 'member' ) || field . includes ( 'belong' ) ) {
return VerbType . MemberOf
}
if ( field . includes ( 'depend' ) || field . includes ( 'require' ) ) {
return VerbType . DependsOn
}
if ( field . includes ( 'ref' ) || field . includes ( 'link' ) || field . includes ( 'source' ) ) {
return VerbType . References
}
return VerbType . RelatedTo
2025-08-26 12:32:21 -07:00
}
/ * *
* Group entities by type
* /
private groupByType ( entities : DetectedEntity [ ] ) : Record < string , DetectedEntity [ ] > {
const groups : Record < string , DetectedEntity [ ] > = { }
for ( const entity of entities ) {
if ( ! groups [ entity . nounType ] ) {
groups [ entity . nounType ] = [ ]
}
groups [ entity . nounType ] . push ( entity )
}
return groups
}
/ * *
* Store neural analysis results
* /
private async storeNeuralAnalysis ( analysis : NeuralAnalysisResult ) : Promise < void > {
// Cache the analysis for potential later use
const key = ` analysis_ ${ Date . now ( ) } `
this . analysisCache . set ( key , analysis )
// Limit cache size
if ( this . analysisCache . size > 100 ) {
const firstKey = this . analysisCache . keys ( ) . next ( ) . value
if ( firstKey ) {
this . analysisCache . delete ( firstKey )
}
}
}
/ * *
* Helper to get data type from file path
* /
private getDataTypeFromPath ( filePath : string ) : string {
const ext = path . extname ( filePath ) . toLowerCase ( )
switch ( ext ) {
case '.json' : return 'json'
case '.csv' : return 'csv'
case '.txt' : return 'text'
case '.yaml' :
case '.yml' : return 'yaml'
default : return 'text'
}
}
/ * *
* PUBLIC API : Process raw data ( for external use , like Synapses )
* This maintains compatibility with code that wants to use Neural Import directly
* /
async processRawData (
rawData : Buffer | string ,
dataType : string ,
options? : Record < string , unknown >
) : Promise < {
success : boolean
data : {
nouns : string [ ]
verbs : string [ ]
confidence? : number
insights? : Array < {
type : string
description : string
confidence : number
} >
metadata? : Record < string , unknown >
}
error? : string
} > {
try {
const analysis = await this . getNeuralAnalysis ( rawData , dataType )
// Convert to legacy format for compatibility
const nouns = analysis . detectedEntities . map ( e = > e . suggestedId )
const verbs = analysis . detectedRelationships . map ( r = >
` ${ r . sourceId } -> ${ r . verbType } -> ${ r . targetId } `
)
return {
success : true ,
data : {
nouns ,
verbs ,
confidence : analysis.confidence ,
insights : analysis.insights.map ( i = > ( {
type : i . type ,
description : i.description ,
confidence : i.confidence
} ) ) ,
metadata : {
detectedEntities : analysis.detectedEntities.length ,
detectedRelationships : analysis.detectedRelationships.length ,
timestamp : new Date ( ) . toISOString ( )
}
}
}
} catch ( error ) {
return {
success : false ,
data : { nouns : [ ] , verbs : [ ] } ,
error : error instanceof Error ? error . message : 'Neural analysis failed'
}
}
}
}