@soulcraft/brainy 0.57.0 → 0.58.0

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