@soulcraft/brainy 0.41.0 โ†’ 0.44.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 (205) hide show
  1. package/README.md +605 -194
  2. package/dist/augmentationFactory.d.ts.map +1 -0
  3. package/dist/augmentationFactory.js +342 -0
  4. package/dist/augmentationFactory.js.map +1 -0
  5. package/dist/augmentationPipeline.d.ts.map +1 -0
  6. package/dist/augmentationPipeline.js +472 -0
  7. package/dist/augmentationPipeline.js.map +1 -0
  8. package/dist/augmentationRegistry.d.ts.map +1 -0
  9. package/dist/augmentationRegistry.js +105 -0
  10. package/dist/augmentationRegistry.js.map +1 -0
  11. package/dist/augmentationRegistryLoader.d.ts.map +1 -0
  12. package/dist/augmentationRegistryLoader.js +213 -0
  13. package/dist/augmentationRegistryLoader.js.map +1 -0
  14. package/dist/augmentations/conduitAugmentations.js +1158 -0
  15. package/dist/augmentations/conduitAugmentations.js.map +1 -0
  16. package/dist/augmentations/memoryAugmentations.d.ts +2 -0
  17. package/dist/augmentations/memoryAugmentations.d.ts.map +1 -1
  18. package/dist/augmentations/memoryAugmentations.js +270 -0
  19. package/dist/augmentations/memoryAugmentations.js.map +1 -0
  20. package/dist/augmentations/serverSearchAugmentations.js +531 -0
  21. package/dist/augmentations/serverSearchAugmentations.js.map +1 -0
  22. package/dist/brainyData.d.ts.map +1 -0
  23. package/dist/brainyData.js +3999 -0
  24. package/dist/brainyData.js.map +1 -0
  25. package/dist/browserFramework.d.ts +15 -0
  26. package/dist/browserFramework.d.ts.map +1 -0
  27. package/dist/browserFramework.js +31 -0
  28. package/dist/browserFramework.js.map +1 -0
  29. package/dist/coreTypes.d.ts.map +1 -0
  30. package/dist/coreTypes.js +5 -0
  31. package/dist/coreTypes.js.map +1 -0
  32. package/dist/demo.d.ts +106 -0
  33. package/dist/demo.d.ts.map +1 -0
  34. package/dist/demo.js +201 -0
  35. package/dist/demo.js.map +1 -0
  36. package/dist/distributed/configManager.d.ts.map +1 -0
  37. package/dist/distributed/configManager.js +322 -0
  38. package/dist/distributed/configManager.js.map +1 -0
  39. package/dist/distributed/domainDetector.d.ts.map +1 -0
  40. package/dist/distributed/domainDetector.js +307 -0
  41. package/dist/distributed/domainDetector.js.map +1 -0
  42. package/dist/distributed/hashPartitioner.d.ts.map +1 -0
  43. package/dist/distributed/hashPartitioner.js +146 -0
  44. package/dist/distributed/hashPartitioner.js.map +1 -0
  45. package/dist/distributed/healthMonitor.d.ts.map +1 -0
  46. package/dist/distributed/healthMonitor.js +244 -0
  47. package/dist/distributed/healthMonitor.js.map +1 -0
  48. package/dist/distributed/index.d.ts.map +1 -0
  49. package/dist/distributed/index.js +9 -0
  50. package/dist/distributed/index.js.map +1 -0
  51. package/dist/distributed/operationalModes.d.ts.map +1 -0
  52. package/dist/distributed/operationalModes.js +201 -0
  53. package/dist/distributed/operationalModes.js.map +1 -0
  54. package/dist/errors/brainyError.d.ts.map +1 -0
  55. package/dist/errors/brainyError.js +113 -0
  56. package/dist/errors/brainyError.js.map +1 -0
  57. package/dist/examples/basicUsage.js +118 -0
  58. package/dist/examples/basicUsage.js.map +1 -0
  59. package/dist/hnsw/distributedSearch.js +452 -0
  60. package/dist/hnsw/distributedSearch.js.map +1 -0
  61. package/dist/hnsw/hnswIndex.js +602 -0
  62. package/dist/hnsw/hnswIndex.js.map +1 -0
  63. package/dist/hnsw/hnswIndexOptimized.js +471 -0
  64. package/dist/hnsw/hnswIndexOptimized.js.map +1 -0
  65. package/dist/hnsw/optimizedHNSWIndex.js +313 -0
  66. package/dist/hnsw/optimizedHNSWIndex.js.map +1 -0
  67. package/dist/hnsw/partitionedHNSWIndex.js +304 -0
  68. package/dist/hnsw/partitionedHNSWIndex.js.map +1 -0
  69. package/dist/hnsw/scaledHNSWSystem.js +559 -0
  70. package/dist/hnsw/scaledHNSWSystem.js.map +1 -0
  71. package/dist/index.d.ts +3 -2
  72. package/dist/index.d.ts.map +1 -0
  73. package/dist/index.js +81 -0
  74. package/dist/index.js.map +1 -0
  75. package/dist/mcp/brainyMCPAdapter.js +142 -0
  76. package/dist/mcp/brainyMCPAdapter.js.map +1 -0
  77. package/dist/mcp/brainyMCPService.js +248 -0
  78. package/dist/mcp/brainyMCPService.js.map +1 -0
  79. package/dist/mcp/index.js +17 -0
  80. package/dist/mcp/index.js.map +1 -0
  81. package/dist/mcp/mcpAugmentationToolset.js +180 -0
  82. package/dist/mcp/mcpAugmentationToolset.js.map +1 -0
  83. package/dist/pipeline.d.ts.map +1 -0
  84. package/dist/pipeline.js +590 -0
  85. package/dist/pipeline.js.map +1 -0
  86. package/dist/sequentialPipeline.d.ts.map +1 -0
  87. package/dist/sequentialPipeline.js +417 -0
  88. package/dist/sequentialPipeline.js.map +1 -0
  89. package/dist/setup.d.ts.map +1 -0
  90. package/dist/setup.js +46 -0
  91. package/dist/setup.js.map +1 -0
  92. package/dist/storage/adapters/baseStorageAdapter.js +349 -0
  93. package/dist/storage/adapters/baseStorageAdapter.js.map +1 -0
  94. package/dist/storage/adapters/batchS3Operations.js +287 -0
  95. package/dist/storage/adapters/batchS3Operations.js.map +1 -0
  96. package/dist/storage/adapters/fileSystemStorage.js +846 -0
  97. package/dist/storage/adapters/fileSystemStorage.js.map +1 -0
  98. package/dist/storage/adapters/memoryStorage.js +532 -0
  99. package/dist/storage/adapters/memoryStorage.js.map +1 -0
  100. package/dist/storage/adapters/opfsStorage.d.ts.map +1 -1
  101. package/dist/storage/adapters/opfsStorage.js +1118 -0
  102. package/dist/storage/adapters/opfsStorage.js.map +1 -0
  103. package/dist/storage/adapters/optimizedS3Search.js +248 -0
  104. package/dist/storage/adapters/optimizedS3Search.js.map +1 -0
  105. package/dist/storage/adapters/s3CompatibleStorage.js +2026 -0
  106. package/dist/storage/adapters/s3CompatibleStorage.js.map +1 -0
  107. package/dist/storage/baseStorage.js +603 -0
  108. package/dist/storage/baseStorage.js.map +1 -0
  109. package/dist/storage/cacheManager.js +1306 -0
  110. package/dist/storage/cacheManager.js.map +1 -0
  111. package/dist/storage/enhancedCacheManager.js +520 -0
  112. package/dist/storage/enhancedCacheManager.js.map +1 -0
  113. package/dist/storage/readOnlyOptimizations.js +425 -0
  114. package/dist/storage/readOnlyOptimizations.js.map +1 -0
  115. package/dist/storage/storageFactory.d.ts +0 -1
  116. package/dist/storage/storageFactory.d.ts.map +1 -1
  117. package/dist/storage/storageFactory.js +227 -0
  118. package/dist/storage/storageFactory.js.map +1 -0
  119. package/dist/types/augmentations.js +16 -0
  120. package/dist/types/augmentations.js.map +1 -0
  121. package/dist/types/brainyDataInterface.js +8 -0
  122. package/dist/types/brainyDataInterface.js.map +1 -0
  123. package/dist/types/distributedTypes.js +6 -0
  124. package/dist/types/distributedTypes.js.map +1 -0
  125. package/dist/types/fileSystemTypes.js +8 -0
  126. package/dist/types/fileSystemTypes.js.map +1 -0
  127. package/dist/types/graphTypes.js +247 -0
  128. package/dist/types/graphTypes.js.map +1 -0
  129. package/dist/types/mcpTypes.js +22 -0
  130. package/dist/types/mcpTypes.js.map +1 -0
  131. package/dist/types/paginationTypes.js +5 -0
  132. package/dist/types/paginationTypes.js.map +1 -0
  133. package/dist/types/pipelineTypes.js +7 -0
  134. package/dist/types/pipelineTypes.js.map +1 -0
  135. package/dist/types/tensorflowTypes.js +6 -0
  136. package/dist/types/tensorflowTypes.js.map +1 -0
  137. package/dist/unified.d.ts.map +1 -0
  138. package/dist/unified.js +52 -128251
  139. package/dist/unified.js.map +1 -0
  140. package/dist/utils/autoConfiguration.js +341 -0
  141. package/dist/utils/autoConfiguration.js.map +1 -0
  142. package/dist/utils/cacheAutoConfig.js +261 -0
  143. package/dist/utils/cacheAutoConfig.js.map +1 -0
  144. package/dist/utils/crypto.js +45 -0
  145. package/dist/utils/crypto.js.map +1 -0
  146. package/dist/utils/distance.js +239 -0
  147. package/dist/utils/distance.js.map +1 -0
  148. package/dist/utils/embedding.d.ts.map +1 -1
  149. package/dist/utils/embedding.js +702 -0
  150. package/dist/utils/embedding.js.map +1 -0
  151. package/dist/utils/environment.js +75 -0
  152. package/dist/utils/environment.js.map +1 -0
  153. package/dist/utils/fieldNameTracking.js +90 -0
  154. package/dist/utils/fieldNameTracking.js.map +1 -0
  155. package/dist/utils/index.d.ts +1 -0
  156. package/dist/utils/index.d.ts.map +1 -1
  157. package/dist/utils/index.js +8 -0
  158. package/dist/utils/index.js.map +1 -0
  159. package/dist/utils/jsonProcessing.js +179 -0
  160. package/dist/utils/jsonProcessing.js.map +1 -0
  161. package/dist/utils/logger.js +129 -0
  162. package/dist/utils/logger.js.map +1 -0
  163. package/dist/utils/operationUtils.js +126 -0
  164. package/dist/utils/operationUtils.js.map +1 -0
  165. package/dist/utils/robustModelLoader.d.ts +14 -0
  166. package/dist/utils/robustModelLoader.d.ts.map +1 -1
  167. package/dist/utils/robustModelLoader.js +537 -0
  168. package/dist/utils/robustModelLoader.js.map +1 -0
  169. package/dist/utils/searchCache.js +248 -0
  170. package/dist/utils/searchCache.js.map +1 -0
  171. package/dist/utils/statistics.js +25 -0
  172. package/dist/utils/statistics.js.map +1 -0
  173. package/dist/utils/statisticsCollector.js +224 -0
  174. package/dist/utils/statisticsCollector.js.map +1 -0
  175. package/dist/utils/textEncoding.js +309 -0
  176. package/dist/utils/textEncoding.js.map +1 -0
  177. package/dist/utils/typeUtils.js +40 -0
  178. package/dist/utils/typeUtils.js.map +1 -0
  179. package/dist/utils/version.d.ts +15 -3
  180. package/dist/utils/version.d.ts.map +1 -1
  181. package/dist/utils/version.js +24 -0
  182. package/dist/utils/version.js.map +1 -0
  183. package/dist/utils/workerUtils.js +458 -0
  184. package/dist/utils/workerUtils.js.map +1 -0
  185. package/dist/worker.d.ts.map +1 -0
  186. package/dist/worker.js +54 -0
  187. package/dist/worker.js.map +1 -0
  188. package/package.json +30 -29
  189. package/dist/brainy.js +0 -90220
  190. package/dist/brainy.min.js +0 -12511
  191. package/dist/patched-platform-node.d.ts +0 -17
  192. package/dist/statistics/statisticsManager.d.ts +0 -121
  193. package/dist/storage/fileSystemStorage.d.ts +0 -73
  194. package/dist/storage/fileSystemStorage.d.ts.map +0 -1
  195. package/dist/storage/opfsStorage.d.ts +0 -236
  196. package/dist/storage/opfsStorage.d.ts.map +0 -1
  197. package/dist/storage/s3CompatibleStorage.d.ts +0 -157
  198. package/dist/storage/s3CompatibleStorage.d.ts.map +0 -1
  199. package/dist/testing/prettyReporter.d.ts +0 -23
  200. package/dist/testing/prettySummaryReporter.d.ts +0 -22
  201. package/dist/unified.min.js +0 -16153
  202. package/dist/utils/environmentDetection.d.ts +0 -47
  203. package/dist/utils/environmentDetection.d.ts.map +0 -1
  204. package/dist/utils/tensorflowUtils.d.ts +0 -17
  205. package/dist/utils/tensorflowUtils.d.ts.map +0 -1
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- <div align="center">
1
+ <div align="center>
2
2
  <img src="./brainy.png" alt="Brainy Logo" width="200"/>
3
3
  <br/><br/>
4
4
 
@@ -31,8 +31,8 @@ easy-to-use package.
31
31
 
32
32
  - **๐Ÿง  Zero-to-Smartโ„ข** - No config files, no tuning parameters, no DevOps headaches. Brainy auto-detects your
33
33
  environment and optimizes itself
34
- - **๐ŸŒ True Write-Once, Run-Anywhere** - Same code runs in React, Angular, Vue, Node.js, Deno, Bun, serverless, edge
35
- workers, and even vanilla HTML
34
+ - **๐ŸŒ True Write-Once, Run-Anywhere** - Same code runs in Angular, React, Vue, Node.js, Deno, Bun, serverless, edge
35
+ workers, and web workers with automatic environment detection
36
36
  - **โšก Scary Fast** - Handles millions of vectors with sub-millisecond search. Built-in GPU acceleration when available
37
37
  - **๐ŸŽฏ Self-Learning** - Like having a database that goes to the gym. Gets faster and smarter the more you use it
38
38
  - **๐Ÿ”ฎ AI-First Design** - Built for the age of embeddings, RAG, and semantic search. Your LLMs will thank you
@@ -49,75 +49,453 @@ easy-to-use package.
49
49
  - **๐Ÿ“Š Performance Monitoring** - Built-in hit rate and memory usage tracking with adaptive optimization
50
50
  - **๐ŸŽฏ Zero Breaking Changes** - All existing code works unchanged, just faster and smarter
51
51
 
52
+ ## ๐Ÿ“ฆ Get Started in 30 Seconds
53
+
54
+ ```bash
55
+ npm install @soulcraft/brainy
56
+ ```
57
+
52
58
  ```javascript
53
- // Zero configuration - everything optimized automatically!
54
- const brainy = new BrainyData() // Auto-detects environment & optimizes
55
- await brainy.init()
59
+ import { BrainyData } from '@soulcraft/brainy'
56
60
 
57
- // Caching happens automatically - no setup needed!
58
- const results1 = await brainy.search('query', 10) // ~50ms first time
59
- const results2 = await brainy.search('query', 10) // <1ms cached hit!
61
+ const brainy = new BrainyData()
62
+ await brainy.init() // Auto-detects your environment
60
63
 
61
- // Advanced pagination works instantly
62
- const page1 = await brainy.searchWithCursor('query', 100)
63
- const page2 = await brainy.searchWithCursor('query', 100, {
64
- cursor: page1.cursor // Constant time, no matter how deep!
64
+ // Add some data
65
+ await brainy.add("The quick brown fox jumps over the lazy dog")
66
+ await brainy.add("A fast fox leaps over a sleeping dog")
67
+ await brainy.add("Cats are independent and mysterious animals")
68
+
69
+ // Vector search finds similar content
70
+ const results = await brainy.search("speedy animals jumping", 2)
71
+ console.log(results) // Finds the fox sentences!
72
+ ```
73
+
74
+ **๐ŸŽฏ That's it!** You just built semantic search in 4 lines. Works in Angular, React, Vue, Node.js, browsers,
75
+ serverless - everywhere.
76
+
77
+ ## ๐Ÿš€ The Magic: Vector + Graph Database
78
+
79
+ **Most databases do one thing.** Brainy does both vector similarity AND graph relationships:
80
+
81
+ ```javascript
82
+ // Add entities with relationships
83
+ const companyId = await brainy.addNoun("OpenAI creates powerful AI models", "company")
84
+ const productId = await brainy.addNoun("GPT-4 is a large language model", "product")
85
+
86
+ // Connect them with relationships
87
+ await brainy.addVerb(companyId, productId, undefined, { type: "develops" })
88
+
89
+ // Now you can do BOTH:
90
+ const similar = await brainy.search("AI language models") // Vector similarity
91
+ const products = await brainy.getVerbsByType("develops") // Graph traversal
92
+ ```
93
+
94
+ **Why this matters:** Find content by meaning AND follow relationships. It's like having PostgreSQL and Pinecone working
95
+ together seamlessly.
96
+
97
+ ### ๐Ÿ” Want More Power?
98
+
99
+ - **Advanced graph traversal** - Complex relationship queries and multi-hop searches
100
+ - **Distributed clustering** - Scale across multiple instances with automatic coordination
101
+ - **Real-time syncing** - WebSocket and WebRTC for live data updates
102
+ - **Custom augmentations** - Extend Brainy with your own functionality
103
+
104
+ *[See full API documentation below](#-installation) for advanced features*
105
+
106
+ ## ๐ŸŽจ Build Amazing Things
107
+
108
+ **๐Ÿค– AI Chat Applications** - Build ChatGPT-like apps with long-term memory and context awareness
109
+ **๐Ÿ” Semantic Search Engines** - Search by meaning, not keywords. Find "that thing that's like a cat but bigger" โ†’
110
+ returns "tiger"
111
+ **๐ŸŽฏ Recommendation Engines** - "Users who liked this also liked..." but actually good
112
+ **๐Ÿงฌ Knowledge Graphs** - Connect everything to everything. Wikipedia meets Neo4j meets magic
113
+ **๐Ÿ‘๏ธ Computer Vision Apps** - Store and search image embeddings. "Find all photos with dogs wearing hats"
114
+ **๐ŸŽต Music Discovery** - Find songs that "feel" similar. Spotify's Discover Weekly in your app
115
+ **๐Ÿ“š Smart Documentation** - Docs that answer questions. "How do I deploy to production?" โ†’ relevant guides
116
+ **๐Ÿ›ก๏ธ Fraud Detection** - Find patterns humans can't see. Anomaly detection on steroids
117
+ **๐ŸŒ Real-Time Collaboration** - Sync vector data across devices. Figma for AI data
118
+ **๐Ÿฅ Medical Diagnosis Tools** - Match symptoms to conditions using embedding similarity
119
+
120
+ ## ๐Ÿš€ Write-Once, Run-Anywhere Quick Start
121
+
122
+ Brainy uses the same code across all environments with automatic detection. **Framework-optimized** for the best
123
+ developer experience. Choose your environment:
124
+
125
+ ### ๐Ÿ…ฐ๏ธ Angular (Latest)
126
+
127
+ ```bash
128
+ npm install @soulcraft/brainy
129
+ ```
130
+
131
+ ```typescript
132
+ import { Component, signal, OnInit } from '@angular/core'
133
+ import { BrainyData } from '@soulcraft/brainy'
134
+
135
+ @Component({
136
+ selector: 'app-search',
137
+ template: `
138
+ <div class="search-container">
139
+ <input [(ngModel)]="query"
140
+ (input)="search($event.target.value)"
141
+ placeholder="Search by meaning (try 'pets' or 'food')..."
142
+ class="search-input">
143
+
144
+ <div class="results">
145
+ @for (result of results(); track result.id) {
146
+ <div class="result-item">
147
+ <strong>{{result.metadata?.category}}</strong>: {{result.metadata?.originalData}}
148
+ <small>Similarity: {{result.score | number:'1.2-2'}}</small>
149
+ </div>
150
+ }
151
+ </div>
152
+ </div>
153
+ `
65
154
  })
155
+ export class SearchComponent implements OnInit {
156
+ private brainy: BrainyData | null = null
157
+ results = signal<any[]>([])
158
+ query = ''
159
+
160
+ async ngOnInit() {
161
+ // Auto-detects environment and uses OPFS storage in browsers
162
+ this.brainy = new BrainyData({
163
+ defaultService: 'my-app'
164
+ })
165
+ await this.brainy.init()
66
166
 
67
- // Monitor auto-optimized performance
68
- const stats = brainy.getCacheStats()
69
- console.log(`Auto-tuned cache hit rate: ${(stats.search.hitRate * 100).toFixed(1)}%`)
167
+ // Add sample data
168
+ await this.brainy.add("Cats are amazing pets", { category: "animals" })
169
+ await this.brainy.add("Dogs love to play fetch", { category: "animals" })
170
+ await this.brainy.add("Pizza is delicious food", { category: "food" })
171
+ }
172
+
173
+ async search(query: string) {
174
+ if (!query.trim() || !this.brainy) {
175
+ this.results.set([])
176
+ return
177
+ }
178
+
179
+ const searchResults = await this.brainy.search(query, 5)
180
+ this.results.set(searchResults)
181
+ }
182
+ }
70
183
  ```
71
184
 
72
- ## ๐Ÿš€ Quick Start (30 seconds!)
185
+ ### โš›๏ธ React
73
186
 
74
- ### Node.js TLDR
187
+ ```bash
188
+ npm install @soulcraft/brainy
189
+ ```
190
+
191
+ ```jsx
192
+ import { BrainyData } from '@soulcraft/brainy'
193
+ import { useEffect, useState } from 'react'
194
+
195
+ function SemanticSearch() {
196
+ const [brainy, setBrainy] = useState(null)
197
+ const [results, setResults] = useState([])
198
+ const [query, setQuery] = useState('')
199
+ const [loading, setLoading] = useState(true)
200
+
201
+ useEffect(() => {
202
+ async function initBrainy() {
203
+ // Auto-detects environment and uses OPFS storage in browsers
204
+ const db = new BrainyData({
205
+ defaultService: 'my-app'
206
+ })
207
+ await db.init()
208
+
209
+ // Add sample data
210
+ await db.add("Cats are amazing pets", { category: "animals" })
211
+ await db.add("Dogs love to play fetch", { category: "animals" })
212
+ await db.add("Pizza is delicious food", { category: "food" })
213
+
214
+ setBrainy(db)
215
+ setLoading(false)
216
+ }
217
+
218
+ initBrainy()
219
+ }, [])
220
+
221
+ const search = async (searchQuery) => {
222
+ if (!searchQuery.trim() || !brainy) return setResults([])
223
+
224
+ const searchResults = await brainy.search(searchQuery, 5)
225
+ setResults(searchResults)
226
+ }
227
+
228
+ if (loading) return <div>Initializing Brainy...</div>
229
+
230
+ return (
231
+ <div className="search-container">
232
+ <input
233
+ value={query}
234
+ onChange={(e) => {
235
+ setQuery(e.target.value)
236
+ search(e.target.value)
237
+ }}
238
+ placeholder="Search by meaning (try 'pets' or 'food')..."
239
+ className="search-input"
240
+ />
241
+
242
+ <div className="results">
243
+ {results.map((result, i) => (
244
+ <div key={result.id} className="result-item">
245
+ <strong>{result.metadata?.category}</strong>: {result.metadata?.originalData}
246
+ <small>Similarity: {result.score.toFixed(2)}</small>
247
+ </div>
248
+ ))}
249
+ </div>
250
+ </div>
251
+ )
252
+ }
253
+
254
+ export default SemanticSearch
255
+ ```
256
+
257
+ ### ๐ŸŒŸ Vue 3
75
258
 
76
259
  ```bash
77
- # Install
78
- npm install brainy
260
+ npm install @soulcraft/brainy
261
+ ```
262
+
263
+ ```vue
79
264
 
80
- # Use it
265
+ <template>
266
+ <div class="search-container">
267
+ <input
268
+ v-model="query"
269
+ @input="search"
270
+ placeholder="Search by meaning (try 'pets' or 'food')..."
271
+ class="search-input"
272
+ />
273
+
274
+ <div v-if="loading" class="loading">
275
+ Initializing Brainy...
276
+ </div>
277
+
278
+ <div v-else class="results">
279
+ <div
280
+ v-for="result in results"
281
+ :key="result.id"
282
+ class="result-item"
283
+ >
284
+ <strong>{{ result.metadata?.category }}</strong>: {{ result.metadata?.originalData }}
285
+ <small>Similarity: {{ result.score.toFixed(2) }}</small>
286
+ </div>
287
+ </div>
288
+ </div>
289
+ </template>
290
+
291
+ <script setup>
292
+ import { BrainyData } from '@soulcraft/brainy'
293
+ import { ref, onMounted } from 'vue'
294
+
295
+ const brainy = ref(null)
296
+ const results = ref([])
297
+ const query = ref('')
298
+ const loading = ref(true)
299
+
300
+ onMounted(async () => {
301
+ // Auto-detects environment and uses OPFS storage in browsers
302
+ const db = new BrainyData({
303
+ defaultService: 'my-app'
304
+ })
305
+ await db.init()
306
+
307
+ // Add sample data
308
+ await db.add("Cats are amazing pets", { category: "animals" })
309
+ await db.add("Dogs love to play fetch", { category: "animals" })
310
+ await db.add("Pizza is delicious food", { category: "food" })
311
+
312
+ brainy.value = db
313
+ loading.value = false
314
+ })
315
+
316
+ const search = async () => {
317
+ if (!query.value.trim() || !brainy.value) {
318
+ results.value = []
319
+ return
320
+ }
321
+
322
+ const searchResults = await brainy.value.search(query.value, 5)
323
+ results.value = searchResults
324
+ }
325
+ </script>
326
+
327
+ <style scoped>
328
+ .search-container {
329
+ max-width: 600px;
330
+ margin: 0 auto;
331
+ padding: 20px;
332
+ }
333
+
334
+ .search-input {
335
+ width: 100%;
336
+ padding: 12px;
337
+ margin-bottom: 20px;
338
+ border: 2px solid #ddd;
339
+ border-radius: 8px;
340
+ }
341
+
342
+ .result-item {
343
+ padding: 12px;
344
+ border: 1px solid #eee;
345
+ margin-bottom: 8px;
346
+ border-radius: 6px;
347
+ }
348
+
349
+ .loading {
350
+ text-align: center;
351
+ color: #666;
352
+ }
353
+ </style>
81
354
  ```
82
355
 
83
- ```javascript
84
- import { createAutoBrainy, NounType, VerbType } from 'brainy'
356
+ ### ๐ŸŸข Node.js Server
85
357
 
86
- const brainy = createAutoBrainy()
358
+ ```bash
359
+ npm install @soulcraft/brainy
360
+ ```
87
361
 
88
- // Add data with Nouns (entities)
89
- const catId = await brainy.add("Siamese cats are elegant and vocal", {
90
- noun: NounType.Thing,
91
- breed: "Siamese",
92
- category: "animal"
362
+ ```javascript
363
+ import { BrainyData } from '@soulcraft/brainy'
364
+
365
+ // Auto-detects Node.js โ†’ FileSystem (local) or S3 (production), Worker threads
366
+ const brainy = new BrainyData({
367
+ defaultService: 'my-app',
368
+ // Optional: Production S3 storage
369
+ storage: {
370
+ s3Storage: {
371
+ bucketName: process.env.S3_BUCKET,
372
+ region: process.env.AWS_REGION,
373
+ accessKeyId: process.env.AWS_ACCESS_KEY_ID,
374
+ secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY
375
+ }
376
+ }
93
377
  })
378
+ await brainy.init()
94
379
 
95
- const ownerId = await brainy.add("John loves his pets", {
96
- noun: NounType.Person,
97
- name: "John Smith"
98
- })
380
+ // Same API everywhere
381
+ await brainy.add("Cats are amazing pets", { category: "animals" })
382
+ const results = await brainy.search("pets", 5)
383
+ console.log('Search results:', results)
384
+ ```
99
385
 
100
- // Connect with Verbs (relationships)
101
- await brainy.addVerb(ownerId, catId, {
102
- verb: VerbType.Owns,
103
- since: "2020-01-01"
104
- })
386
+ ### โšก Serverless (Vercel/Netlify)
387
+
388
+ ```javascript
389
+ import { BrainyData } from '@soulcraft/brainy'
390
+
391
+ export default async function handler(req, res) {
392
+ // Auto-detects serverless โ†’ S3/R2 storage for persistence, or Memory for temp
393
+ const brainy = new BrainyData({
394
+ defaultService: 'my-app',
395
+ // Optional: Explicit S3-compatible storage
396
+ storage: {
397
+ r2Storage: {
398
+ bucketName: process.env.R2_BUCKET,
399
+ accessKeyId: process.env.R2_ACCESS_KEY_ID,
400
+ secretAccessKey: process.env.R2_SECRET_ACCESS_KEY,
401
+ accountId: process.env.R2_ACCOUNT_ID
402
+ }
403
+ }
404
+ })
405
+ await brainy.init()
406
+
407
+ // Same API everywhere
408
+ const results = await brainy.search(req.query.q, 5)
409
+ res.json({ results })
410
+ }
411
+ ```
412
+
413
+ ### ๐Ÿ”ฅ Cloudflare Workers
414
+
415
+ ```javascript
416
+ import { BrainyData } from '@soulcraft/brainy'
417
+
418
+ export default {
419
+ async fetch(request) {
420
+ // Auto-detects edge โ†’ Minimal footprint, KV storage
421
+ const brainy = new BrainyData({
422
+ defaultService: 'edge-app'
423
+ })
424
+ await brainy.init()
105
425
 
106
- // Search by meaning
107
- const results = await brainy.searchText("feline companions", 5)
426
+ // Same API everywhere
427
+ const url = new URL(request.url)
428
+ const results = await brainy.search(url.searchParams.get('q'), 5)
429
+ return Response.json({ results })
430
+ }
431
+ }
432
+ ```
433
+
434
+ ### ๐Ÿฆ• Deno
108
435
 
109
- // Search JSON documents by specific fields
110
- const docs = await brainy.searchDocuments("Siamese", {
111
- fields: ['breed', 'category'], // Search these fields
112
- weights: { breed: 2.0 }, // Prioritize breed matches
113
- limit: 10
436
+ ```typescript
437
+ import { BrainyData } from 'https://esm.sh/@soulcraft/brainy'
438
+
439
+ // Auto-detects Deno โ†’ Native compatibility, FileSystem storage
440
+ const brainy = new BrainyData({
441
+ defaultService: 'deno-app'
114
442
  })
443
+ await brainy.init()
115
444
 
116
- // Find relationships
117
- const johnsPets = await brainy.getVerbsBySource(ownerId, VerbType.Owns)
445
+ // Same API everywhere
446
+ await brainy.add("Deno is awesome", { category: "tech" })
447
+ const results = await brainy.search("technology", 5)
448
+ console.log(results)
449
+ ```
450
+
451
+ **That's it! Same code, everywhere. Zero-to-Smartโ„ข**
452
+
453
+ Brainy automatically detects and optimizes for:
454
+
455
+ - ๐ŸŒ **Browser frameworks** โ†’ OPFS storage, Web Workers, memory optimization
456
+ - ๐ŸŸข **Node.js servers** โ†’ FileSystem or S3/R2 storage, Worker threads, cluster support
457
+ - โšก **Serverless functions** โ†’ S3/R2 or Memory storage, cold start optimization
458
+ - ๐Ÿ”ฅ **Edge workers** โ†’ Memory or KV storage, minimal footprint
459
+ - ๐Ÿงต **Web/Worker threads** โ†’ Shared storage, thread-safe operations
460
+ - ๐Ÿฆ• **Deno/Bun runtimes** โ†’ FileSystem or S3-compatible storage, native performance
461
+
462
+ ### ๐Ÿณ NEW: Zero-Config Docker Deployment
463
+
464
+ **Deploy to any cloud with embedded models - no runtime downloads needed!**
465
+
466
+ ```dockerfile
467
+ # One line extracts models automatically during build
468
+ RUN npm run extract-models
469
+
470
+ # Deploy anywhere: Google Cloud, AWS, Azure, Cloudflare, etc.
118
471
  ```
119
472
 
120
- That's it! No config, no setup, Zero-to-Smartโ„ข
473
+ - **โšก 7x Faster Cold Starts** - Models embedded in container, no downloads
474
+ - **๐ŸŒ Universal Cloud Support** - Same Dockerfile works everywhere
475
+ - **๐Ÿ”’ Offline Ready** - No external dependencies at runtime
476
+ - **๐Ÿ“ฆ Zero Configuration** - Automatic model detection and loading
477
+
478
+ See [Docker Deployment Guide](./docs/docker-deployment.md) for complete examples.
479
+
480
+ ```javascript
481
+ // Zero configuration - everything optimized automatically!
482
+ const brainy = new BrainyData() // Auto-detects environment & optimizes
483
+ await brainy.init()
484
+
485
+ // Caching happens automatically - no setup needed!
486
+ const results1 = await brainy.search('query', 10) // ~50ms first time
487
+ const results2 = await brainy.search('query', 10) // <1ms cached hit!
488
+
489
+ // Advanced pagination works instantly
490
+ const page1 = await brainy.searchWithCursor('query', 100)
491
+ const page2 = await brainy.searchWithCursor('query', 100, {
492
+ cursor: page1.cursor // Constant time, no matter how deep!
493
+ })
494
+
495
+ // Monitor auto-optimized performance
496
+ const stats = brainy.getCacheStats()
497
+ console.log(`Auto-tuned cache hit rate: ${(stats.search.hitRate * 100).toFixed(1)}%`)
498
+ ```
121
499
 
122
500
  ### ๐ŸŒ Distributed Mode Example (NEW!)
123
501
 
@@ -161,19 +539,6 @@ console.log(`Instance ${health.instanceId}: ${health.status}`)
161
539
  - **Streaming Pipeline** - Process data in real-time as it flows through
162
540
  - **Model Control Protocol** - Let AI models access your data
163
541
 
164
- ### Smart Optimizations
165
-
166
- - **๐Ÿค– Intelligent Auto-Configuration** - Detects environment, usage patterns, and optimizes everything automatically
167
- - **โšก Runtime Performance Adaptation** - Continuously monitors and self-tunes based on real usage
168
- - **๐ŸŒ Distributed Mode Detection** - Automatically enables real-time updates for shared storage scenarios
169
- - **๐Ÿ“Š Workload-Aware Optimization** - Adapts cache size and TTL based on read/write patterns
170
- - **๐Ÿง  Adaptive Learning** - Gets smarter with usage, learns from your data access patterns
171
- - **#๏ธโƒฃ Intelligent Partitioning** - Hash-based partitioning for perfect load distribution
172
- - **๐ŸŽฏ Role-Based Optimization** - Readers maximize cache, writers optimize throughput
173
- - **๐Ÿท๏ธ Domain-Aware Indexing** - Automatic categorization improves search relevance
174
- - **๐Ÿ—‚๏ธ Multi-Level Caching** - Hot/warm/cold caching with predictive prefetching
175
- - **๐Ÿ’พ Memory Optimization** - 75% reduction with compression for large datasets
176
-
177
542
  ### Developer Experience
178
543
 
179
544
  - **TypeScript Support** - Fully typed API with generics
@@ -183,25 +548,100 @@ console.log(`Instance ${health.instanceId}: ${health.status}`)
183
548
 
184
549
  ## ๐Ÿ“ฆ Installation
185
550
 
186
- ### Main Package
551
+ ### Development: Quick Start
187
552
 
188
553
  ```bash
189
- npm install brainy
554
+ npm install @soulcraft/brainy
555
+ ```
556
+
557
+ ### โœจ Write-Once, Run-Anywhere Architecture
558
+
559
+ **Same code, every environment.** Brainy auto-detects and optimizes for your runtime:
560
+
561
+ ```javascript
562
+ // This exact code works in Angular, React, Vue, Node.js, Deno, Bun,
563
+ // serverless functions, edge workers, and web workers
564
+ import { BrainyData } from '@soulcraft/brainy'
565
+
566
+ const brainy = new BrainyData()
567
+ await brainy.init() // Auto-detects environment and chooses optimal storage
568
+
569
+ // Vector + Graph: Add entities (nouns) with relationships (verbs)
570
+ const companyId = await brainy.addNoun("OpenAI creates powerful AI models", "company", {
571
+ founded: "2015", industry: "AI"
572
+ })
573
+ const productId = await brainy.addNoun("GPT-4 is a large language model", "product", {
574
+ type: "LLM", parameters: "1.7T"
575
+ })
576
+
577
+ // Create relationships between entities
578
+ await brainy.addVerb(companyId, productId, undefined, { type: "develops" })
579
+
580
+ // Vector search finds semantically similar content
581
+ const similar = await brainy.search("AI language models", 5)
582
+
583
+ // Graph operations: explore relationships
584
+ const relationships = await brainy.getVerbsBySource(companyId)
585
+ const allProducts = await brainy.getVerbsByType("develops")
586
+ ```
587
+
588
+ ### ๐Ÿ” Advanced Graph Operations
589
+
590
+ ```javascript
591
+ // Vector search with graph filtering
592
+ const results = await brainy.search("AI models", 10, {
593
+ searchVerbs: true, // Search relationships directly
594
+ verbTypes: ["develops"], // Filter by relationship types
595
+ searchConnectedNouns: true, // Find entities connected by relationships
596
+ verbDirection: "outgoing" // Direction: outgoing, incoming, or both
597
+ })
598
+
599
+ // Graph traversal methods
600
+ const outgoing = await brainy.getVerbsBySource(entityId) // What this entity relates to
601
+ const incoming = await brainy.getVerbsByTarget(entityId) // What relates to this entity
602
+ const byType = await brainy.getVerbsByType("develops") // All relationships of this type
603
+
604
+ // Combined vector + graph search
605
+ const connected = await brainy.searchNounsByVerbs("machine learning", 5, {
606
+ verbTypes: ["develops", "uses"],
607
+ direction: "both"
608
+ })
609
+
610
+ // Get related entities through specific relationships
611
+ const related = await brainy.getRelatedNouns(companyId, { relationType: "develops" })
190
612
  ```
191
613
 
192
- ### Optional: Offline Models Package
614
+ **Universal benefits:**
615
+
616
+ - โœ… **Auto-detects everything** - Environment, storage, threading, optimization
617
+ - โœ… **Framework-optimized** - Best experience with Angular, React, Vue bundlers
618
+ - โœ… **Runtime-agnostic** - Node.js, Deno, Bun, browsers, serverless, edge
619
+ - โœ… **TypeScript-first** - Full types everywhere, IntelliSense support
620
+ - โœ… **Tree-shaking ready** - Modern bundlers import only what you need
621
+ - โœ… **ES Modules architecture** - Individual modules for better optimization by modern frameworks
622
+
623
+ ### Production: Add Offline Model Reliability
193
624
 
194
625
  ```bash
195
- npm install @soulcraft/brainy-models
626
+ # For development (online model loading)
627
+ npm install @soulcraft/brainy
628
+
629
+ # For production (offline reliability)
630
+ npm install @soulcraft/brainy @soulcraft/brainy-models
196
631
  ```
197
632
 
198
- The `@soulcraft/brainy-models` package provides **offline access** to the Universal Sentence Encoder model, eliminating
199
- network dependencies and ensuring consistent performance. Perfect for:
633
+ **Why use offline models in production?**
634
+
635
+ - **๐Ÿ›ก๏ธ 100% Reliability** - No network timeouts or blocked URLs
636
+ - **โšก Instant Startup** - Models load in ~100ms vs 5-30 seconds
637
+ - **๐Ÿณ Docker Ready** - Perfect for Cloud Run, Lambda, Kubernetes
638
+ - **๐Ÿ”’ Zero Dependencies** - No external network calls required
639
+ - **๐ŸŽฏ Zero Configuration** - Automatic detection with graceful fallback
640
+ - **๐Ÿ” Enhanced Security** - Complete air-gapping support for sensitive environments
641
+ - **๐Ÿข Enterprise Ready** - Works behind corporate firewalls and restricted networks
200
642
 
201
- - **Air-gapped environments** - No internet? No problem
202
- - **Consistent performance** - No network latency or throttling
203
- - **Privacy-focused apps** - Keep everything local
204
- - **High-reliability systems** - No external dependencies
643
+ The offline models provide the **same functionality** with maximum reliability. Your existing code works unchanged -
644
+ Brainy automatically detects and uses bundled models when available.
205
645
 
206
646
  ```javascript
207
647
  import { createAutoBrainy } from 'brainy'
@@ -213,19 +653,77 @@ const brainy = createAutoBrainy({
213
653
  })
214
654
  ```
215
655
 
216
- ## ๐ŸŽจ Build Amazing Things
656
+ ## ๐Ÿณ Docker & Cloud Deployment
217
657
 
218
- **๐Ÿค– AI Chat Applications** - Build ChatGPT-like apps with long-term memory and context awareness
219
- **๐Ÿ” Semantic Search Engines** - Search by meaning, not keywords. Find "that thing that's like a cat but bigger" โ†’
220
- returns "tiger"
221
- **๐ŸŽฏ Recommendation Engines** - "Users who liked this also liked..." but actually good
222
- **๐Ÿงฌ Knowledge Graphs** - Connect everything to everything. Wikipedia meets Neo4j meets magic
223
- **๐Ÿ‘๏ธ Computer Vision Apps** - Store and search image embeddings. "Find all photos with dogs wearing hats"
224
- **๐ŸŽต Music Discovery** - Find songs that "feel" similar. Spotify's Discover Weekly in your app
225
- **๐Ÿ“š Smart Documentation** - Docs that answer questions. "How do I deploy to production?" โ†’ relevant guides
226
- **๐Ÿ›ก๏ธ Fraud Detection** - Find patterns humans can't see. Anomaly detection on steroids
227
- **๐ŸŒ Real-Time Collaboration** - Sync vector data across devices. Figma for AI data
228
- **๐Ÿฅ Medical Diagnosis Tools** - Match symptoms to conditions using embedding similarity
658
+ **Deploy Brainy to any cloud provider with embedded models for maximum performance and reliability.**
659
+
660
+ ### Quick Docker Setup
661
+
662
+ 1. **Install models package:**
663
+ ```bash
664
+ npm install @soulcraft/brainy-models
665
+ ```
666
+
667
+ 2. **Add to your Dockerfile:**
668
+ ```dockerfile
669
+ # Extract models during build (zero configuration!)
670
+ RUN npm run extract-models
671
+
672
+ # Include models in final image
673
+ COPY --from=builder /app/models ./models
674
+ ```
675
+
676
+ 3. **Deploy anywhere:**
677
+ ```bash
678
+ # Works on all cloud providers
679
+ gcloud run deploy --source . # Google Cloud Run
680
+ aws ecs create-service ... # AWS ECS/Fargate
681
+ az container create ... # Azure Container Instances
682
+ wrangler publish # Cloudflare Workers
683
+ ```
684
+
685
+ ### Universal Dockerfile Template
686
+
687
+ ```dockerfile
688
+ FROM node:24-alpine AS builder
689
+ WORKDIR /app
690
+ COPY package*.json ./
691
+ RUN npm ci
692
+ COPY . .
693
+ RUN npm run extract-models # โ† Automatic model extraction
694
+ RUN npm run build
695
+
696
+ FROM node:24-alpine AS production
697
+ WORKDIR /app
698
+ COPY package*.json ./
699
+ RUN npm ci --only=production --omit=optional
700
+ COPY --from=builder /app/dist ./dist
701
+ COPY --from=builder /app/models ./models # โ† Models included
702
+ CMD ["node", "dist/server.js"]
703
+ ```
704
+
705
+ ### Benefits
706
+
707
+ - **โšก 7x Faster Cold Starts** - No model download delays
708
+ - **๐ŸŒ Universal Compatibility** - Same Dockerfile works on all clouds
709
+ - **๐Ÿ”’ Offline Ready** - No external dependencies at runtime
710
+ - **๐Ÿ“ฆ Zero Configuration** - Automatic model detection
711
+ - **๐Ÿ›ก๏ธ Enhanced Security** - No network calls for model loading
712
+
713
+ **๐Ÿ“– Complete Guide:** See [docs/docker-deployment.md](./docs/docker-deployment.md) for detailed examples covering Google
714
+ Cloud Run, AWS Lambda/ECS, Azure Container Instances, Cloudflare Workers, and more.
715
+
716
+ ### ๐Ÿ“ฆ Modern ES Modules Architecture
717
+
718
+ Brainy now uses individual ES modules instead of large bundles, providing better optimization for modern frameworks:
719
+
720
+ - **Better tree-shaking**: Frameworks import only the specific functions you use
721
+ - **Smaller final apps**: Your bundled application only includes what you actually need
722
+ - **Faster development builds**: No complex bundling during development
723
+ - **Better debugging**: Source maps point to individual files, not large bundles
724
+
725
+ This change reduced the package size significantly while improving compatibility with Angular, React, Vue, and other
726
+ modern framework build systems.
229
727
 
230
728
  ## ๐Ÿงฌ The Power of Nouns & Verbs
231
729
 
@@ -595,30 +1093,32 @@ const results = await brainy.searchText("JavaScript with types", 5)
595
1093
  console.log(results)
596
1094
  ```
597
1095
 
598
- ### Vanilla JavaScript
1096
+ ### ๐ŸŒ Framework-First, Runs Everywhere
599
1097
 
600
- ```html
601
- <!DOCTYPE html>
602
- <html>
603
- <head>
604
- <script type="module">
605
- import { createAutoBrainy } from 'https://unpkg.com/brainy/dist/unified.min.js'
1098
+ **Brainy is designed for modern frameworks** with automatic environment detection and storage selection:
606
1099
 
607
- window.brainy = createAutoBrainy()
1100
+ **โœจ Supported environments:**
608
1101
 
609
- window.search = async function(query) {
610
- const results = await brainy.searchText(query, 10)
611
- document.getElementById('results').innerHTML =
612
- results.map(r => `<div>${r.text}</div>`).join('')
613
- }
614
- </script>
615
- </head>
616
- <body>
617
- <input onkeyup="search(this.value)" placeholder="Search...">
618
- <div id="results"></div>
619
- </body>
620
- </html>
621
- ```
1102
+ - โš›๏ธ **React/Vue/Angular** - Framework-optimized builds with proper bundling
1103
+ - ๐ŸŸข **Node.js/Deno/Bun** - Full server-side capabilities
1104
+ - โšก **Serverless/Edge** - Optimized for cold starts and minimal footprint
1105
+ - ๐Ÿงต **Web/Worker threads** - Thread-safe, shared storage
1106
+
1107
+ **๐Ÿ—„๏ธ Auto-selected storage:**
1108
+
1109
+ - ๐ŸŒ **OPFS** - Browser frameworks (persistent, fast)
1110
+ - ๐Ÿ“ **FileSystem** - Node.js servers (local development)
1111
+ - โ˜๏ธ **S3/R2/GCS** - Production, serverless, distributed deployments
1112
+ - ๐Ÿ’พ **Memory** - Edge workers, testing, temporary data
1113
+
1114
+ **๐Ÿš€ Framework benefits:**
1115
+
1116
+ - โœ… **Proper bundling** - Handles dynamic imports and dependencies correctly
1117
+ - โœ… **Type safety** - Full TypeScript integration and IntelliSense
1118
+ - โœ… **State management** - Reactive updates and component lifecycle
1119
+ - โœ… **Production ready** - Tree-shaking, optimization, error boundaries
1120
+
1121
+ **Note:** We focus on framework support for reliability. Vanilla JS had too many module resolution issues.
622
1122
 
623
1123
  ### Cloudflare Workers
624
1124
 
@@ -865,92 +1365,7 @@ services:
865
1365
  value: persistent-disk
866
1366
  ```
867
1367
 
868
- ## ๐Ÿš€ Quick Examples
869
-
870
- ### Basic Usage
871
-
872
- ```javascript
873
- import { BrainyData, NounType, VerbType } from 'brainy'
874
-
875
- // Initialize
876
- const db = new BrainyData()
877
- await db.init()
878
-
879
- // Add data (automatically vectorized)
880
- const catId = await db.add("Cats are independent pets", {
881
- noun: NounType.Thing,
882
- category: 'animal'
883
- })
884
-
885
- // Search for similar items
886
- const results = await db.searchText("feline pets", 5)
887
-
888
- // Add relationships
889
- await db.addVerb(catId, dogId, {
890
- verb: VerbType.RelatedTo,
891
- description: 'Both are pets'
892
- })
893
- ```
894
-
895
- ### AutoBrainy (Recommended)
896
-
897
- ```javascript
898
- import { createAutoBrainy } from 'brainy'
899
-
900
- // Everything auto-configured!
901
- const brainy = createAutoBrainy()
902
-
903
- // Just start using it
904
- await brainy.addVector({ id: '1', vector: [0.1, 0.2, 0.3], text: 'Hello' })
905
- const results = await brainy.search([0.1, 0.2, 0.3], 10)
906
- ```
907
-
908
- ### Scenario-Based Setup
909
-
910
- ```javascript
911
- import { createQuickBrainy } from 'brainy'
912
-
913
- // Choose your scale: 'small', 'medium', 'large', 'enterprise'
914
- const brainy = await createQuickBrainy('large', {
915
- bucketName: 'my-vector-db'
916
- })
917
- ```
918
-
919
- ### With Offline Models
920
-
921
- ```javascript
922
- import { createAutoBrainy } from 'brainy'
923
- import { BundledUniversalSentenceEncoder } from '@soulcraft/brainy-models'
924
-
925
- // Use bundled model for offline operation
926
- const brainy = createAutoBrainy({
927
- embeddingModel: BundledUniversalSentenceEncoder,
928
- // Model loads from local files, no network needed!
929
- })
930
-
931
- // Works exactly the same, but 100% offline
932
- await brainy.add("This works without internet!", {
933
- noun: NounType.Content
934
- })
935
- ```
936
-
937
- ## ๐ŸŒ Live Demo
938
-
939
- **[Try the interactive demo](https://soulcraft-research.github.io/brainy/demo/index.html)** - See Brainy in action with
940
- animations and examples.
941
-
942
- ## ๐Ÿ”ง Environment Support
943
-
944
- | Environment | Storage | Threading | Auto-Configured |
945
- |----------------|---------------|----------------|-----------------|
946
- | Browser | OPFS | Web Workers | โœ… |
947
- | Node.js | FileSystem/S3 | Worker Threads | โœ… |
948
- | Serverless | Memory/S3 | Limited | โœ… |
949
- | Edge Functions | Memory/KV | Limited | โœ… |
950
-
951
- ## ๐Ÿ“š Documentation
952
-
953
- ### Getting Started
1368
+ ## Getting Started
954
1369
 
955
1370
  - [**Quick Start Guide**](docs/getting-started/) - Get up and running in minutes
956
1371
  - [**Installation**](docs/getting-started/installation.md) - Detailed setup instructions
@@ -999,10 +1414,6 @@ We welcome contributions! Please see:
999
1414
 
1000
1415
  [MIT](LICENSE)
1001
1416
 
1002
- ## ๐Ÿ”— Related Projects
1003
-
1004
- - [**Cartographer**](https://github.com/sodal-project/cartographer) - Standardized interfaces for Brainy
1005
-
1006
1417
  ---
1007
1418
 
1008
1419
  <div align="center">