@soulcraft/brainy 0.57.0 → 0.57.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +429 -187
- package/dist/augmentations/memoryAugmentations.d.ts.map +1 -1
- package/dist/brainyData.d.ts.map +1 -1
- package/dist/browserFramework.d.ts.map +1 -0
- package/dist/coreTypes.d.ts.map +1 -1
- package/dist/cortex/cli.d.ts +8 -0
- package/dist/cortex/cli.js +207 -0
- package/dist/cortex/cli.js.map +1 -0
- package/dist/cortex/commands/index.d.ts +79 -0
- package/dist/cortex/commands/index.js +614 -0
- package/dist/cortex/commands/index.js.map +1 -0
- package/dist/cortex/config.d.ts +112 -0
- package/dist/cortex/config.js +312 -0
- package/dist/cortex/config.js.map +1 -0
- package/dist/demo.d.ts.map +1 -0
- package/dist/distributed/configManager.d.ts.map +1 -0
- package/dist/distributed/domainDetector.d.ts.map +1 -0
- package/dist/distributed/hashPartitioner.d.ts.map +1 -0
- package/dist/distributed/healthMonitor.d.ts.map +1 -0
- package/dist/distributed/index.d.ts.map +1 -0
- package/dist/distributed/operationalModes.d.ts.map +1 -0
- package/dist/hnsw/distributedSearch.d.ts.map +1 -0
- package/dist/hnsw/hnswIndex.d.ts.map +1 -1
- package/dist/hnsw/hnswIndexOptimized.d.ts.map +1 -1
- package/dist/hnsw/optimizedHNSWIndex.d.ts.map +1 -0
- package/dist/hnsw/partitionedHNSWIndex.d.ts.map +1 -0
- package/dist/hnsw/scaledHNSWSystem.d.ts.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/storage/adapters/baseStorageAdapter.d.ts.map +1 -1
- package/dist/storage/adapters/batchS3Operations.d.ts.map +1 -0
- package/dist/storage/adapters/fileSystemStorage.d.ts.map +1 -1
- package/dist/storage/adapters/memoryStorage.d.ts.map +1 -1
- package/dist/storage/adapters/opfsStorage.d.ts.map +1 -1
- package/dist/storage/adapters/optimizedS3Search.d.ts.map +1 -0
- package/dist/storage/adapters/s3CompatibleStorage.d.ts.map +1 -1
- package/dist/storage/baseStorage.d.ts.map +1 -1
- package/dist/storage/cacheManager.d.ts.map +1 -0
- package/dist/storage/enhancedCacheManager.d.ts.map +1 -0
- package/dist/storage/readOnlyOptimizations.d.ts.map +1 -0
- package/dist/storage/storageFactory.d.ts.map +1 -1
- package/dist/types/distributedTypes.d.ts.map +1 -0
- package/dist/types/paginationTypes.d.ts.map +1 -0
- package/dist/types/tensorflowTypes.js +6 -0
- package/dist/types/tensorflowTypes.js.map +1 -0
- package/dist/utils/autoConfiguration.d.ts.map +1 -0
- package/dist/utils/cacheAutoConfig.d.ts.map +1 -0
- package/dist/utils/crypto.d.ts.map +1 -0
- package/dist/utils/embedding.d.ts.map +1 -1
- package/dist/utils/fieldNameTracking.d.ts.map +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/jsonProcessing.d.ts.map +1 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/robustModelLoader.d.ts +112 -0
- package/dist/utils/robustModelLoader.d.ts.map +1 -0
- package/dist/utils/robustModelLoader.js +624 -0
- package/dist/utils/robustModelLoader.js.map +1 -0
- package/dist/utils/searchCache.d.ts.map +1 -0
- package/dist/utils/statisticsCollector.d.ts.map +1 -0
- package/dist/utils/typeUtils.d.ts.map +1 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/augmentations/neuralImportSense.d.ts +0 -196
- package/dist/augmentations/neuralImportSense.js +0 -747
- package/dist/augmentations/neuralImportSense.js.map +0 -1
- package/dist/patched-platform-node.d.ts +0 -17
- package/dist/patched-platform-node.d.ts.map +0 -1
- package/dist/testing/prettyReporter.d.ts +0 -23
- package/dist/testing/prettyReporter.d.ts.map +0 -1
- package/dist/testing/prettySummaryReporter.d.ts +0 -22
- package/dist/testing/prettySummaryReporter.d.ts.map +0 -1
- package/dist/unified.min.js +0 -12511
- package/dist/unified.min.js.map +0 -1
- package/dist/utils/tensorflowUtils.d.ts +0 -17
- package/dist/utils/tensorflowUtils.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# 🧠⚛️ Brainy - Lightning-Fast Vector + Graph Database with AI Intelligence
|
|
2
|
-
|
|
3
1
|
<div align="center">
|
|
4
2
|
|
|
5
3
|

|
|
@@ -9,91 +7,263 @@
|
|
|
9
7
|
[](https://nodejs.org/)
|
|
10
8
|
[](https://www.typescriptlang.org/)
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
**Sub-millisecond queries across millions of vectors + billions of relationships**
|
|
14
|
-
|
|
15
|
-
</div>
|
|
10
|
+
# BRAINY: The Brain in a Jar Database™
|
|
16
11
|
|
|
17
|
-
|
|
12
|
+
**The world's only Vector + Graph + AI database and realtime data platform**
|
|
18
13
|
|
|
19
|
-
|
|
14
|
+
*Zero-to-Smart™ technology that thinks so you don't have to*
|
|
20
15
|
|
|
21
|
-
|
|
22
|
-
✅ **Brainy Reality**: One blazing-fast database. One API. Everything in sync.
|
|
16
|
+
</div>
|
|
23
17
|
|
|
24
|
-
|
|
18
|
+
---
|
|
25
19
|
|
|
26
|
-
|
|
27
|
-
npm install @soulcraft/brainy
|
|
28
|
-
```
|
|
20
|
+
## 🚀 THE AMAZING BRAINY: See It In Action!
|
|
29
21
|
|
|
30
22
|
```javascript
|
|
31
23
|
import { BrainyData } from '@soulcraft/brainy'
|
|
32
24
|
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
// 🧪 Initialize your brain-in-a-jar
|
|
26
|
+
const brainy = new BrainyData() // Zero config - it's ALIVE!
|
|
27
|
+
await brainy.init()
|
|
35
28
|
|
|
36
|
-
//
|
|
29
|
+
// 🔬 Feed it knowledge with relationships
|
|
37
30
|
const openai = await brainy.add("OpenAI", { type: "company", funding: 11000000 })
|
|
38
31
|
const gpt4 = await brainy.add("GPT-4", { type: "product", users: 100000000 })
|
|
39
32
|
await brainy.relate(openai, gpt4, "develops")
|
|
40
33
|
|
|
41
|
-
// One query
|
|
34
|
+
// ⚡ One query to rule them all - Vector + Graph + Faceted search!
|
|
42
35
|
const results = await brainy.search("AI language models", 5, {
|
|
43
36
|
metadata: { funding: { $gte: 10000000 } }, // MongoDB-style filtering
|
|
44
37
|
includeVerbs: true // Graph relationships
|
|
45
|
-
}) //
|
|
38
|
+
}) // Plus semantic vector search!
|
|
46
39
|
```
|
|
47
40
|
|
|
48
|
-
|
|
41
|
+
**🎭 8 lines. Three search paradigms. One brain-powered database.**
|
|
49
42
|
|
|
50
|
-
##
|
|
43
|
+
## 💫 WHY BRAINY? The Problem We Solve
|
|
44
|
+
|
|
45
|
+
### ❌ The Old Way: Database Frankenstein
|
|
51
46
|
|
|
52
|
-
### ⚡ Blazing Performance at Scale
|
|
53
47
|
```
|
|
54
|
-
|
|
55
|
-
Graph Traversal (100M relations): 1-3ms p95 latency
|
|
56
|
-
Combined Vector+Graph+Filter: 5-15ms p95 latency
|
|
57
|
-
Throughput: 10K+ queries/second
|
|
48
|
+
Pinecone ($$$) + Neo4j ($$$) + Elasticsearch ($$$) + Sync Hell = 😱
|
|
58
49
|
```
|
|
59
50
|
|
|
60
|
-
###
|
|
61
|
-
- **Same code** works in React, Vue, Angular, Node.js, Edge Workers
|
|
62
|
-
- **Auto-detects** environment and optimizes automatically
|
|
63
|
-
- **Zero config** - no setup files, no tuning parameters
|
|
51
|
+
### ✅ The Brainy Way: One Smart Brain
|
|
64
52
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
- **Relationship Mapping**: Discovers connections between entities
|
|
69
|
-
- **Chat Interface**: Talk to your data naturally (v0.56+)
|
|
53
|
+
```
|
|
54
|
+
Vector Search + Graph Relations + Metadata Filtering + AI Intelligence = 🧠✨
|
|
55
|
+
```
|
|
70
56
|
|
|
71
|
-
|
|
57
|
+
**Your data gets a brain upgrade. No assembly required.**
|
|
58
|
+
|
|
59
|
+
## ⚡ QUICK & EASY: From Zero to Smart in 60 Seconds
|
|
60
|
+
|
|
61
|
+
### Installation
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm install @soulcraft/brainy
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Your First Brainy App
|
|
68
|
+
|
|
69
|
+
```javascript
|
|
70
|
+
import { BrainyData } from '@soulcraft/brainy'
|
|
71
|
+
|
|
72
|
+
// It's alive! (No config needed)
|
|
73
|
+
const brainy = new BrainyData()
|
|
74
|
+
await brainy.init()
|
|
75
|
+
|
|
76
|
+
// Feed your brain some data
|
|
77
|
+
await brainy.add("Tesla", { type: "company", sector: "automotive" })
|
|
78
|
+
await brainy.add("SpaceX", { type: "company", sector: "aerospace" })
|
|
72
79
|
|
|
73
|
-
|
|
80
|
+
// Ask it questions (semantic search)
|
|
81
|
+
const similar = await brainy.search("electric vehicles")
|
|
82
|
+
|
|
83
|
+
// Use relationships (graph database)
|
|
84
|
+
await brainy.relate("Tesla", "SpaceX", "shares_founder_with")
|
|
85
|
+
|
|
86
|
+
// Filter like MongoDB (faceted search)
|
|
87
|
+
const results = await brainy.search("innovation", {
|
|
88
|
+
metadata: { sector: "automotive" }
|
|
89
|
+
})
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## 🎆 NEW! Talk to Your Data with Brainy Chat
|
|
74
93
|
|
|
75
94
|
```javascript
|
|
76
95
|
import { BrainyChat } from '@soulcraft/brainy'
|
|
77
96
|
|
|
78
|
-
const chat = new BrainyChat(brainy) //
|
|
97
|
+
const chat = new BrainyChat(brainy) // Your data becomes conversational!
|
|
79
98
|
const answer = await chat.ask("What patterns do you see in customer behavior?")
|
|
80
|
-
// →
|
|
99
|
+
// → AI-powered insights from your knowledge graph!
|
|
81
100
|
```
|
|
82
101
|
|
|
83
|
-
**One line. Zero complexity. Optional LLM for
|
|
102
|
+
**One line. Zero complexity. Optional LLM for genius-level responses.**
|
|
84
103
|
[📖 **Learn More About Brainy Chat**](BRAINY-CHAT.md)
|
|
85
104
|
|
|
86
|
-
##
|
|
105
|
+
## 🎮 NEW! Brainy CLI - Command Center from the Future
|
|
106
|
+
|
|
107
|
+
### 💬 Talk to Your Data
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Have conversations with your knowledge graph
|
|
111
|
+
brainy chat "What patterns exist in customer behavior?"
|
|
112
|
+
brainy chat "Show me all connections between startups"
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### 📥 Add & Import Data
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# Import with AI understanding
|
|
119
|
+
brainy import data.csv --cortex --understand
|
|
120
|
+
|
|
121
|
+
# Add individual items
|
|
122
|
+
brainy add "OpenAI" --type company --metadata '{"founded": 2015}'
|
|
123
|
+
|
|
124
|
+
# Bulk import with relationships
|
|
125
|
+
brainy import relationships.json --detect-entities
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### 🔍 Explore & Query
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
# Search semantically
|
|
132
|
+
brainy search "artificial intelligence companies"
|
|
133
|
+
|
|
134
|
+
# Query with filters
|
|
135
|
+
brainy query --filter 'funding>1000000' --type company
|
|
136
|
+
|
|
137
|
+
# Visualize relationships
|
|
138
|
+
brainy graph "OpenAI" --depth 2 --format ascii
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### 🔄 Manage & Migrate
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# Export your brain
|
|
145
|
+
brainy export my-brain.json --include-embeddings
|
|
146
|
+
|
|
147
|
+
# Migrate between storage backends
|
|
148
|
+
brainy migrate s3://old-bucket file://new-location
|
|
149
|
+
|
|
150
|
+
# Backup and restore
|
|
151
|
+
brainy backup --compress
|
|
152
|
+
brainy restore backup-2024.tar.gz
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### 🔐 Environment & Secrets
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# Store configuration securely
|
|
159
|
+
brainy config set api.key "sk-..." --encrypt
|
|
160
|
+
brainy config set storage.s3.bucket "my-brain"
|
|
161
|
+
|
|
162
|
+
# Load environment profiles
|
|
163
|
+
brainy env use production
|
|
164
|
+
brainy env create staging --from .env.staging
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### 📊 Monitor & Optimize
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
# Real-time dashboard
|
|
171
|
+
brainy monitor --dashboard
|
|
172
|
+
|
|
173
|
+
# Performance analysis
|
|
174
|
+
brainy stats --detailed
|
|
175
|
+
brainy optimize index --auto
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
**Command your data empire from the terminal!**
|
|
179
|
+
[📖 **Full CLI Documentation**](docs/brainy-cli.md)
|
|
180
|
+
|
|
181
|
+
## 🧬 NEW! Cortex AI - Your Data Gets a PhD
|
|
182
|
+
|
|
183
|
+
**Cortex automatically understands and enhances your data:**
|
|
184
|
+
|
|
185
|
+
```javascript
|
|
186
|
+
// Enable Cortex Intelligence during import
|
|
187
|
+
const brainy = new BrainyData({
|
|
188
|
+
cortex: {
|
|
189
|
+
enabled: true,
|
|
190
|
+
autoDetect: true // Automatically identify entities & relationships
|
|
191
|
+
}
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
// Import with understanding
|
|
195
|
+
await brainy.cortexImport('customers.csv', {
|
|
196
|
+
understand: true, // AI analyzes data structure
|
|
197
|
+
detectRelations: true, // Finds hidden connections
|
|
198
|
+
confidence: 0.8 // Quality threshold
|
|
199
|
+
})
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
**Your data becomes self-aware (in a good way)!**
|
|
203
|
+
|
|
204
|
+
## 🔌 NEW! Augmentation Pipeline - Plug in Superpowers
|
|
205
|
+
|
|
206
|
+
**8 types of augmentations to enhance your brain:**
|
|
207
|
+
|
|
208
|
+
```javascript
|
|
209
|
+
// Add augmentations like installing apps on your brain
|
|
210
|
+
brainy.augment({
|
|
211
|
+
type: 'PERCEPTION', // Visual/pattern recognition
|
|
212
|
+
handler: myPerceptor
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
brainy.augment({
|
|
216
|
+
type: 'COGNITION', // Deep thinking & analysis
|
|
217
|
+
handler: myThinker
|
|
218
|
+
})
|
|
219
|
+
|
|
220
|
+
// Premium augmentations (coming soon!)
|
|
221
|
+
brainy.augment({
|
|
222
|
+
type: 'NOTION_SYNC', // Bi-directional Notion sync
|
|
223
|
+
license: 'premium'
|
|
224
|
+
})
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
**Augmentation Types:**
|
|
228
|
+
|
|
229
|
+
- 🎯 **SENSE** - Input processing
|
|
230
|
+
- 🧠 **MEMORY** - Long-term storage
|
|
231
|
+
- 💭 **COGNITION** - Deep analysis
|
|
232
|
+
- 🔗 **CONDUIT** - Data flow
|
|
233
|
+
- ⚡ **ACTIVATION** - Triggers & events
|
|
234
|
+
- 👁️ **PERCEPTION** - Pattern recognition
|
|
235
|
+
- 💬 **DIALOG** - Conversational AI
|
|
236
|
+
- 🌐 **WEBSOCKET** - Real-time sync
|
|
237
|
+
|
|
238
|
+
## 💪 POWERFUL FEATURES: What Makes Brainy Special
|
|
239
|
+
|
|
240
|
+
### ⚡ Performance That Defies Science
|
|
241
|
+
|
|
242
|
+
```
|
|
243
|
+
Vector Search (1M embeddings): 2-8ms latency 🚀
|
|
244
|
+
Graph Traversal (100M relations): 1-3ms latency 🔥
|
|
245
|
+
Combined Vector+Graph+Filter: 5-15ms latency ⚡
|
|
246
|
+
Throughput: 10K+ queries/sec 💫
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### 🌍 Write Once, Run Anywhere (Literally)
|
|
250
|
+
|
|
251
|
+
- **Browser**: Uses OPFS, Web Workers - works offline!
|
|
252
|
+
- **Node.js**: FileSystem, Worker Threads - server-ready!
|
|
253
|
+
- **Edge/Serverless**: Memory-optimized - deploys anywhere!
|
|
254
|
+
- **React/Vue/Angular**: Same code, automatic optimization!
|
|
255
|
+
|
|
256
|
+
### 🔮 The Power of Three-in-One Search
|
|
87
257
|
|
|
88
258
|
```javascript
|
|
89
|
-
// This ONE query
|
|
259
|
+
// This ONE query replaces THREE databases:
|
|
90
260
|
const results = await brainy.search("AI startups in healthcare", 10, {
|
|
91
261
|
// 🔍 Vector: Semantic similarity
|
|
92
262
|
includeVerbs: true,
|
|
93
|
-
|
|
263
|
+
|
|
94
264
|
// 🔗 Graph: Relationship traversal
|
|
95
265
|
verbTypes: ["invests_in", "partners_with"],
|
|
96
|
-
|
|
266
|
+
|
|
97
267
|
// 📊 Faceted: MongoDB-style filtering
|
|
98
268
|
metadata: {
|
|
99
269
|
industry: "healthcare",
|
|
@@ -101,225 +271,290 @@ const results = await brainy.search("AI startups in healthcare", 10, {
|
|
|
101
271
|
stage: { $in: ["Series A", "Series B"] }
|
|
102
272
|
}
|
|
103
273
|
})
|
|
104
|
-
// Returns: Companies similar to your query + their relationships + matching your criteria
|
|
105
274
|
```
|
|
106
275
|
|
|
107
|
-
|
|
276
|
+
### 🧠 Self-Learning & Auto-Optimization
|
|
108
277
|
|
|
109
|
-
**
|
|
278
|
+
**Brainy gets smarter the more you use it:**
|
|
110
279
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
| ⚡ Serverless | S3 / Memory | Cold Start Optimization |
|
|
116
|
-
| 🔥 Edge | Memory / KV | Minimal Footprint |
|
|
280
|
+
- Auto-indexes frequently searched fields
|
|
281
|
+
- Learns query patterns for faster responses
|
|
282
|
+
- Optimizes storage based on access patterns
|
|
283
|
+
- Self-configures for your environment
|
|
117
284
|
|
|
118
|
-
|
|
119
|
-
|
|
285
|
+
## 🎭 ADVANCED FEATURES: For Mad Scientists
|
|
286
|
+
|
|
287
|
+
### 🔬 MongoDB-Style Query Operators
|
|
288
|
+
|
|
289
|
+
```javascript
|
|
290
|
+
const results = await brainy.search("quantum computing", {
|
|
291
|
+
metadata: {
|
|
292
|
+
$and: [
|
|
293
|
+
{ price: { $gte: 100, $lte: 1000 } },
|
|
294
|
+
{ category: { $in: ["electronics", "computing"] } },
|
|
295
|
+
{
|
|
296
|
+
$or: [
|
|
297
|
+
{ brand: "Intel" },
|
|
298
|
+
{ brand: "IBM" }
|
|
299
|
+
]
|
|
300
|
+
},
|
|
301
|
+
{ tags: { $includes: "quantum" } },
|
|
302
|
+
{ description: { $regex: "qubit|superposition" } }
|
|
303
|
+
]
|
|
304
|
+
}
|
|
305
|
+
})
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
**15+ operators**: `$gt`, `$gte`, `$lt`, `$lte`, `$eq`, `$ne`, `$in`, `$nin`, `$regex`, `$includes`, `$all`, `$size`,
|
|
309
|
+
`$and`, `$or`, `$not`
|
|
310
|
+
|
|
311
|
+
### 🧪 Specialized Deployment Modes
|
|
120
312
|
|
|
121
313
|
```javascript
|
|
122
|
-
// High-
|
|
314
|
+
// High-speed data ingestion
|
|
123
315
|
const writer = new BrainyData({
|
|
124
316
|
writeOnly: true,
|
|
125
317
|
allowDirectReads: true // For deduplication
|
|
126
318
|
})
|
|
127
319
|
|
|
128
|
-
// Read-only search
|
|
320
|
+
// Read-only search cluster
|
|
129
321
|
const reader = new BrainyData({
|
|
130
322
|
readOnly: true,
|
|
131
|
-
frozen: true //
|
|
323
|
+
frozen: true // Maximum performance
|
|
132
324
|
})
|
|
133
325
|
|
|
134
|
-
// Custom storage
|
|
326
|
+
// Custom storage backend
|
|
135
327
|
const custom = new BrainyData({
|
|
136
328
|
storage: {
|
|
137
329
|
type: 's3',
|
|
138
|
-
s3Storage: {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
330
|
+
s3Storage: {
|
|
331
|
+
bucketName: 'my-brain',
|
|
332
|
+
region: 'us-east-1'
|
|
333
|
+
}
|
|
142
334
|
}
|
|
143
335
|
})
|
|
144
336
|
```
|
|
145
337
|
|
|
146
|
-
|
|
338
|
+
### 🚀 Framework Integration Examples
|
|
147
339
|
|
|
148
|
-
|
|
340
|
+
<details>
|
|
341
|
+
<summary>📦 <strong>See Framework Examples</strong></summary>
|
|
149
342
|
|
|
150
|
-
|
|
151
|
-
# Talk to your data
|
|
152
|
-
brainy chat "What patterns do you see?"
|
|
343
|
+
#### React
|
|
153
344
|
|
|
154
|
-
|
|
155
|
-
|
|
345
|
+
```jsx
|
|
346
|
+
import { BrainyData } from '@soulcraft/brainy'
|
|
156
347
|
|
|
157
|
-
|
|
158
|
-
brainy
|
|
348
|
+
function App() {
|
|
349
|
+
const [brainy] = useState(() => new BrainyData())
|
|
350
|
+
|
|
351
|
+
useEffect(() => {
|
|
352
|
+
brainy.init()
|
|
353
|
+
}, [])
|
|
354
|
+
|
|
355
|
+
const search = async (query) => {
|
|
356
|
+
return await brainy.search(query, 10)
|
|
357
|
+
}
|
|
159
358
|
|
|
160
|
-
|
|
161
|
-
|
|
359
|
+
return <SearchInterface onSearch={search} />
|
|
360
|
+
}
|
|
162
361
|
```
|
|
163
362
|
|
|
164
|
-
|
|
363
|
+
#### Vue 3
|
|
165
364
|
|
|
166
|
-
|
|
365
|
+
```vue
|
|
167
366
|
|
|
168
|
-
|
|
367
|
+
<script setup>
|
|
368
|
+
import { BrainyData } from '@soulcraft/brainy'
|
|
169
369
|
|
|
370
|
+
const brainy = new BrainyData()
|
|
371
|
+
await brainy.init()
|
|
170
372
|
|
|
171
|
-
|
|
373
|
+
const search = async (query) => {
|
|
374
|
+
return await brainy.search(query, 10)
|
|
375
|
+
}
|
|
376
|
+
</script>
|
|
377
|
+
```
|
|
172
378
|
|
|
173
|
-
|
|
174
|
-
❌ **Pinecone + Neo4j + Elasticsearch** - 3 databases, sync nightmares, 3x the cost
|
|
175
|
-
✅ **Brainy** - One database, always synced, built-in intelligence
|
|
379
|
+
#### Angular
|
|
176
380
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
381
|
+
```typescript
|
|
382
|
+
|
|
383
|
+
@Injectable({ providedIn: 'root' })
|
|
384
|
+
export class BrainyService {
|
|
385
|
+
private brainy = new BrainyData()
|
|
386
|
+
|
|
387
|
+
async init() {
|
|
388
|
+
await this.brainy.init()
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
search(query: string) {
|
|
392
|
+
return this.brainy.search(query, 10)
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
</details>
|
|
180
398
|
|
|
181
|
-
###
|
|
182
|
-
|
|
183
|
-
|
|
399
|
+
### 🐳 Docker & Cloud Deployment
|
|
400
|
+
|
|
401
|
+
```dockerfile
|
|
402
|
+
FROM node:24-slim
|
|
403
|
+
WORKDIR /app
|
|
404
|
+
COPY . .
|
|
405
|
+
RUN npm install
|
|
406
|
+
RUN npm run download-models # Bundle models for offline use
|
|
407
|
+
CMD ["node", "server.js"]
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
Deploy to AWS, GCP, Azure, Cloudflare Workers, anywhere!
|
|
184
411
|
|
|
185
412
|
## 💎 Premium Features (Optional)
|
|
186
413
|
|
|
187
|
-
**Core Brainy is FREE forever. Premium
|
|
414
|
+
**Core Brainy is FREE forever. Premium augmentations for enterprise:**
|
|
415
|
+
|
|
416
|
+
### 🔗 Enterprise Connectors (Coming Soon!)
|
|
188
417
|
|
|
189
|
-
|
|
190
|
-
- **Notion** ($49/mo) - Bidirectional workspace sync
|
|
418
|
+
- **Notion** ($49/mo) - Bi-directional workspace sync
|
|
191
419
|
- **Salesforce** ($99/mo) - CRM integration
|
|
192
|
-
- **Slack** ($49/mo) - Team
|
|
193
|
-
- **Asana** ($44/mo) - Project
|
|
420
|
+
- **Slack** ($49/mo) - Team knowledge capture
|
|
421
|
+
- **Asana** ($44/mo) - Project intelligence
|
|
194
422
|
|
|
195
423
|
```bash
|
|
196
|
-
brainy
|
|
424
|
+
brainy augment trial notion # Start 14-day free trial
|
|
197
425
|
```
|
|
198
426
|
|
|
199
|
-
**No vendor lock-in. Your data stays yours.**
|
|
200
|
-
|
|
201
427
|
## 🎨 What You Can Build
|
|
202
428
|
|
|
203
|
-
|
|
204
|
-
- **🔍 Semantic Search** - Search by meaning, not keywords
|
|
205
|
-
- **🎯 Recommendation Engines** - "Users who liked this also liked..."
|
|
206
|
-
- **🧬 Knowledge Graphs** - Connect everything to everything
|
|
207
|
-
- **🛡️ Fraud Detection** - Find patterns humans can't see
|
|
208
|
-
- **📚 Smart Documentation** - Docs that answer questions
|
|
429
|
+
**The only limit is your imagination:**
|
|
209
430
|
|
|
431
|
+
- **🤖 AI Assistants** - ChatGPT with perfect memory
|
|
432
|
+
- **🔍 Semantic Search** - Find by meaning, not keywords
|
|
433
|
+
- **🎯 Recommendation Engines** - Netflix-level suggestions
|
|
434
|
+
- **🧬 Knowledge Graphs** - Wikipedia meets Neo4j
|
|
435
|
+
- **👁️ Computer Vision** - Search images by content
|
|
436
|
+
- **🎵 Music Discovery** - Spotify's algorithm in your app
|
|
437
|
+
- **📚 Smart Documentation** - Self-answering docs
|
|
438
|
+
- **🛡️ Fraud Detection** - Pattern recognition on steroids
|
|
439
|
+
- **🌐 Real-time Collaboration** - Multiplayer knowledge bases
|
|
440
|
+
- **🏥 Medical Diagnosis** - Symptom matching with AI
|
|
210
441
|
|
|
211
|
-
|
|
212
|
-
<summary>📦 <strong>Framework Examples</strong></summary>
|
|
442
|
+
## 📚 Complete Documentation
|
|
213
443
|
|
|
214
|
-
###
|
|
215
|
-
```jsx
|
|
216
|
-
import { BrainyData } from '@soulcraft/brainy'
|
|
444
|
+
### Getting Started
|
|
217
445
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
const search = async (query) => {
|
|
223
|
-
return await brainy.search(query, 10)
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
```
|
|
446
|
+
- [**Quick Start Guide**](docs/getting-started/) - Up and running in 5 minutes
|
|
447
|
+
- [**Installation**](docs/getting-started/installation.md) - All environments covered
|
|
448
|
+
- [**Basic Concepts**](docs/getting-started/concepts.md) - Understand the brain
|
|
227
449
|
|
|
228
|
-
###
|
|
229
|
-
```vue
|
|
230
|
-
<script setup>
|
|
231
|
-
const brainy = new BrainyData()
|
|
232
|
-
await brainy.init()
|
|
233
|
-
</script>
|
|
234
|
-
```
|
|
450
|
+
### Core Features
|
|
235
451
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
brainy = new BrainyData()
|
|
241
|
-
async ngOnInit() {
|
|
242
|
-
await this.brainy.init()
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
```
|
|
452
|
+
- [**API Reference**](docs/api-reference/) - Every method documented
|
|
453
|
+
- [**Search Guide**](docs/api-reference/search.md) - Master all search types
|
|
454
|
+
- [**Graph Operations**](docs/api-reference/graph.md) - Relationships explained
|
|
455
|
+
- [**MongoDB Operators**](docs/api-reference/operators.md) - Query like a pro
|
|
246
456
|
|
|
247
|
-
###
|
|
248
|
-
```javascript
|
|
249
|
-
const brainy = new BrainyData()
|
|
250
|
-
await brainy.init()
|
|
251
|
-
```
|
|
457
|
+
### Advanced Topics
|
|
252
458
|
|
|
253
|
-
|
|
459
|
+
- [**Brainy CLI**](docs/brainy-cli.md) - Command-line superpowers
|
|
460
|
+
- [**Brainy Chat**](BRAINY-CHAT.md) - Conversational AI interface
|
|
461
|
+
- [**Cortex AI**](CORTEX.md) - Intelligence augmentation
|
|
462
|
+
- [**Augmentation Pipeline**](docs/augmentations/) - Plugin architecture
|
|
463
|
+
- [**Performance Tuning**](docs/optimization-guides/) - Speed optimization
|
|
464
|
+
- [**Deployment Guide**](docs/deployment/) - Production best practices
|
|
254
465
|
|
|
466
|
+
### Examples & Tutorials
|
|
255
467
|
|
|
468
|
+
- [**Example Apps**](docs/examples/) - Full applications
|
|
469
|
+
- [**Code Recipes**](docs/examples/recipes.md) - Common patterns
|
|
470
|
+
- [**Video Tutorials**](docs/tutorials/) - Visual learning
|
|
256
471
|
|
|
257
|
-
##
|
|
472
|
+
## 🆚 Why Not Just Use...?
|
|
258
473
|
|
|
259
|
-
|
|
260
|
-
<summary>🔧 <strong>MongoDB-Style Metadata Filtering</strong></summary>
|
|
474
|
+
### vs. Multiple Databases
|
|
261
475
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
metadata: {
|
|
265
|
-
price: { $gte: 100, $lte: 1000 },
|
|
266
|
-
category: { $in: ["AI", "ML"] },
|
|
267
|
-
rating: { $gt: 4.5 },
|
|
268
|
-
tags: { $includes: "tensorflow" }
|
|
269
|
-
}
|
|
270
|
-
})
|
|
271
|
-
```
|
|
476
|
+
❌ **Pinecone + Neo4j + Elasticsearch** = 3x cost, sync nightmares, 3 APIs
|
|
477
|
+
✅ **Brainy** = One database, always synced, one simple API
|
|
272
478
|
|
|
273
|
-
|
|
479
|
+
### vs. Cloud-Only Vector DBs
|
|
274
480
|
|
|
275
|
-
|
|
481
|
+
❌ **Pinecone/Weaviate** = Vendor lock-in, expensive, cloud-only
|
|
482
|
+
✅ **Brainy** = Run anywhere, own your data, pay once
|
|
276
483
|
|
|
277
|
-
|
|
278
|
-
<summary>🔗 <strong>Graph Relationships</strong></summary>
|
|
484
|
+
### vs. Traditional Graph DBs
|
|
279
485
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
const product = await brainy.add("GPT-4", { type: "product" })
|
|
283
|
-
await brainy.relate(company, product, "develops")
|
|
486
|
+
❌ **Neo4j + vector plugin** = Bolt-on solution, limited capabilities
|
|
487
|
+
✅ **Brainy** = Native vector+graph from the ground up
|
|
284
488
|
|
|
285
|
-
|
|
286
|
-
```
|
|
489
|
+
## 🚀 Real-World Performance & Scale
|
|
287
490
|
|
|
288
|
-
|
|
491
|
+
**How Brainy handles production workloads:**
|
|
289
492
|
|
|
290
|
-
|
|
291
|
-
<summary>🐳 <strong>Docker Deployment</strong></summary>
|
|
493
|
+
### 📊 Benchmark Numbers
|
|
292
494
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
495
|
+
- **10M vectors**: 5-15ms search latency (p95)
|
|
496
|
+
- **100M relationships**: 1-3ms traversal
|
|
497
|
+
- **Metadata filtering**: O(1) field access via hybrid indexing
|
|
498
|
+
- **Concurrent queries**: 10,000+ QPS on single instance
|
|
499
|
+
- **Index size**: ~100 bytes per vector (384 dims)
|
|
500
|
+
|
|
501
|
+
### 🎯 Scaling Strategies
|
|
502
|
+
|
|
503
|
+
**Scale Up (Vertical)**
|
|
504
|
+
|
|
505
|
+
```javascript
|
|
506
|
+
// Optimize for large datasets on single machine
|
|
507
|
+
const brainy = new BrainyData({
|
|
508
|
+
hnsw: {
|
|
509
|
+
maxConnections: 32, // More connections = better recall
|
|
510
|
+
efConstruction: 400, // Higher quality index
|
|
511
|
+
efSearch: 100 // More accurate search
|
|
512
|
+
}
|
|
513
|
+
})
|
|
297
514
|
```
|
|
298
515
|
|
|
299
|
-
|
|
516
|
+
**Scale Out (Horizontal)**
|
|
300
517
|
|
|
301
|
-
|
|
518
|
+
```javascript
|
|
519
|
+
// Shard by category for distributed deployment
|
|
520
|
+
const shards = {
|
|
521
|
+
products: new BrainyData({ defaultService: 'products-shard' }),
|
|
522
|
+
users: new BrainyData({ defaultService: 'users-shard' }),
|
|
523
|
+
content: new BrainyData({ defaultService: 'content-shard' })
|
|
524
|
+
}
|
|
302
525
|
|
|
526
|
+
// Or use read/write separation
|
|
527
|
+
const writer = new BrainyData({ writeOnly: true })
|
|
528
|
+
const readers = [/* multiple read replicas */]
|
|
529
|
+
```
|
|
303
530
|
|
|
304
|
-
|
|
531
|
+
### 🏗️ Architecture That Scales
|
|
305
532
|
|
|
306
|
-
-
|
|
307
|
-
-
|
|
308
|
-
-
|
|
309
|
-
-
|
|
310
|
-
-
|
|
533
|
+
✅ **Distributed Index** - Partition by metadata fields or ID ranges
|
|
534
|
+
✅ **Smart Partitioning** - Semantic clustering or hash-based sharding
|
|
535
|
+
✅ **Real-time Sync** - WebRTC & WebSocket for live collaboration
|
|
536
|
+
✅ **GPU Acceleration** - Auto-detected for embeddings when available
|
|
537
|
+
✅ **Metadata Index** - Separate B-tree indexes for fast filtering
|
|
538
|
+
✅ **Memory Mapped Files** - Handle datasets larger than RAM
|
|
539
|
+
✅ **Streaming Ingestion** - Process millions of items without OOM
|
|
540
|
+
✅ **Progressive Loading** - Start serving queries before full index load
|
|
311
541
|
|
|
312
|
-
##
|
|
542
|
+
## 🛸 Recent Updates
|
|
313
543
|
|
|
314
|
-
|
|
544
|
+
### 🎯 v0.57.0 - The Cortex Revolution
|
|
315
545
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
✅ **No network calls** - Works completely offline after setup
|
|
546
|
+
- Renamed CLI from "neural" to "brainy"
|
|
547
|
+
- Cortex AI for data understanding
|
|
548
|
+
- Augmentation pipeline system
|
|
549
|
+
- Premium connectors framework
|
|
321
550
|
|
|
322
|
-
|
|
551
|
+
### ⚡ v0.46-v0.51 - Performance Revolution
|
|
552
|
+
|
|
553
|
+
- 95% package size reduction
|
|
554
|
+
- MongoDB query operators
|
|
555
|
+
- Filter discovery API
|
|
556
|
+
- Transformers.js migration
|
|
557
|
+
- True offline operation
|
|
323
558
|
|
|
324
559
|
## 🤝 Contributing
|
|
325
560
|
|
|
@@ -332,7 +567,14 @@ We welcome contributions! See [Contributing Guidelines](CONTRIBUTING.md)
|
|
|
332
567
|
---
|
|
333
568
|
|
|
334
569
|
<div align="center">
|
|
335
|
-
<strong>Ready to build the future of search?</strong>
|
|
336
570
|
|
|
337
|
-
|
|
338
|
-
|
|
571
|
+
## 🧠 Ready to Give Your Data a Brain?
|
|
572
|
+
|
|
573
|
+
**[Get Started →](docs/getting-started/) | [Examples →](docs/examples/)**
|
|
574
|
+
|
|
575
|
+
*Zero-to-Smart™ - Because your data deserves a brain upgrade*
|
|
576
|
+
|
|
577
|
+
**Built with ❤️ by [Soulcraft Research](https://soulcraft.com)**
|
|
578
|
+
*Powered by the BXL9000™ Cognitive Engine*
|
|
579
|
+
|
|
580
|
+
</div>
|