2025-06-24 11:41:30 -07:00
|
|
|
|
/**
|
feat: Simplify architecture with Cortex orchestrator and clear augmentation tiers
## Major Architecture Improvements
### Cortex Refactoring
- Renamed AugmentationPipeline → Cortex for clarity
- Cortex is now the central orchestrator (not an augmentation)
- NeuralImport remains as the AI-powered SENSE augmentation
- Clean brain metaphor: BrainyData → Cortex → Augmentations
### Four-Tier Augmentation System
1. **Built-in** (Free, MIT): Neural Import, basic storage, search
2. **Community** (Free, npm): Community-created augmentations
3. **Premium** ($49-299/mo): AI Memory, Agent Coordinator, Enterprise connectors
4. **Brain Cloud** ($19-99/mo): Managed service with all features
### Zero Configuration Philosophy
- Everything works out of the box - no config needed
- Automatic model detection and loading
- Seamless integration between tiers
- Brain Cloud connects with one command: `brainy cloud`
### Documentation Updates
- Added PHILOSOPHY.md outlining design principles
- Created AUGMENTATION_ARCHITECTURE.md with tier system
- Added CLI_AUGMENTATION_GUIDE.md for augmentation management
- Updated README to "sell first" with concrete use cases
- Improved documentation organization in /docs
### Developer Experience
- Backward compatibility maintained with exports
- Clean, simple API surface
- Interactive-by-default approach
- Premium features integrate seamlessly
### Removed
- Deleted demo directory and deploy workflow (moved to website)
- Removed test wrapper scripts (bash 2>&1 bug workaround)
This refactor makes Brainy incredibly powerful yet easy to use, with everything automated and no configuration required. The Brain Cloud augmentations (AI memory, sync, coordination) integrate seamlessly as our killer features.
2025-08-11 09:40:37 -07:00
|
|
|
|
* Brainy - Your AI-Powered Second Brain
|
|
|
|
|
|
* 🧠⚛️ A multi-dimensional database with vector, graph, and facet storage
|
|
|
|
|
|
*
|
|
|
|
|
|
* Core Components:
|
|
|
|
|
|
* - BrainyData: The brain (core database)
|
|
|
|
|
|
* - Cortex: The orchestrator (manages augmentations)
|
|
|
|
|
|
* - NeuralImport: AI-powered data understanding
|
|
|
|
|
|
* - Augmentations: Brain capabilities (plugins)
|
2025-06-24 11:41:30 -07:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
// Export main BrainyData class and related types
|
2025-07-30 13:18:15 -07:00
|
|
|
|
import { BrainyData, BrainyDataConfig } from './brainyData.js'
|
2025-06-24 11:41:30 -07:00
|
|
|
|
|
2025-07-30 13:18:15 -07:00
|
|
|
|
export { BrainyData }
|
|
|
|
|
|
export type { BrainyDataConfig }
|
2025-06-24 11:41:30 -07:00
|
|
|
|
|
feat: Simplify architecture with Cortex orchestrator and clear augmentation tiers
## Major Architecture Improvements
### Cortex Refactoring
- Renamed AugmentationPipeline → Cortex for clarity
- Cortex is now the central orchestrator (not an augmentation)
- NeuralImport remains as the AI-powered SENSE augmentation
- Clean brain metaphor: BrainyData → Cortex → Augmentations
### Four-Tier Augmentation System
1. **Built-in** (Free, MIT): Neural Import, basic storage, search
2. **Community** (Free, npm): Community-created augmentations
3. **Premium** ($49-299/mo): AI Memory, Agent Coordinator, Enterprise connectors
4. **Brain Cloud** ($19-99/mo): Managed service with all features
### Zero Configuration Philosophy
- Everything works out of the box - no config needed
- Automatic model detection and loading
- Seamless integration between tiers
- Brain Cloud connects with one command: `brainy cloud`
### Documentation Updates
- Added PHILOSOPHY.md outlining design principles
- Created AUGMENTATION_ARCHITECTURE.md with tier system
- Added CLI_AUGMENTATION_GUIDE.md for augmentation management
- Updated README to "sell first" with concrete use cases
- Improved documentation organization in /docs
### Developer Experience
- Backward compatibility maintained with exports
- Clean, simple API surface
- Interactive-by-default approach
- Premium features integrate seamlessly
### Removed
- Deleted demo directory and deploy workflow (moved to website)
- Removed test wrapper scripts (bash 2>&1 bug workaround)
This refactor makes Brainy incredibly powerful yet easy to use, with everything automated and no configuration required. The Brain Cloud augmentations (AI memory, sync, coordination) integrate seamlessly as our killer features.
2025-08-11 09:40:37 -07:00
|
|
|
|
// Export Cortex (the orchestrator)
|
|
|
|
|
|
export {
|
|
|
|
|
|
Cortex,
|
|
|
|
|
|
cortex
|
|
|
|
|
|
} from './cortex.js'
|
|
|
|
|
|
|
|
|
|
|
|
// Export Neural Import (AI data understanding)
|
|
|
|
|
|
export { NeuralImport } from './cortex/neuralImport.js'
|
|
|
|
|
|
export type {
|
|
|
|
|
|
NeuralAnalysisResult,
|
|
|
|
|
|
DetectedEntity,
|
|
|
|
|
|
DetectedRelationship,
|
|
|
|
|
|
NeuralInsight,
|
|
|
|
|
|
NeuralImportOptions
|
|
|
|
|
|
} from './cortex/neuralImport.js'
|
|
|
|
|
|
|
|
|
|
|
|
// Augmentation types are already exported later in the file
|
|
|
|
|
|
|
2025-06-24 11:41:30 -07:00
|
|
|
|
// Export distance functions for convenience
|
|
|
|
|
|
import {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
euclideanDistance,
|
|
|
|
|
|
cosineDistance,
|
|
|
|
|
|
manhattanDistance,
|
|
|
|
|
|
dotProductDistance,
|
|
|
|
|
|
getStatistics
|
2025-06-24 11:41:30 -07:00
|
|
|
|
} from './utils/index.js'
|
|
|
|
|
|
|
|
|
|
|
|
export {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
euclideanDistance,
|
|
|
|
|
|
cosineDistance,
|
|
|
|
|
|
manhattanDistance,
|
|
|
|
|
|
dotProductDistance,
|
|
|
|
|
|
getStatistics
|
2025-06-24 11:41:30 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Export embedding functionality
|
|
|
|
|
|
import {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
UniversalSentenceEncoder,
|
2025-08-05 19:29:59 -07:00
|
|
|
|
TransformerEmbedding,
|
2025-07-30 13:18:15 -07:00
|
|
|
|
createEmbeddingFunction,
|
2025-08-05 19:29:59 -07:00
|
|
|
|
defaultEmbeddingFunction,
|
|
|
|
|
|
batchEmbed,
|
|
|
|
|
|
embeddingFunctions
|
2025-06-24 11:41:30 -07:00
|
|
|
|
} from './utils/embedding.js'
|
|
|
|
|
|
|
2025-07-01 10:39:12 -07:00
|
|
|
|
// Export worker utilities
|
2025-07-30 13:18:15 -07:00
|
|
|
|
import { executeInThread, cleanupWorkerPools } from './utils/workerUtils.js'
|
2025-07-01 10:39:12 -07:00
|
|
|
|
|
2025-08-05 07:22:05 -07:00
|
|
|
|
// Export logging utilities
|
|
|
|
|
|
import {
|
|
|
|
|
|
logger,
|
|
|
|
|
|
LogLevel,
|
|
|
|
|
|
configureLogger,
|
|
|
|
|
|
createModuleLogger
|
|
|
|
|
|
} from './utils/logger.js'
|
|
|
|
|
|
|
2025-08-07 19:33:03 -07:00
|
|
|
|
// Export BrainyChat for conversational AI
|
2025-08-12 11:49:38 -07:00
|
|
|
|
import { BrainyChat } from './chat/BrainyChat.js'
|
2025-08-07 19:33:03 -07:00
|
|
|
|
export { BrainyChat }
|
|
|
|
|
|
|
2025-08-08 15:22:38 -07:00
|
|
|
|
// Export Cortex CLI functionality - commented out for core MIT build
|
|
|
|
|
|
// export { Cortex } from './cortex/cortex.js'
|
2025-08-07 19:33:03 -07:00
|
|
|
|
|
2025-08-07 08:37:15 -07:00
|
|
|
|
// Export performance and optimization utilities
|
|
|
|
|
|
import {
|
|
|
|
|
|
getGlobalSocketManager,
|
|
|
|
|
|
AdaptiveSocketManager
|
|
|
|
|
|
} from './utils/adaptiveSocketManager.js'
|
|
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
|
getGlobalBackpressure,
|
|
|
|
|
|
AdaptiveBackpressure
|
|
|
|
|
|
} from './utils/adaptiveBackpressure.js'
|
|
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
|
getGlobalPerformanceMonitor,
|
|
|
|
|
|
PerformanceMonitor
|
|
|
|
|
|
} from './utils/performanceMonitor.js'
|
|
|
|
|
|
|
2025-07-04 14:42:33 -07:00
|
|
|
|
// Export environment utilities
|
|
|
|
|
|
import {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
isBrowser,
|
|
|
|
|
|
isNode,
|
|
|
|
|
|
isWebWorker,
|
|
|
|
|
|
areWebWorkersAvailable,
|
|
|
|
|
|
areWorkerThreadsAvailable,
|
|
|
|
|
|
areWorkerThreadsAvailableSync,
|
|
|
|
|
|
isThreadingAvailable,
|
|
|
|
|
|
isThreadingAvailableAsync
|
2025-07-04 14:42:33 -07:00
|
|
|
|
} from './utils/environment.js'
|
|
|
|
|
|
|
2025-06-24 11:41:30 -07:00
|
|
|
|
export {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
UniversalSentenceEncoder,
|
2025-08-05 19:29:59 -07:00
|
|
|
|
TransformerEmbedding,
|
2025-07-30 13:18:15 -07:00
|
|
|
|
createEmbeddingFunction,
|
|
|
|
|
|
defaultEmbeddingFunction,
|
2025-08-05 19:29:59 -07:00
|
|
|
|
batchEmbed,
|
|
|
|
|
|
embeddingFunctions,
|
2025-07-30 13:18:15 -07:00
|
|
|
|
|
|
|
|
|
|
// Worker utilities
|
|
|
|
|
|
executeInThread,
|
|
|
|
|
|
cleanupWorkerPools,
|
|
|
|
|
|
|
|
|
|
|
|
// Environment utilities
|
|
|
|
|
|
isBrowser,
|
|
|
|
|
|
isNode,
|
|
|
|
|
|
isWebWorker,
|
|
|
|
|
|
areWebWorkersAvailable,
|
|
|
|
|
|
areWorkerThreadsAvailable,
|
|
|
|
|
|
areWorkerThreadsAvailableSync,
|
|
|
|
|
|
isThreadingAvailable,
|
2025-08-05 07:22:05 -07:00
|
|
|
|
isThreadingAvailableAsync,
|
|
|
|
|
|
|
|
|
|
|
|
// Logging utilities
|
|
|
|
|
|
logger,
|
|
|
|
|
|
LogLevel,
|
|
|
|
|
|
configureLogger,
|
2025-08-07 08:37:15 -07:00
|
|
|
|
createModuleLogger,
|
|
|
|
|
|
|
|
|
|
|
|
// Performance and optimization utilities
|
|
|
|
|
|
getGlobalSocketManager,
|
|
|
|
|
|
AdaptiveSocketManager,
|
|
|
|
|
|
getGlobalBackpressure,
|
|
|
|
|
|
AdaptiveBackpressure,
|
|
|
|
|
|
getGlobalPerformanceMonitor,
|
|
|
|
|
|
PerformanceMonitor
|
2025-06-24 11:41:30 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Export storage adapters
|
|
|
|
|
|
import {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
OPFSStorage,
|
|
|
|
|
|
MemoryStorage,
|
|
|
|
|
|
R2Storage,
|
|
|
|
|
|
S3CompatibleStorage,
|
|
|
|
|
|
createStorage
|
2025-07-21 12:48:03 -07:00
|
|
|
|
} from './storage/storageFactory.js'
|
2025-06-24 11:41:30 -07:00
|
|
|
|
|
|
|
|
|
|
export {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
OPFSStorage,
|
|
|
|
|
|
MemoryStorage,
|
|
|
|
|
|
R2Storage,
|
|
|
|
|
|
S3CompatibleStorage,
|
|
|
|
|
|
createStorage
|
2025-06-24 11:41:30 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-05 16:09:30 -07:00
|
|
|
|
// FileSystemStorage is exported separately to avoid browser build issues
|
|
|
|
|
|
export { FileSystemStorage } from './storage/adapters/fileSystemStorage.js'
|
|
|
|
|
|
|
2025-06-24 11:41:30 -07:00
|
|
|
|
// Export unified pipeline
|
|
|
|
|
|
import {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
Pipeline,
|
|
|
|
|
|
pipeline,
|
|
|
|
|
|
augmentationPipeline,
|
|
|
|
|
|
ExecutionMode,
|
|
|
|
|
|
PipelineOptions,
|
|
|
|
|
|
PipelineResult,
|
|
|
|
|
|
createPipeline,
|
|
|
|
|
|
createStreamingPipeline,
|
|
|
|
|
|
StreamlinedExecutionMode,
|
|
|
|
|
|
StreamlinedPipelineOptions,
|
|
|
|
|
|
StreamlinedPipelineResult
|
2025-06-24 11:41:30 -07:00
|
|
|
|
} from './pipeline.js'
|
|
|
|
|
|
|
🚀 Brainy 1.0.0-rc.1 - Complete Unified API Implementation (#5)
* feat: Complete Brainy 1.0 Great Cleanup
🎯 THE GREAT CLEANUP - Making Brainy Beautiful
BREAKING CHANGES:
- Removed addSmart() method (use add() - it's smart by default)
- Removed duplicate Pipeline classes (consolidated into ONE Cortex)
- Removed 40+ CLI commands (now just 5 clean commands)
✅ WHAT'S DONE:
- Delete duplicate files: sequentialPipeline.ts, cortex-legacy.ts, serviceIntegration.ts
- Consolidated into ONE Cortex class (the orchestrator)
- Pipeline class now delegates to Cortex (backward compatibility)
- Clean CLI: add, import, search, status, help (ONE way to do everything)
- Interactive mode for beginners
📈 RESULTS:
- 5 CLI commands (was 40+)
- 1 Pipeline system (was 3+)
- Clean, obvious naming
- Beautiful user experience
This achieves the vision: ONE way to do everything, elegant and powerful.
* fix: Restore essential CLI commands and remove backward compatibility
✅ IMPROVEMENTS:
- Remove Pipeline delegation complexity - Pipeline IS Cortex now
- Restore essential commands: config, cloud, migrate
- Keep core clean: add, import, search, status, help
- Interactive help updated with all options
🎯 FINAL CLI (8 commands):
- Core: add, import, search, status, help
- Essential: config, cloud, migrate
✅ NO FUNCTIONALITY LOST:
- Zero-config and dynamic adaptations intact
- All storage adapters working
- Premium Brain Cloud integration restored
- Migration tools available
Result: Perfect balance of simplicity and functionality
* feat: Enhance status command with comprehensive statistics display
✨ ENHANCED STATUS COMMAND:
- Full integration with brainyData.getStatistics()
- Beautiful, organized display of all statistics
- Three modes: default (comprehensive), --simple (quick), --verbose (raw JSON)
📊 STATISTICS DISPLAYED:
- Core Database: items, nouns, verbs, documents
- Storage Information: type, size, location
- Performance Metrics: query times, cache hit rates
- Vector Index: dimensions, vector count, index size
- Memory Usage: heap, RSS breakdown
- Active Augmentations: with descriptions
- Configuration: with sensitive data hidden
- Raw JSON option for developers
🎯 USAGE:
- brainy status (comprehensive view)
- brainy status --simple (quick overview)
- brainy status --verbose (everything + raw JSON)
Perfect for monitoring brain health and performance!
* feat: Add per-service statistics and field discovery to CLI
🎯 ENHANCED STATISTICS DISPLAY:
- Show per-service breakdown of nouns, verbs, metadata
- Display serviceBreakdown from getStatistics() properly
- Beautiful formatting for multi-service environments
🔍 FIELD DISCOVERY FOR ADVANCED SEARCH:
- New section in 'brainy status' shows available filter fields
- Added --fields option to search command
- Usage examples provided for complex filtering
- Integrates with getFilterFields() method
📊 USAGE EXAMPLES:
- brainy status (shows per-service stats + available fields)
- brainy search 'query' --fields (field discovery)
- brainy search 'query' --filter '{"type":"person"}' (advanced filtering)
Perfect for developers doing complex queries and multi-service deployments!
* feat: Restore and enhance brainy chat with multi-model AI support
🎯 RESTORED CHAT FUNCTIONALITY:
- Complete brainy chat command with rich options
- Interactive mode with session management
- Chat history search and session switching
- Auto-discovery of previous sessions
🤖 MULTI-MODEL AI INTEGRATION:
- Local models: Ollama/LLaMA (default)
- OpenAI: GPT-3.5/GPT-4 support
- Claude: Anthropic integration
- Custom models: configurable base URLs
💬 RICH CHAT FEATURES:
- Session management: list, switch, resume
- History: view previous conversations
- Search: find messages across all sessions
- Context-aware: uses your brain data for responses
🔧 USAGE EXAMPLES:
- brainy chat (interactive mode)
- brainy chat 'question' (single message)
- brainy chat --list (show sessions)
- brainy chat --model openai --api-key sk-... (OpenAI)
- brainy chat --model claude --api-key sk-ant-... (Claude)
Perfect for talking to your data with any AI model!
* feat: Complete Brainy 1.0.0-rc.1 unified API implementation
- Implement 7 core unified API methods (add, search, import, addNoun, addVerb, update, delete)
- Add universal encryption system with encryptData/decryptData methods
- Add container deployment support with model preloading
- Implement soft delete by default for better performance
- Add searchVerbs() and getNounWithVerbs() for graph traversal
- Reduce package size by 16% despite major feature additions
- Create comprehensive CHANGELOG.md and MIGRATION.md
- Consolidate CLI from 40+ to 9 clean commands
- All scaling optimizations preserved and enhanced
BREAKING CHANGES:
- addSmart() method removed (use add() - smart by default)
- CLI commands consolidated and renamed
- Pipeline classes unified into single Cortex class
This is the complete 1.0 release candidate with all planned features implemented and tested.
2025-08-14 11:27:22 -07:00
|
|
|
|
// Sequential pipeline removed - use unified pipeline instead
|
2025-06-24 11:41:30 -07:00
|
|
|
|
|
|
|
|
|
|
// Export augmentation factory
|
|
|
|
|
|
import {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
createSenseAugmentation,
|
|
|
|
|
|
addWebSocketSupport,
|
|
|
|
|
|
executeAugmentation,
|
|
|
|
|
|
loadAugmentationModule,
|
|
|
|
|
|
AugmentationOptions
|
2025-06-24 11:41:30 -07:00
|
|
|
|
} from './augmentationFactory.js'
|
|
|
|
|
|
|
|
|
|
|
|
export {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
// Unified pipeline exports
|
|
|
|
|
|
Pipeline,
|
|
|
|
|
|
pipeline,
|
|
|
|
|
|
augmentationPipeline,
|
|
|
|
|
|
ExecutionMode,
|
🚀 Brainy 1.0.0-rc.1 - Complete Unified API Implementation (#5)
* feat: Complete Brainy 1.0 Great Cleanup
🎯 THE GREAT CLEANUP - Making Brainy Beautiful
BREAKING CHANGES:
- Removed addSmart() method (use add() - it's smart by default)
- Removed duplicate Pipeline classes (consolidated into ONE Cortex)
- Removed 40+ CLI commands (now just 5 clean commands)
✅ WHAT'S DONE:
- Delete duplicate files: sequentialPipeline.ts, cortex-legacy.ts, serviceIntegration.ts
- Consolidated into ONE Cortex class (the orchestrator)
- Pipeline class now delegates to Cortex (backward compatibility)
- Clean CLI: add, import, search, status, help (ONE way to do everything)
- Interactive mode for beginners
📈 RESULTS:
- 5 CLI commands (was 40+)
- 1 Pipeline system (was 3+)
- Clean, obvious naming
- Beautiful user experience
This achieves the vision: ONE way to do everything, elegant and powerful.
* fix: Restore essential CLI commands and remove backward compatibility
✅ IMPROVEMENTS:
- Remove Pipeline delegation complexity - Pipeline IS Cortex now
- Restore essential commands: config, cloud, migrate
- Keep core clean: add, import, search, status, help
- Interactive help updated with all options
🎯 FINAL CLI (8 commands):
- Core: add, import, search, status, help
- Essential: config, cloud, migrate
✅ NO FUNCTIONALITY LOST:
- Zero-config and dynamic adaptations intact
- All storage adapters working
- Premium Brain Cloud integration restored
- Migration tools available
Result: Perfect balance of simplicity and functionality
* feat: Enhance status command with comprehensive statistics display
✨ ENHANCED STATUS COMMAND:
- Full integration with brainyData.getStatistics()
- Beautiful, organized display of all statistics
- Three modes: default (comprehensive), --simple (quick), --verbose (raw JSON)
📊 STATISTICS DISPLAYED:
- Core Database: items, nouns, verbs, documents
- Storage Information: type, size, location
- Performance Metrics: query times, cache hit rates
- Vector Index: dimensions, vector count, index size
- Memory Usage: heap, RSS breakdown
- Active Augmentations: with descriptions
- Configuration: with sensitive data hidden
- Raw JSON option for developers
🎯 USAGE:
- brainy status (comprehensive view)
- brainy status --simple (quick overview)
- brainy status --verbose (everything + raw JSON)
Perfect for monitoring brain health and performance!
* feat: Add per-service statistics and field discovery to CLI
🎯 ENHANCED STATISTICS DISPLAY:
- Show per-service breakdown of nouns, verbs, metadata
- Display serviceBreakdown from getStatistics() properly
- Beautiful formatting for multi-service environments
🔍 FIELD DISCOVERY FOR ADVANCED SEARCH:
- New section in 'brainy status' shows available filter fields
- Added --fields option to search command
- Usage examples provided for complex filtering
- Integrates with getFilterFields() method
📊 USAGE EXAMPLES:
- brainy status (shows per-service stats + available fields)
- brainy search 'query' --fields (field discovery)
- brainy search 'query' --filter '{"type":"person"}' (advanced filtering)
Perfect for developers doing complex queries and multi-service deployments!
* feat: Restore and enhance brainy chat with multi-model AI support
🎯 RESTORED CHAT FUNCTIONALITY:
- Complete brainy chat command with rich options
- Interactive mode with session management
- Chat history search and session switching
- Auto-discovery of previous sessions
🤖 MULTI-MODEL AI INTEGRATION:
- Local models: Ollama/LLaMA (default)
- OpenAI: GPT-3.5/GPT-4 support
- Claude: Anthropic integration
- Custom models: configurable base URLs
💬 RICH CHAT FEATURES:
- Session management: list, switch, resume
- History: view previous conversations
- Search: find messages across all sessions
- Context-aware: uses your brain data for responses
🔧 USAGE EXAMPLES:
- brainy chat (interactive mode)
- brainy chat 'question' (single message)
- brainy chat --list (show sessions)
- brainy chat --model openai --api-key sk-... (OpenAI)
- brainy chat --model claude --api-key sk-ant-... (Claude)
Perfect for talking to your data with any AI model!
* feat: Complete Brainy 1.0.0-rc.1 unified API implementation
- Implement 7 core unified API methods (add, search, import, addNoun, addVerb, update, delete)
- Add universal encryption system with encryptData/decryptData methods
- Add container deployment support with model preloading
- Implement soft delete by default for better performance
- Add searchVerbs() and getNounWithVerbs() for graph traversal
- Reduce package size by 16% despite major feature additions
- Create comprehensive CHANGELOG.md and MIGRATION.md
- Consolidate CLI from 40+ to 9 clean commands
- All scaling optimizations preserved and enhanced
BREAKING CHANGES:
- addSmart() method removed (use add() - smart by default)
- CLI commands consolidated and renamed
- Pipeline classes unified into single Cortex class
This is the complete 1.0 release candidate with all planned features implemented and tested.
2025-08-14 11:27:22 -07:00
|
|
|
|
|
|
|
|
|
|
// Factory functions
|
2025-07-30 13:18:15 -07:00
|
|
|
|
createPipeline,
|
|
|
|
|
|
createStreamingPipeline,
|
|
|
|
|
|
StreamlinedExecutionMode,
|
|
|
|
|
|
|
|
|
|
|
|
// Augmentation factory exports
|
|
|
|
|
|
createSenseAugmentation,
|
|
|
|
|
|
addWebSocketSupport,
|
|
|
|
|
|
executeAugmentation,
|
|
|
|
|
|
loadAugmentationModule
|
2025-06-24 11:41:30 -07:00
|
|
|
|
}
|
2025-06-26 10:56:14 -07:00
|
|
|
|
export type {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
PipelineOptions,
|
|
|
|
|
|
PipelineResult,
|
|
|
|
|
|
StreamlinedPipelineOptions,
|
|
|
|
|
|
StreamlinedPipelineResult,
|
|
|
|
|
|
AugmentationOptions
|
2025-06-24 11:41:30 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Export augmentation registry for build-time loading
|
|
|
|
|
|
import {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
availableAugmentations,
|
|
|
|
|
|
registerAugmentation,
|
|
|
|
|
|
initializeAugmentationPipeline,
|
|
|
|
|
|
setAugmentationEnabled,
|
|
|
|
|
|
getAugmentationsByType
|
2025-06-24 11:41:30 -07:00
|
|
|
|
} from './augmentationRegistry.js'
|
|
|
|
|
|
|
|
|
|
|
|
export {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
availableAugmentations,
|
|
|
|
|
|
registerAugmentation,
|
|
|
|
|
|
initializeAugmentationPipeline,
|
|
|
|
|
|
setAugmentationEnabled,
|
|
|
|
|
|
getAugmentationsByType
|
2025-06-24 11:41:30 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Export augmentation registry loader for build tools
|
|
|
|
|
|
import {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
loadAugmentationsFromModules,
|
|
|
|
|
|
createAugmentationRegistryPlugin,
|
|
|
|
|
|
createAugmentationRegistryRollupPlugin
|
2025-06-24 11:41:30 -07:00
|
|
|
|
} from './augmentationRegistryLoader.js'
|
|
|
|
|
|
import type {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
AugmentationRegistryLoaderOptions,
|
|
|
|
|
|
AugmentationLoadResult
|
2025-06-24 11:41:30 -07:00
|
|
|
|
} from './augmentationRegistryLoader.js'
|
|
|
|
|
|
|
|
|
|
|
|
export {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
loadAugmentationsFromModules,
|
|
|
|
|
|
createAugmentationRegistryPlugin,
|
|
|
|
|
|
createAugmentationRegistryRollupPlugin
|
2025-06-24 11:41:30 -07:00
|
|
|
|
}
|
2025-07-30 13:18:15 -07:00
|
|
|
|
export type { AugmentationRegistryLoaderOptions, AugmentationLoadResult }
|
2025-06-24 11:41:30 -07:00
|
|
|
|
|
2025-08-08 15:22:38 -07:00
|
|
|
|
|
2025-06-24 11:41:30 -07:00
|
|
|
|
// Export augmentation implementations
|
|
|
|
|
|
import {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
MemoryStorageAugmentation,
|
|
|
|
|
|
FileSystemStorageAugmentation,
|
|
|
|
|
|
OPFSStorageAugmentation,
|
|
|
|
|
|
createMemoryAugmentation
|
2025-06-24 11:41:30 -07:00
|
|
|
|
} from './augmentations/memoryAugmentations.js'
|
|
|
|
|
|
import {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
WebSocketConduitAugmentation,
|
|
|
|
|
|
WebRTCConduitAugmentation,
|
|
|
|
|
|
createConduitAugmentation
|
2025-06-24 11:41:30 -07:00
|
|
|
|
} from './augmentations/conduitAugmentations.js'
|
|
|
|
|
|
import {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
ServerSearchConduitAugmentation,
|
|
|
|
|
|
ServerSearchActivationAugmentation,
|
|
|
|
|
|
createServerSearchAugmentations
|
2025-06-24 11:41:30 -07:00
|
|
|
|
} from './augmentations/serverSearchAugmentations.js'
|
|
|
|
|
|
|
|
|
|
|
|
// Non-LLM exports
|
|
|
|
|
|
export {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
MemoryStorageAugmentation,
|
|
|
|
|
|
FileSystemStorageAugmentation,
|
|
|
|
|
|
OPFSStorageAugmentation,
|
|
|
|
|
|
createMemoryAugmentation,
|
|
|
|
|
|
WebSocketConduitAugmentation,
|
|
|
|
|
|
WebRTCConduitAugmentation,
|
|
|
|
|
|
createConduitAugmentation,
|
|
|
|
|
|
ServerSearchConduitAugmentation,
|
|
|
|
|
|
ServerSearchActivationAugmentation,
|
|
|
|
|
|
createServerSearchAugmentations
|
2025-06-24 11:41:30 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// LLM augmentations are optional and not imported by default
|
|
|
|
|
|
// They can be imported directly from their module if needed:
|
|
|
|
|
|
// import { LLMCognitionAugmentation, LLMActivationAugmentation, createLLMAugmentations } from './augmentations/llmAugmentations.js'
|
|
|
|
|
|
|
|
|
|
|
|
// Export types
|
|
|
|
|
|
import type {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
Vector,
|
|
|
|
|
|
VectorDocument,
|
|
|
|
|
|
SearchResult,
|
|
|
|
|
|
DistanceFunction,
|
|
|
|
|
|
EmbeddingFunction,
|
|
|
|
|
|
EmbeddingModel,
|
|
|
|
|
|
HNSWNoun,
|
2025-08-03 10:47:47 -07:00
|
|
|
|
HNSWVerb,
|
2025-07-30 13:18:15 -07:00
|
|
|
|
HNSWConfig,
|
|
|
|
|
|
StorageAdapter
|
2025-06-24 11:41:30 -07:00
|
|
|
|
} from './coreTypes.js'
|
|
|
|
|
|
|
|
|
|
|
|
// Export HNSW index and optimized version
|
2025-07-30 13:18:15 -07:00
|
|
|
|
import { HNSWIndex } from './hnsw/hnswIndex.js'
|
2025-06-26 10:56:14 -07:00
|
|
|
|
import {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
HNSWIndexOptimized,
|
|
|
|
|
|
HNSWOptimizedConfig
|
2025-06-26 10:56:14 -07:00
|
|
|
|
} from './hnsw/hnswIndexOptimized.js'
|
2025-06-24 11:41:30 -07:00
|
|
|
|
|
2025-07-30 13:18:15 -07:00
|
|
|
|
export { HNSWIndex, HNSWIndexOptimized }
|
2025-06-24 11:41:30 -07:00
|
|
|
|
|
|
|
|
|
|
export type {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
Vector,
|
|
|
|
|
|
VectorDocument,
|
|
|
|
|
|
SearchResult,
|
|
|
|
|
|
DistanceFunction,
|
|
|
|
|
|
EmbeddingFunction,
|
|
|
|
|
|
EmbeddingModel,
|
|
|
|
|
|
HNSWNoun,
|
2025-08-03 10:47:47 -07:00
|
|
|
|
HNSWVerb,
|
2025-07-30 13:18:15 -07:00
|
|
|
|
HNSWConfig,
|
|
|
|
|
|
HNSWOptimizedConfig,
|
|
|
|
|
|
StorageAdapter
|
2025-06-24 11:41:30 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Export augmentation types
|
|
|
|
|
|
import type {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
IAugmentation,
|
|
|
|
|
|
AugmentationResponse,
|
|
|
|
|
|
IWebSocketSupport,
|
|
|
|
|
|
ISenseAugmentation,
|
|
|
|
|
|
IConduitAugmentation,
|
|
|
|
|
|
ICognitionAugmentation,
|
|
|
|
|
|
IMemoryAugmentation,
|
|
|
|
|
|
IPerceptionAugmentation,
|
|
|
|
|
|
IDialogAugmentation,
|
|
|
|
|
|
IActivationAugmentation
|
2025-06-24 11:41:30 -07:00
|
|
|
|
} from './types/augmentations.js'
|
2025-07-30 13:18:15 -07:00
|
|
|
|
import { AugmentationType, BrainyAugmentations } from './types/augmentations.js'
|
2025-06-24 11:41:30 -07:00
|
|
|
|
|
2025-07-30 13:18:15 -07:00
|
|
|
|
export type { IAugmentation, AugmentationResponse, IWebSocketSupport }
|
2025-06-24 11:41:30 -07:00
|
|
|
|
export {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
AugmentationType,
|
|
|
|
|
|
BrainyAugmentations,
|
|
|
|
|
|
ISenseAugmentation,
|
|
|
|
|
|
IConduitAugmentation,
|
|
|
|
|
|
ICognitionAugmentation,
|
|
|
|
|
|
IMemoryAugmentation,
|
|
|
|
|
|
IPerceptionAugmentation,
|
|
|
|
|
|
IDialogAugmentation,
|
|
|
|
|
|
IActivationAugmentation
|
2025-06-24 11:41:30 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Export combined WebSocket augmentation interfaces
|
|
|
|
|
|
export type {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
IWebSocketCognitionAugmentation,
|
|
|
|
|
|
IWebSocketSenseAugmentation,
|
|
|
|
|
|
IWebSocketPerceptionAugmentation,
|
|
|
|
|
|
IWebSocketActivationAugmentation,
|
|
|
|
|
|
IWebSocketDialogAugmentation,
|
|
|
|
|
|
IWebSocketConduitAugmentation,
|
|
|
|
|
|
IWebSocketMemoryAugmentation
|
2025-06-24 11:41:30 -07:00
|
|
|
|
} from './types/augmentations.js'
|
|
|
|
|
|
|
|
|
|
|
|
// Export graph types
|
|
|
|
|
|
import type {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
GraphNoun,
|
|
|
|
|
|
GraphVerb,
|
|
|
|
|
|
EmbeddedGraphVerb,
|
|
|
|
|
|
Person,
|
|
|
|
|
|
Location,
|
|
|
|
|
|
Thing,
|
|
|
|
|
|
Event,
|
|
|
|
|
|
Concept,
|
|
|
|
|
|
Content,
|
|
|
|
|
|
Collection,
|
|
|
|
|
|
Organization,
|
|
|
|
|
|
Document,
|
|
|
|
|
|
Media,
|
|
|
|
|
|
File,
|
|
|
|
|
|
Message,
|
|
|
|
|
|
Dataset,
|
|
|
|
|
|
Product,
|
|
|
|
|
|
Service,
|
|
|
|
|
|
User,
|
|
|
|
|
|
Task,
|
|
|
|
|
|
Project,
|
|
|
|
|
|
Process,
|
|
|
|
|
|
State,
|
|
|
|
|
|
Role,
|
|
|
|
|
|
Topic,
|
|
|
|
|
|
Language,
|
|
|
|
|
|
Currency,
|
|
|
|
|
|
Measurement
|
2025-06-24 11:41:30 -07:00
|
|
|
|
} from './types/graphTypes.js'
|
2025-07-30 13:18:15 -07:00
|
|
|
|
import { NounType, VerbType } from './types/graphTypes.js'
|
2025-06-24 11:41:30 -07:00
|
|
|
|
|
|
|
|
|
|
export type {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
GraphNoun,
|
|
|
|
|
|
GraphVerb,
|
|
|
|
|
|
EmbeddedGraphVerb,
|
|
|
|
|
|
Person,
|
|
|
|
|
|
Location,
|
|
|
|
|
|
Thing,
|
|
|
|
|
|
Event,
|
|
|
|
|
|
Concept,
|
|
|
|
|
|
Content,
|
|
|
|
|
|
Collection,
|
|
|
|
|
|
Organization,
|
|
|
|
|
|
Document,
|
|
|
|
|
|
Media,
|
|
|
|
|
|
File,
|
|
|
|
|
|
Message,
|
|
|
|
|
|
Dataset,
|
|
|
|
|
|
Product,
|
|
|
|
|
|
Service,
|
|
|
|
|
|
User,
|
|
|
|
|
|
Task,
|
|
|
|
|
|
Project,
|
|
|
|
|
|
Process,
|
|
|
|
|
|
State,
|
|
|
|
|
|
Role,
|
|
|
|
|
|
Topic,
|
|
|
|
|
|
Language,
|
|
|
|
|
|
Currency,
|
|
|
|
|
|
Measurement
|
2025-06-24 11:41:30 -07:00
|
|
|
|
}
|
2025-07-31 14:24:16 -07:00
|
|
|
|
// Export type utility functions
|
|
|
|
|
|
import { getNounTypes, getVerbTypes, getNounTypeMap, getVerbTypeMap } from './utils/typeUtils.js'
|
|
|
|
|
|
|
|
|
|
|
|
export {
|
|
|
|
|
|
NounType,
|
|
|
|
|
|
VerbType,
|
|
|
|
|
|
getNounTypes,
|
|
|
|
|
|
getVerbTypes,
|
|
|
|
|
|
getNounTypeMap,
|
|
|
|
|
|
getVerbTypeMap
|
|
|
|
|
|
}
|
2025-06-24 11:41:30 -07:00
|
|
|
|
|
|
|
|
|
|
// Export MCP (Model Control Protocol) components
|
|
|
|
|
|
import {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
BrainyMCPAdapter,
|
|
|
|
|
|
MCPAugmentationToolset,
|
|
|
|
|
|
BrainyMCPService
|
2025-06-24 11:41:30 -07:00
|
|
|
|
} from './mcp/index.js' // Import from mcp/index.js
|
|
|
|
|
|
import {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
MCPRequest,
|
|
|
|
|
|
MCPResponse,
|
|
|
|
|
|
MCPDataAccessRequest,
|
|
|
|
|
|
MCPToolExecutionRequest,
|
|
|
|
|
|
MCPSystemInfoRequest,
|
|
|
|
|
|
MCPAuthenticationRequest,
|
|
|
|
|
|
MCPRequestType,
|
|
|
|
|
|
MCPServiceOptions,
|
|
|
|
|
|
MCPTool,
|
|
|
|
|
|
MCP_VERSION
|
2025-06-24 11:41:30 -07:00
|
|
|
|
} from './types/mcpTypes.js'
|
|
|
|
|
|
|
|
|
|
|
|
export {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
// MCP classes
|
|
|
|
|
|
BrainyMCPAdapter,
|
|
|
|
|
|
MCPAugmentationToolset,
|
|
|
|
|
|
BrainyMCPService,
|
|
|
|
|
|
|
|
|
|
|
|
// MCP types
|
|
|
|
|
|
MCPRequestType,
|
|
|
|
|
|
MCP_VERSION
|
2025-06-24 11:41:30 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export type {
|
2025-07-30 13:18:15 -07:00
|
|
|
|
MCPRequest,
|
|
|
|
|
|
MCPResponse,
|
|
|
|
|
|
MCPDataAccessRequest,
|
|
|
|
|
|
MCPToolExecutionRequest,
|
|
|
|
|
|
MCPSystemInfoRequest,
|
|
|
|
|
|
MCPAuthenticationRequest,
|
|
|
|
|
|
MCPServiceOptions,
|
|
|
|
|
|
MCPTool
|
2025-06-24 11:41:30 -07:00
|
|
|
|
}
|