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
|
|
@ -21,7 +21,7 @@ Enterprise features on our roadmap.
|
|||
**Everyone gets bank-level security features:**
|
||||
|
||||
```typescript
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
security: {
|
||||
encryption: 'aes-256-gcm', // Military-grade encryption
|
||||
keyRotation: true, // Automatic key rotation
|
||||
|
|
@ -47,7 +47,7 @@ const brain = new BrainyData({
|
|||
|
||||
```typescript
|
||||
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
augmentations: [
|
||||
enabled: true, // Write-ahead logging
|
||||
redundancy: 3, // Triple redundancy
|
||||
|
|
@ -102,7 +102,7 @@ const performance = {
|
|||
```typescript
|
||||
import { MonitoringAugmentation } from 'brainy'
|
||||
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
augmentations: [
|
||||
new MonitoringAugmentation({
|
||||
metrics: 'all', // Complete metrics
|
||||
|
|
@ -171,7 +171,7 @@ await brain.syncWith({
|
|||
|
||||
```typescript
|
||||
// Same architecture Netflix uses, free for you
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
clustering: {
|
||||
enabled: true, // Distributed mode
|
||||
sharding: 'automatic', // Auto-sharding
|
||||
|
|
@ -197,7 +197,7 @@ const brain = new BrainyData({
|
|||
**Everyone gets compliance tools:**
|
||||
|
||||
```typescript
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
compliance: {
|
||||
gdpr: {
|
||||
rightToDelete: true, // Automatic PII deletion
|
||||
|
|
@ -235,7 +235,7 @@ const brain = new BrainyData({
|
|||
|
||||
```typescript
|
||||
// Advanced AI capabilities for everyone
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
ai: {
|
||||
embeddings: 'state-of-the-art', // Best models available
|
||||
dimensions: 1536, // High-precision vectors
|
||||
|
|
@ -267,7 +267,7 @@ const anomalies = await brain.detectAnomalies()
|
|||
|
||||
```typescript
|
||||
// CI/CD and DevOps features
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
operations: {
|
||||
blueGreen: true, // Zero-downtime deployments
|
||||
canary: true, // Gradual rollouts
|
||||
|
|
@ -316,7 +316,7 @@ Your hobby project today might be tomorrow's unicorn startup. With Brainy, you w
|
|||
### Startups
|
||||
```typescript
|
||||
// A 2-person startup gets the same features as Amazon
|
||||
const startup = new BrainyData()
|
||||
const startup = new Brainy()
|
||||
// ✓ Full durability
|
||||
// ✓ Complete security
|
||||
// ✓ Unlimited scale
|
||||
|
|
@ -326,7 +326,7 @@ const startup = new BrainyData()
|
|||
### Education
|
||||
```typescript
|
||||
// Students learn with production-grade tools
|
||||
const classroom = new BrainyData()
|
||||
const classroom = new Brainy()
|
||||
// ✓ No feature restrictions
|
||||
// ✓ Real enterprise experience
|
||||
// ✓ Free forever
|
||||
|
|
@ -335,7 +335,7 @@ const classroom = new BrainyData()
|
|||
### Non-Profits
|
||||
```typescript
|
||||
// NGOs get enterprise features without enterprise costs
|
||||
const nonprofit = new BrainyData()
|
||||
const nonprofit = new Brainy()
|
||||
// ✓ Compliance tools
|
||||
// ✓ Security features
|
||||
// ✓ Scale for impact
|
||||
|
|
@ -345,7 +345,7 @@ const nonprofit = new BrainyData()
|
|||
### Enterprises
|
||||
```typescript
|
||||
// Enterprises get everything plus peace of mind
|
||||
const enterprise = new BrainyData()
|
||||
const enterprise = new Brainy()
|
||||
// ✓ Proven at scale
|
||||
// ✓ Community tested
|
||||
// ✓ No vendor lock-in
|
||||
|
|
@ -397,10 +397,10 @@ npm install brainy
|
|||
```
|
||||
|
||||
```typescript
|
||||
import { BrainyData } from 'brainy'
|
||||
import { Brainy } from 'brainy'
|
||||
|
||||
// Create your enterprise-grade database
|
||||
const brain = new BrainyData()
|
||||
const brain = new Brainy()
|
||||
await brain.init()
|
||||
|
||||
// You're now running the same tech as Fortune 500 companies
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ npm install @soulcraft/brainy
|
|||
### Simple Initialization
|
||||
|
||||
```typescript
|
||||
import { BrainyData } from '@soulcraft/brainy'
|
||||
import { Brainy } from '@soulcraft/brainy'
|
||||
|
||||
// Create a new Brainy instance with defaults
|
||||
const brain = new BrainyData()
|
||||
const brain = new Brainy()
|
||||
|
||||
// Initialize (downloads models if needed)
|
||||
await brain.init()
|
||||
|
|
@ -27,7 +27,7 @@ await brain.init()
|
|||
### Custom Configuration
|
||||
|
||||
```typescript
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
// Storage configuration
|
||||
storage: {
|
||||
type: 'filesystem', // or 's3', 'opfs', 'memory'
|
||||
|
|
@ -193,7 +193,7 @@ const results = await brain.find({
|
|||
|
||||
```typescript
|
||||
// Configure for streaming
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
augmentations: [
|
||||
new EntityRegistryAugmentation(), // Deduplication
|
||||
new BatchProcessingAugmentation({ batchSize: 100 }) // Batching
|
||||
|
|
@ -220,7 +220,7 @@ async function processStream(item) {
|
|||
|
||||
### Development (Memory)
|
||||
```typescript
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
storage: { type: 'memory' }
|
||||
})
|
||||
// Fast, temporary, perfect for testing
|
||||
|
|
@ -228,7 +228,7 @@ const brain = new BrainyData({
|
|||
|
||||
### Production (FileSystem)
|
||||
```typescript
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
storage: {
|
||||
type: 'filesystem',
|
||||
path: '/var/lib/brainy'
|
||||
|
|
@ -239,7 +239,7 @@ const brain = new BrainyData({
|
|||
|
||||
### Cloud (S3)
|
||||
```typescript
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
storage: {
|
||||
type: 's3',
|
||||
bucket: 'my-brainy-data',
|
||||
|
|
@ -251,7 +251,7 @@ const brain = new BrainyData({
|
|||
|
||||
### Browser (OPFS)
|
||||
```typescript
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
storage: { type: 'opfs' }
|
||||
})
|
||||
// Browser-native, persistent, offline-capable
|
||||
|
|
@ -279,7 +279,7 @@ for (const rel of relationships) {
|
|||
|
||||
### 2. Enable Caching
|
||||
```typescript
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
cache: {
|
||||
enabled: true,
|
||||
maxSize: 1000,
|
||||
|
|
@ -298,7 +298,7 @@ const results = await brain.search("query", {
|
|||
|
||||
### 4. Index Frequently Queried Fields
|
||||
```typescript
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
indexedFields: ['category', 'userId', 'timestamp']
|
||||
})
|
||||
```
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ Brainy's import is **ONE magical method** that understands EVERYTHING:
|
|||
## The Ultimate Simplicity
|
||||
|
||||
```javascript
|
||||
import { BrainyData } from '@soulcraft/brainy'
|
||||
import { Brainy } from '@soulcraft/brainy'
|
||||
|
||||
const brain = new BrainyData()
|
||||
const brain = new Brainy()
|
||||
await brain.init()
|
||||
|
||||
// ONE method for EVERYTHING:
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ Brainy uses AI embedding models to understand and process your data. This guide
|
|||
**For most developers, no configuration is needed:**
|
||||
|
||||
```typescript
|
||||
const brain = new BrainyData()
|
||||
const brain = new Brainy()
|
||||
await brain.init() // Models load automatically
|
||||
```
|
||||
|
||||
|
|
@ -38,21 +38,21 @@ Brainy tries multiple sources in this order:
|
|||
### Browser
|
||||
```typescript
|
||||
// Automatically configured for browsers
|
||||
const brain = new BrainyData() // Works in React, Vue, vanilla JS
|
||||
const brain = new Brainy() // Works in React, Vue, vanilla JS
|
||||
await brain.init() // Downloads models via CDN
|
||||
```
|
||||
|
||||
### Node.js Development
|
||||
```typescript
|
||||
// Zero config - downloads to ./models/
|
||||
const brain = new BrainyData()
|
||||
const brain = new Brainy()
|
||||
await brain.init() // Downloads once, cached forever
|
||||
```
|
||||
|
||||
### Production Server
|
||||
```typescript
|
||||
// Preload models during build/deployment
|
||||
const brain = new BrainyData()
|
||||
const brain = new Brainy()
|
||||
await brain.init() // Uses cached local models
|
||||
```
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ ls ./models/Xenova/all-MiniLM-L6-v2/
|
|||
|
||||
### Custom Model Path
|
||||
```typescript
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
embedding: {
|
||||
cacheDir: './custom-models'
|
||||
}
|
||||
|
|
@ -213,7 +213,7 @@ chmod 755 ./models
|
|||
export BRAINY_MODELS_PATH=/tmp/brainy-models
|
||||
|
||||
# Or use memory-only storage
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
storage: { forceMemoryStorage: true }
|
||||
})
|
||||
```
|
||||
|
|
@ -223,7 +223,7 @@ const brain = new BrainyData({
|
|||
### Development
|
||||
```typescript
|
||||
// ✅ Zero config - just works
|
||||
const brain = new BrainyData()
|
||||
const brain = new Brainy()
|
||||
await brain.init()
|
||||
```
|
||||
|
||||
|
|
@ -259,7 +259,7 @@ RUN test -f ./models/Xenova/all-MiniLM-L6-v2/onnx/model.onnx
|
|||
### Lambda/Serverless
|
||||
```typescript
|
||||
// ✅ Models in deployment package
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
embedding: {
|
||||
localFilesOnly: true, // No downloads in lambda
|
||||
cacheDir: './models' // Bundled with deployment
|
||||
|
|
@ -300,7 +300,7 @@ const response = await openai.embeddings.create({
|
|||
})
|
||||
|
||||
// After: Local Brainy embeddings
|
||||
const brain = new BrainyData()
|
||||
const brain = new Brainy()
|
||||
await brain.init() // One-time setup
|
||||
const id = await brain.add("Your text", { nounType: 'content' }) // Embedded automatically
|
||||
```
|
||||
|
|
@ -312,7 +312,7 @@ from sentence_transformers import SentenceTransformer
|
|||
model = SentenceTransformer('all-MiniLM-L6-v2')
|
||||
|
||||
# After: JavaScript Brainy (same model!)
|
||||
const brain = new BrainyData() // Uses same all-MiniLM-L6-v2
|
||||
const brain = new Brainy() // Uses same all-MiniLM-L6-v2
|
||||
await brain.init()
|
||||
```
|
||||
|
||||
|
|
@ -320,7 +320,7 @@ await brain.init()
|
|||
|
||||
### Custom Embedding Options
|
||||
```typescript
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
embedding: {
|
||||
model: 'Xenova/all-MiniLM-L6-v2', // Default
|
||||
dtype: 'q8', // Quantized for speed
|
||||
|
|
@ -341,7 +341,7 @@ const customEmbedder = createEmbeddingFunction({
|
|||
dtype: 'fp32' // Higher precision
|
||||
})
|
||||
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
embeddingFunction: customEmbedder
|
||||
})
|
||||
```
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@ The current NLP implementation supports:
|
|||
## Basic Usage
|
||||
|
||||
```typescript
|
||||
import { BrainyData } from 'brainy'
|
||||
import { Brainy } from 'brainy'
|
||||
|
||||
const brain = new BrainyData()
|
||||
const brain = new Brainy()
|
||||
await brain.init()
|
||||
|
||||
// Simply ask in natural language
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ The Neural API provides advanced AI-powered features for understanding relations
|
|||
## Quick Start
|
||||
|
||||
```javascript
|
||||
import { BrainyData } from '@soulcraft/brainy'
|
||||
import { Brainy } from '@soulcraft/brainy'
|
||||
|
||||
const brain = new BrainyData()
|
||||
const brain = new Brainy()
|
||||
await brain.init()
|
||||
|
||||
// Access Neural API
|
||||
|
|
@ -340,7 +340,7 @@ const sim = await neural.similar('fake-id-1', 'fake-id-2')
|
|||
|
||||
```javascript
|
||||
// Configure neural behavior at initialization
|
||||
const brain = new BrainyData({
|
||||
const brain = new Brainy({
|
||||
neural: {
|
||||
cacheSize: 1000, // Cache up to 1000 results
|
||||
defaultAlgorithm: 'kmeans',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue