fix: update all imports and references from BrainyData to Brainy
- Fixed imports in examples/tests/ to use correct Brainy import - Fixed imports in tests/benchmarks/ to use correct paths - Updated bin/brainy-interactive.js to use Brainy instead of BrainyData - Corrected documentation references throughout codebase - Removed duplicate imports in benchmark files - All files now consistently use 'Brainy' class from dist/index.js
This commit is contained in:
parent
791fac54cd
commit
196690863d
77 changed files with 328 additions and 331 deletions
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
### **Main Class Shortcuts (Simple & Common)**
|
||||
```typescript
|
||||
// High-level shortcuts on BrainyData - most common operations
|
||||
// High-level shortcuts on Brainy - most common operations
|
||||
brain.similar(a, b, options?) // ✅ Keep - very common
|
||||
brain.clusters(items?, options?) // ✅ Keep - very common
|
||||
brain.related(id, options?) // ✅ Keep - common (like neighbors but simpler name)
|
||||
|
|
@ -162,7 +162,7 @@ const streamingClusters = brain.neural.clusterStream({ batchSize: 50 })
|
|||
### **High Priority:**
|
||||
- [x] Create comprehensive type definitions
|
||||
- [x] Implement improved NeuralAPI class with proper public/private separation
|
||||
- [ ] Update BrainyData integration to use improved API
|
||||
- [ ] Update Brainy integration to use improved API
|
||||
- [ ] Fix brain-cloud explorer to use public APIs
|
||||
- [ ] Update test files to use consistent method names
|
||||
- [ ] Update documentation with new API structure
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ brain.augmentations.register(augmentation)
|
|||
|
||||
### 4. Auto-Configuration ✅
|
||||
```typescript
|
||||
new BrainyData({
|
||||
new Brainy({
|
||||
cache: true, // Auto-registers CacheAugmentation
|
||||
index: true, // Auto-registers IndexAugmentation
|
||||
storage: 's3' // Auto-registers S3StorageAugmentation
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ const cacheConfig = await getCacheAutoConfig()
|
|||
|
||||
### Enable Distributed Modes
|
||||
```typescript
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
mode: 'reader', // or 'writer' or 'hybrid'
|
||||
distributed: {
|
||||
role: 'reader',
|
||||
|
|
@ -253,7 +253,7 @@ const brain = new BrainyData({
|
|||
|
||||
### Use Neural Import
|
||||
```typescript
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
augmentations: [
|
||||
new NeuralImportAugmentation({
|
||||
confidenceThreshold: 0.7,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ High-performance deduplication for streaming data ingestion.
|
|||
```typescript
|
||||
import { EntityRegistryAugmentation } from 'brainy'
|
||||
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
augmentations: [
|
||||
new EntityRegistryAugmentation({
|
||||
maxCacheSize: 100000, // Track up to 100k unique entities
|
||||
|
|
@ -41,7 +41,7 @@ Enterprise-grade durability and crash recovery.
|
|||
|
||||
```typescript
|
||||
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
augmentations: [
|
||||
checkpointInterval: 1000, // Checkpoint every 1000 operations
|
||||
compression: true, // Enable log compression
|
||||
|
|
@ -53,7 +53,7 @@ const brain = new BrainyData({
|
|||
// All operations are now durably logged
|
||||
|
||||
// Recover from crash
|
||||
const recovered = new BrainyData({
|
||||
const recovered = new Brainy({
|
||||
})
|
||||
```
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ AI-powered relationship strength calculation.
|
|||
```typescript
|
||||
import { IntelligentVerbScoringAugmentation } from 'brainy'
|
||||
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
augmentations: [
|
||||
new IntelligentVerbScoringAugmentation({
|
||||
factors: {
|
||||
|
|
@ -111,7 +111,7 @@ Automatically extracts and registers entities from text.
|
|||
```typescript
|
||||
import { AutoRegisterEntitiesAugmentation } from 'brainy'
|
||||
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
augmentations: [
|
||||
new AutoRegisterEntitiesAugmentation({
|
||||
types: ['person', 'organization', 'location', 'product'],
|
||||
|
|
@ -147,7 +147,7 @@ Optimizes bulk operations for maximum throughput.
|
|||
```typescript
|
||||
import { BatchProcessingAugmentation } from 'brainy'
|
||||
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
augmentations: [
|
||||
new BatchProcessingAugmentation({
|
||||
batchSize: 100,
|
||||
|
|
@ -178,7 +178,7 @@ Intelligent multi-level caching system.
|
|||
```typescript
|
||||
import { CachingAugmentation } from 'brainy'
|
||||
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
augmentations: [
|
||||
new CachingAugmentation({
|
||||
levels: {
|
||||
|
|
@ -211,7 +211,7 @@ Reduces storage size while maintaining query performance.
|
|||
```typescript
|
||||
import { CompressionAugmentation } from 'brainy'
|
||||
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
augmentations: [
|
||||
new CompressionAugmentation({
|
||||
algorithm: 'brotli',
|
||||
|
|
@ -240,7 +240,7 @@ Real-time performance monitoring and metrics.
|
|||
```typescript
|
||||
import { MonitoringAugmentation } from 'brainy'
|
||||
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
augmentations: [
|
||||
new MonitoringAugmentation({
|
||||
metrics: ['operations', 'latency', 'cache', 'memory'],
|
||||
|
|
@ -279,7 +279,7 @@ brain.on('metrics', (metrics) => {
|
|||
```typescript
|
||||
import { NeuralImportAugmentation } from 'brainy'
|
||||
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
augmentations: [
|
||||
new NeuralImportAugmentation({
|
||||
autoStructure: true,
|
||||
|
|
@ -375,7 +375,7 @@ import { Augmentation } from 'brainy'
|
|||
class CustomAugmentation extends Augmentation {
|
||||
name = 'CustomAugmentation'
|
||||
|
||||
async onInit(brain: BrainyData): Promise<void> {
|
||||
async onInit(brain: Brainy): Promise<void> {
|
||||
// Initialize augmentation
|
||||
console.log('Custom augmentation initialized')
|
||||
}
|
||||
|
|
@ -408,7 +408,7 @@ class CustomAugmentation extends Augmentation {
|
|||
}
|
||||
|
||||
// Use custom augmentation
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
augmentations: [new CustomAugmentation()]
|
||||
})
|
||||
```
|
||||
|
|
@ -420,7 +420,7 @@ const brain = new BrainyData({
|
|||
```typescript
|
||||
interface AugmentationHooks {
|
||||
// Initialization
|
||||
onInit(brain: BrainyData): Promise<void>
|
||||
onInit(brain: Brainy): Promise<void>
|
||||
onShutdown(): Promise<void>
|
||||
|
||||
// Noun operations
|
||||
|
|
@ -459,7 +459,7 @@ interface AugmentationHooks {
|
|||
|
||||
```typescript
|
||||
// Combine multiple augmentations
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
augmentations: [
|
||||
// Order matters - executed in sequence
|
||||
new EntityRegistryAugmentation(), // Deduplication first
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@ const data = await brain1.export()
|
|||
await brain2.import(data)
|
||||
|
||||
// Or sync between different storage backends
|
||||
const cloudBrain = new BrainyData({ storage: 's3' })
|
||||
const localBrain = new BrainyData({ storage: 'filesystem' })
|
||||
const cloudBrain = new Brainy({ storage: 's3' })
|
||||
const localBrain = new Brainy({ storage: 'filesystem' })
|
||||
await cloudBrain.sync(localBrain) // Types match perfectly
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ Brainy is a multi-dimensional AI database that combines vector similarity, graph
|
|||
|
||||
## Core Components
|
||||
|
||||
### BrainyData (Main Entry Point)
|
||||
### Brainy (Main Entry Point)
|
||||
The central orchestrator that manages all subsystems:
|
||||
- **HNSW Index**: O(log n) vector similarity search
|
||||
- **Storage System**: Universal storage adapters (FileSystem, S3, OPFS, Memory)
|
||||
|
|
@ -90,11 +90,11 @@ Brainy's extensible plugin architecture allows for powerful enhancements:
|
|||
### Creating Custom Augmentations
|
||||
```typescript
|
||||
class CustomAugmentation extends BrainyAugmentation {
|
||||
async onInit(brain: BrainyData): Promise<void> {
|
||||
async onInit(brain: Brainy): Promise<void> {
|
||||
// Initialize augmentation
|
||||
}
|
||||
|
||||
async onAdd(item: any, brain: BrainyData): Promise<any> {
|
||||
async onAdd(item: any, brain: Brainy): Promise<any> {
|
||||
// Process item before adding
|
||||
return item
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ Brainy provides multiple storage adapters with identical APIs:
|
|||
|
||||
### FileSystem Storage (Node.js)
|
||||
```typescript
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
storage: {
|
||||
type: 'filesystem',
|
||||
path: './data'
|
||||
|
|
@ -40,7 +40,7 @@ const brain = new BrainyData({
|
|||
|
||||
### S3 Compatible Storage
|
||||
```typescript
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
storage: {
|
||||
type: 's3',
|
||||
bucket: 'my-brainy-data',
|
||||
|
|
@ -58,7 +58,7 @@ const brain = new BrainyData({
|
|||
|
||||
### Origin Private File System (Browser)
|
||||
```typescript
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
storage: {
|
||||
type: 'opfs'
|
||||
}
|
||||
|
|
@ -70,7 +70,7 @@ const brain = new BrainyData({
|
|||
|
||||
### Memory Storage
|
||||
```typescript
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
storage: {
|
||||
type: 'memory'
|
||||
}
|
||||
|
|
@ -172,7 +172,7 @@ Ensures durability and enables recovery:
|
|||
### Caching Strategy
|
||||
```typescript
|
||||
// Configure caching per storage type
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
storage: {
|
||||
type: 'filesystem',
|
||||
cache: {
|
||||
|
|
@ -236,8 +236,8 @@ await brain.import(backup, {
|
|||
### Storage Migration
|
||||
```typescript
|
||||
// Migrate between storage types
|
||||
const oldBrain = new BrainyData({ storage: { type: 'filesystem' } })
|
||||
const newBrain = new BrainyData({ storage: { type: 's3' } })
|
||||
const oldBrain = new Brainy({ storage: { type: 'filesystem' } })
|
||||
const newBrain = new Brainy({ storage: { type: 's3' } })
|
||||
|
||||
await oldBrain.init()
|
||||
await newBrain.init()
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@ Brainy is designed with **"Zero Config by Default, Infinite Tunability"** philos
|
|||
### Instant Start
|
||||
|
||||
```typescript
|
||||
import { BrainyData } from 'brainy'
|
||||
import { Brainy } from 'brainy'
|
||||
|
||||
// That's it. No config needed.
|
||||
const brain = new BrainyData()
|
||||
const brain = new Brainy()
|
||||
await brain.init()
|
||||
|
||||
// Brainy automatically:
|
||||
|
|
@ -100,7 +100,7 @@ Brainy seamlessly migrates between storage types:
|
|||
|
||||
```typescript
|
||||
// Start with memory storage (development)
|
||||
const brain = new BrainyData() // Auto-selects memory
|
||||
const brain = new Brainy() // Auto-selects memory
|
||||
|
||||
// Later, migrate to production storage
|
||||
await brain.migrate({
|
||||
|
|
@ -292,7 +292,7 @@ Models are automatically downloaded when needed:
|
|||
|
||||
```typescript
|
||||
// First use - model auto-downloads
|
||||
const brain = new BrainyData()
|
||||
const brain = new Brainy()
|
||||
await brain.init() // Downloads model if not cached
|
||||
|
||||
// Intelligent model caching
|
||||
|
|
@ -705,7 +705,7 @@ While zero-config is default, you can override when needed:
|
|||
|
||||
```typescript
|
||||
// Explicit configuration when needed
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
// Override auto-detection
|
||||
storage: {
|
||||
type: 'filesystem',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue