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.
This commit is contained in:
parent
c59de5a48b
commit
f7484a9467
12 changed files with 1103 additions and 572 deletions
|
|
@ -1,9 +1,13 @@
|
|||
/**
|
||||
* Augmentation Event Pipeline
|
||||
*
|
||||
* This module provides a pipeline for managing and executing multiple augmentations
|
||||
* of each type. It allows registering multiple augmentations and executing them
|
||||
* in sequence or in parallel.
|
||||
* Cortex - The Brain's Orchestration System
|
||||
*
|
||||
* 🧠⚛️ The cerebral cortex that coordinates all augmentations
|
||||
*
|
||||
* This module provides the central coordination system for managing and executing
|
||||
* augmentations across all categories. Like the brain's cortex, it orchestrates
|
||||
* different capabilities (augmentations) in sequence or parallel.
|
||||
*
|
||||
* @deprecated AugmentationPipeline - Use Cortex instead
|
||||
*/
|
||||
|
||||
import {
|
||||
|
|
@ -64,11 +68,12 @@ const DEFAULT_PIPELINE_OPTIONS: PipelineOptions = {
|
|||
}
|
||||
|
||||
/**
|
||||
* AugmentationPipeline class
|
||||
* Cortex class - The Brain's Orchestration Center
|
||||
*
|
||||
* Manages multiple augmentations of each type and provides methods to execute them.
|
||||
* Manages all augmentations like the cerebral cortex coordinates different brain regions.
|
||||
* This is the central pipeline that orchestrates all augmentation execution.
|
||||
*/
|
||||
export class AugmentationPipeline {
|
||||
export class Cortex {
|
||||
private registry: AugmentationRegistry = {
|
||||
sense: [],
|
||||
conduit: [],
|
||||
|
|
@ -81,14 +86,14 @@ export class AugmentationPipeline {
|
|||
}
|
||||
|
||||
/**
|
||||
* Register an augmentation with the pipeline
|
||||
* Register an augmentation with the cortex
|
||||
*
|
||||
* @param augmentation The augmentation to register
|
||||
* @returns The pipeline instance for chaining
|
||||
* @returns The cortex instance for chaining
|
||||
*/
|
||||
public register<T extends IAugmentation>(
|
||||
augmentation: T
|
||||
): AugmentationPipeline {
|
||||
): Cortex {
|
||||
let registered = false
|
||||
|
||||
// Check for specific augmentation types
|
||||
|
|
@ -194,7 +199,7 @@ export class AugmentationPipeline {
|
|||
* @param augmentationName The name of the augmentation to unregister
|
||||
* @returns The pipeline instance for chaining
|
||||
*/
|
||||
public unregister(augmentationName: string): AugmentationPipeline {
|
||||
public unregister(augmentationName: string): Cortex {
|
||||
let found = false
|
||||
|
||||
// Remove from all registries
|
||||
|
|
@ -856,5 +861,9 @@ export class AugmentationPipeline {
|
|||
}
|
||||
}
|
||||
|
||||
// Create and export a default instance of the pipeline
|
||||
export const augmentationPipeline = new AugmentationPipeline()
|
||||
// Create and export a default instance of the cortex
|
||||
export const cortex = new Cortex()
|
||||
|
||||
// Backward compatibility exports
|
||||
export const AugmentationPipeline = Cortex
|
||||
export const augmentationPipeline = cortex
|
||||
|
|
|
|||
36
src/cortex.ts
Normal file
36
src/cortex.ts
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/**
|
||||
* Cortex - The Brain's Central Orchestration System
|
||||
*
|
||||
* 🧠⚛️ The cerebral cortex that coordinates all augmentations
|
||||
*
|
||||
* This is the main export for the Cortex system. It provides the central
|
||||
* coordination for all augmentations, managing their registration, execution,
|
||||
* and pipeline orchestration.
|
||||
*/
|
||||
|
||||
// Re-export from augmentationPipeline (which contains the Cortex class)
|
||||
export {
|
||||
Cortex,
|
||||
cortex,
|
||||
ExecutionMode,
|
||||
PipelineOptions,
|
||||
// Backward compatibility
|
||||
AugmentationPipeline,
|
||||
augmentationPipeline
|
||||
} from './augmentationPipeline.js'
|
||||
|
||||
// Re-export augmentation types for convenience
|
||||
export type {
|
||||
BrainyAugmentations,
|
||||
IAugmentation,
|
||||
ISenseAugmentation,
|
||||
IConduitAugmentation,
|
||||
ICognitionAugmentation,
|
||||
IMemoryAugmentation,
|
||||
IPerceptionAugmentation,
|
||||
IDialogAugmentation,
|
||||
IActivationAugmentation,
|
||||
IWebSocketSupport,
|
||||
AugmentationResponse,
|
||||
AugmentationType
|
||||
} from './types/augmentations.js'
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
import { BrainyData } from '../brainyData.js'
|
||||
import { Cortex } from './cortex.js'
|
||||
import { Cortex } from './cortex-legacy.js'
|
||||
import * as fs from '../universal/fs.js'
|
||||
import * as path from '../universal/path.js'
|
||||
|
||||
|
|
|
|||
30
src/index.ts
30
src/index.ts
|
|
@ -1,16 +1,38 @@
|
|||
/**
|
||||
* Brainy
|
||||
* A vector and graph database using HNSW
|
||||
* 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)
|
||||
*/
|
||||
|
||||
// No setup needed - using clean ONNX Runtime with Transformers.js
|
||||
|
||||
// Export main BrainyData class and related types
|
||||
import { BrainyData, BrainyDataConfig } from './brainyData.js'
|
||||
|
||||
export { BrainyData }
|
||||
export type { BrainyDataConfig }
|
||||
|
||||
// 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
|
||||
|
||||
// Export distance functions for convenience
|
||||
import {
|
||||
euclideanDistance,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue