@soulcraft/brainy 0.56.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.
Files changed (82) hide show
  1. package/README.md +429 -187
  2. package/bin/{cortex.js → brainy.js} +1 -1
  3. package/dist/augmentations/{neuralImportSense.d.ts → cortexSense.d.ts} +10 -10
  4. package/dist/augmentations/{neuralImportSense.js → cortexSense.js} +13 -13
  5. package/dist/augmentations/cortexSense.js.map +1 -0
  6. package/dist/augmentations/memoryAugmentations.d.ts.map +1 -1
  7. package/dist/brainyData.d.ts.map +1 -1
  8. package/dist/browserFramework.d.ts.map +1 -0
  9. package/dist/coreTypes.d.ts.map +1 -1
  10. package/dist/cortex/cli.d.ts +8 -0
  11. package/dist/cortex/cli.js +207 -0
  12. package/dist/cortex/cli.js.map +1 -0
  13. package/dist/cortex/commands/index.d.ts +79 -0
  14. package/dist/cortex/commands/index.js +614 -0
  15. package/dist/cortex/commands/index.js.map +1 -0
  16. package/dist/cortex/config.d.ts +112 -0
  17. package/dist/cortex/config.js +312 -0
  18. package/dist/cortex/config.js.map +1 -0
  19. package/dist/cortex/cortex.d.ts +1 -1
  20. package/dist/cortex/cortex.js +22 -22
  21. package/dist/cortex/cortex.js.map +1 -1
  22. package/dist/demo.d.ts.map +1 -0
  23. package/dist/distributed/configManager.d.ts.map +1 -0
  24. package/dist/distributed/domainDetector.d.ts.map +1 -0
  25. package/dist/distributed/hashPartitioner.d.ts.map +1 -0
  26. package/dist/distributed/healthMonitor.d.ts.map +1 -0
  27. package/dist/distributed/index.d.ts.map +1 -0
  28. package/dist/distributed/operationalModes.d.ts.map +1 -0
  29. package/dist/hnsw/distributedSearch.d.ts.map +1 -0
  30. package/dist/hnsw/hnswIndex.d.ts.map +1 -1
  31. package/dist/hnsw/hnswIndexOptimized.d.ts.map +1 -1
  32. package/dist/hnsw/optimizedHNSWIndex.d.ts.map +1 -0
  33. package/dist/hnsw/partitionedHNSWIndex.d.ts.map +1 -0
  34. package/dist/hnsw/scaledHNSWSystem.d.ts.map +1 -0
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/shared/default-augmentations.d.ts +6 -6
  37. package/dist/shared/default-augmentations.js +23 -23
  38. package/dist/shared/default-augmentations.js.map +1 -1
  39. package/dist/storage/adapters/baseStorageAdapter.d.ts.map +1 -1
  40. package/dist/storage/adapters/batchS3Operations.d.ts.map +1 -0
  41. package/dist/storage/adapters/fileSystemStorage.d.ts.map +1 -1
  42. package/dist/storage/adapters/memoryStorage.d.ts.map +1 -1
  43. package/dist/storage/adapters/opfsStorage.d.ts.map +1 -1
  44. package/dist/storage/adapters/optimizedS3Search.d.ts.map +1 -0
  45. package/dist/storage/adapters/s3CompatibleStorage.d.ts.map +1 -1
  46. package/dist/storage/baseStorage.d.ts.map +1 -1
  47. package/dist/storage/cacheManager.d.ts.map +1 -0
  48. package/dist/storage/enhancedCacheManager.d.ts.map +1 -0
  49. package/dist/storage/readOnlyOptimizations.d.ts.map +1 -0
  50. package/dist/storage/storageFactory.d.ts.map +1 -1
  51. package/dist/types/distributedTypes.d.ts.map +1 -0
  52. package/dist/types/paginationTypes.d.ts.map +1 -0
  53. package/dist/types/tensorflowTypes.js +6 -0
  54. package/dist/types/tensorflowTypes.js.map +1 -0
  55. package/dist/utils/autoConfiguration.d.ts.map +1 -0
  56. package/dist/utils/cacheAutoConfig.d.ts.map +1 -0
  57. package/dist/utils/crypto.d.ts.map +1 -0
  58. package/dist/utils/embedding.d.ts.map +1 -1
  59. package/dist/utils/fieldNameTracking.d.ts.map +1 -0
  60. package/dist/utils/index.d.ts.map +1 -1
  61. package/dist/utils/jsonProcessing.d.ts.map +1 -0
  62. package/dist/utils/logger.d.ts.map +1 -0
  63. package/dist/utils/robustModelLoader.d.ts +112 -0
  64. package/dist/utils/robustModelLoader.d.ts.map +1 -0
  65. package/dist/utils/robustModelLoader.js +624 -0
  66. package/dist/utils/robustModelLoader.js.map +1 -0
  67. package/dist/utils/searchCache.d.ts.map +1 -0
  68. package/dist/utils/statisticsCollector.d.ts.map +1 -0
  69. package/dist/utils/typeUtils.d.ts.map +1 -0
  70. package/dist/utils/version.d.ts.map +1 -0
  71. package/package.json +2 -2
  72. package/dist/augmentations/neuralImportSense.js.map +0 -1
  73. package/dist/patched-platform-node.d.ts +0 -17
  74. package/dist/patched-platform-node.d.ts.map +0 -1
  75. package/dist/testing/prettyReporter.d.ts +0 -23
  76. package/dist/testing/prettyReporter.d.ts.map +0 -1
  77. package/dist/testing/prettySummaryReporter.d.ts +0 -22
  78. package/dist/testing/prettySummaryReporter.d.ts.map +0 -1
  79. package/dist/unified.min.js +0 -12511
  80. package/dist/unified.min.js.map +0 -1
  81. package/dist/utils/tensorflowUtils.d.ts +0 -17
  82. 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,263 @@
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
- - **Neural Import**: 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
+ **One line. Zero complexity. Optional LLM for genius-level responses.**
84
103
  [📖 **Learn More About Brainy Chat**](BRAINY-CHAT.md)
85
104
 
86
- ## 🔥 The Power of Three-in-One Search
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:**
87
184
 
88
185
  ```javascript
89
- // This ONE query does what used to require 3 databases:
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
257
+
258
+ ```javascript
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
- ## 🌍 Works Everywhere - Same Code
276
+ ### 🧠 Self-Learning & Auto-Optimization
108
277
 
109
- **Write once, run anywhere.** Brainy auto-detects your environment:
278
+ **Brainy gets smarter the more you use it:**
110
279
 
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 |
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
- <details>
119
- <summary>🔧 <strong>Advanced Configuration Options</strong></summary>
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-throughput writer
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 service
320
+ // Read-only search cluster
129
321
  const reader = new BrainyData({
130
322
  readOnly: true,
131
- frozen: true // No stats updates
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: { bucketName: 'my-vectors' }
139
- },
140
- hnsw: {
141
- maxConnections: 32 // Higher quality
330
+ s3Storage: {
331
+ bucketName: 'my-brain',
332
+ region: 'us-east-1'
333
+ }
142
334
  }
143
335
  })
144
336
  ```
145
337
 
146
- </details>
338
+ ### 🚀 Framework Integration Examples
147
339
 
148
- ## 🎮 Cortex CLI - Command Center for Everything
340
+ <details>
341
+ <summary>📦 <strong>See Framework Examples</strong></summary>
149
342
 
150
- ```bash
151
- # Talk to your data
152
- cortex chat "What patterns do you see?"
343
+ #### React
344
+
345
+ ```jsx
346
+ import { BrainyData } from '@soulcraft/brainy'
153
347
 
154
- # AI-powered data import
155
- cortex neural import data.csv --confidence 0.8
348
+ function App() {
349
+ const [brainy] = useState(() => new BrainyData())
156
350
 
157
- # Real-time monitoring
158
- cortex monitor --dashboard
351
+ useEffect(() => {
352
+ brainy.init()
353
+ }, [])
159
354
 
160
- # Start premium trials
161
- cortex license trial notion
355
+ const search = async (query) => {
356
+ return await brainy.search(query, 10)
357
+ }
358
+
359
+ return <SearchInterface onSearch={search} />
360
+ }
162
361
  ```
163
362
 
164
- [📖 **Full Cortex Documentation**](/docs/cortex.md)
363
+ #### Vue 3
165
364
 
166
- ## ⚙️ Configuration (Optional)
365
+ ```vue
167
366
 
168
- Brainy works with **zero configuration**, but you can customize
367
+ <script setup>
368
+ import { BrainyData } from '@soulcraft/brainy'
169
369
 
370
+ const brainy = new BrainyData()
371
+ await brainy.init()
170
372
 
171
- ## 🆚 Why Not Just Use...?
373
+ const search = async (query) => {
374
+ return await brainy.search(query, 10)
375
+ }
376
+ </script>
377
+ ```
172
378
 
173
- ### vs. Multiple Databases
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
- ### 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
381
+ ```typescript
180
382
 
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
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>
398
+
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 features for enterprise needs:**
414
+ **Core Brainy is FREE forever. Premium augmentations for enterprise:**
415
+
416
+ ### 🔗 Enterprise Connectors (Coming Soon!)
188
417
 
189
- ### 🔗 Enterprise Connectors (14-day trials)
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 collaboration
193
- - **Asana** ($44/mo) - Project management
420
+ - **Slack** ($49/mo) - Team knowledge capture
421
+ - **Asana** ($44/mo) - Project intelligence
194
422
 
195
423
  ```bash
196
- cortex license trial notion # Start free trial
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
- - **🤖 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
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
- <details>
212
- <summary>📦 <strong>Framework Examples</strong></summary>
442
+ ## 📚 Complete Documentation
213
443
 
214
- ### React
215
- ```jsx
216
- import { BrainyData } from '@soulcraft/brainy'
444
+ ### Getting Started
217
445
 
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
- ```
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
- ### Vue 3
229
- ```vue
230
- <script setup>
231
- const brainy = new BrainyData()
232
- await brainy.init()
233
- </script>
234
- ```
450
+ ### Core Features
235
451
 
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
- ```
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
- ### Node.js
248
- ```javascript
249
- const brainy = new BrainyData()
250
- await brainy.init()
251
- ```
457
+ ### Advanced Topics
252
458
 
253
- </details>
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
- ## 📦 Advanced Features
472
+ ## 🆚 Why Not Just Use...?
258
473
 
259
- <details>
260
- <summary>🔧 <strong>MongoDB-Style Metadata Filtering</strong></summary>
474
+ ### vs. Multiple Databases
261
475
 
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
- ```
476
+ ❌ **Pinecone + Neo4j + Elasticsearch** = 3x cost, sync nightmares, 3 APIs
477
+ **Brainy** = One database, always synced, one simple API
272
478
 
273
- **15+ operators**: `$gt`, `$in`, `$regex`, `$and`, `$or`, etc.
479
+ ### vs. Cloud-Only Vector DBs
274
480
 
275
- </details>
481
+ ❌ **Pinecone/Weaviate** = Vendor lock-in, expensive, cloud-only
482
+ ✅ **Brainy** = Run anywhere, own your data, pay once
276
483
 
277
- <details>
278
- <summary>🔗 <strong>Graph Relationships</strong></summary>
484
+ ### vs. Traditional Graph DBs
279
485
 
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")
486
+ ❌ **Neo4j + vector plugin** = Bolt-on solution, limited capabilities
487
+ **Brainy** = Native vector+graph from the ground up
284
488
 
285
- const products = await brainy.getVerbsBySource(company)
286
- ```
489
+ ## 🚀 Real-World Performance & Scale
287
490
 
288
- </details>
491
+ **How Brainy handles production workloads:**
289
492
 
290
- <details>
291
- <summary>🐳 <strong>Docker Deployment</strong></summary>
493
+ ### 📊 Benchmark Numbers
292
494
 
293
- ```dockerfile
294
- FROM node:24-slim
295
- RUN npm run download-models # Embed models
296
- CMD ["node", "server.js"]
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
- Deploy anywhere: AWS, GCP, Azure, Cloudflare
516
+ **Scale Out (Horizontal)**
300
517
 
301
- </details>
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
- ## 📚 Documentation
531
+ ### 🏗️ Architecture That Scales
305
532
 
306
- - [Quick Start](docs/getting-started/)
307
- - [API Reference](docs/api-reference/)
308
- - [Examples](docs/examples/)
309
- - [Cortex CLI](docs/cortex.md)
310
- - [Performance Guide](docs/optimization-guides/)
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
- ## Does Brainy Impact Performance?
542
+ ## 🛸 Recent Updates
313
543
 
314
- **NO - Brainy actually IMPROVES performance:**
544
+ ### 🎯 v0.57.0 - The Cortex Revolution
315
545
 
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
546
+ - Renamed CLI from "neural" to "brainy"
547
+ - Cortex AI for data understanding
548
+ - Augmentation pipeline system
549
+ - Premium connectors framework
321
550
 
322
- **The augmentation system and premium features are 100% optional and have ZERO impact unless explicitly activated.**
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
- **[Get Started →](docs/getting-started/) | [Examples →](docs/examples/) | [Discord →](https://discord.gg/brainy)**
338
- </div>
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>