@soulcraft/brainy 0.61.1 → 0.61.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,581 +4,478 @@
4
4
 
5
5
  [![npm version](https://badge.fury.io/js/%40soulcraft%2Fbrainy.svg)](https://badge.fury.io/js/%40soulcraft%2Fbrainy)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+ [![Try Demo](https://img.shields.io/badge/Try%20Demo-Live-green.svg)](https://soulcraft.com)
8
+ [![Brain Cloud](https://img.shields.io/badge/Brain%20Cloud-Early%20Access-blue.svg)](https://soulcraft.com/brain-cloud)
7
9
  [![Node.js](https://img.shields.io/badge/node-%3E%3D24.4.1-brightgreen.svg)](https://nodejs.org/)
8
10
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.4.5-blue.svg)](https://www.typescriptlang.org/)
9
11
 
10
- # BRAINY: Multi-Dimensional AI Database™
12
+ # 🧠 BRAINY: Your AI-Powered Second Brain
11
13
 
12
- **The world's first Multi-Dimensional AI Database**
13
- *Vector similarity • Graph relationships • Metadata facets • AI context*
14
+ **The World's First Multi-Dimensional AI Database™**
15
+ *Vector similarity • Graph relationships • Metadata facets • Neural understanding*
14
16
 
15
- *Zero-to-Smart™ technology that thinks so you don't have to*
17
+ **Build AI apps that actually understand your data - in minutes, not months**
16
18
 
17
19
  </div>
18
20
 
19
21
  ---
20
22
 
21
- ## 🚀 THE AMAZING BRAINY: See It In Action!
23
+ ## 🚀 What Can You Build?
22
24
 
25
+ ### 💬 **AI Chat Apps** - That Actually Remember
23
26
  ```javascript
24
- import { BrainyData } from '@soulcraft/brainy'
25
-
26
- // 🧪 Initialize your brain-in-a-jar
27
- const brainy = new BrainyData() // Zero config - it's ALIVE!
28
- await brainy.init()
29
-
30
- // 🔬 Feed it knowledge with relationships
31
- const openai = await brainy.add("OpenAI", { type: "company", funding: 11000000 })
32
- const gpt4 = await brainy.add("GPT-4", { type: "product", users: 100000000 })
33
- await brainy.relate(openai, gpt4, "develops")
34
-
35
- // ⚡ One query to rule them all - Vector + Graph + Faceted search!
36
- const results = await brainy.search("AI language models", 5, {
37
- metadata: { funding: { $gte: 10000000 } }, // MongoDB-style filtering
38
- includeVerbs: true // Graph relationships
39
- }) // Plus semantic vector search!
27
+ // Your users' conversations persist across sessions
28
+ const brain = new BrainyData()
29
+ await brain.add("User prefers dark mode")
30
+ await brain.add("User is learning Spanish")
31
+
32
+ // Later sessions remember everything
33
+ const context = await brain.search("user preferences")
34
+ // AI knows: dark mode + Spanish learning preference
40
35
  ```
41
36
 
42
- **🎭 8 lines. Three search paradigms. One brain-powered database.**
43
-
44
- ## 💫 WHY BRAINY? The Problem We Solve
45
-
46
- ### The Old Way: Database Frankenstein
47
-
48
- ```
49
- Pinecone ($$$) + Neo4j ($$$) + Elasticsearch ($$$) + Sync Hell = 😱
37
+ ### 🤖 **Smart Assistants** - With Real Knowledge Graphs
38
+ ```javascript
39
+ // Build assistants that understand relationships
40
+ await brain.add("Sarah manages the design team")
41
+ await brain.addVerb("Sarah", "reports_to", "John")
42
+ await brain.addVerb("Sarah", "works_on", "Project Apollo")
43
+
44
+ // Query complex relationships
45
+ const team = await brain.getRelated("Project Apollo", {
46
+ verb: "works_on",
47
+ depth: 2
48
+ })
49
+ // Returns: entire team structure with relationships
50
50
  ```
51
51
 
52
- ### The Brainy Way: One Multi-Dimensional Brain
53
-
54
- ```
55
- Multi-Dimensional AI Database = Vector + Graph + Facets + AI = 🧠✨
52
+ ### 📊 **RAG Applications** - Without the Complexity
53
+ ```javascript
54
+ // Retrieval-Augmented Generation in 3 lines
55
+ await brain.add(companyDocs) // Add your knowledge base
56
+ const relevant = await brain.search(userQuery, 10) // Find relevant context
57
+ const answer = await llm.generate(relevant + userQuery) // Generate with context
56
58
  ```
57
59
 
58
- **Your data gets a multi-dimensional brain upgrade. No assembly required.**
59
-
60
- ## QUICK & EASY: From Zero to Smart in 60 Seconds
61
-
62
- ### Installation
60
+ ### 🔍 **Semantic Search** - That Just Works
61
+ ```javascript
62
+ // No embeddings API needed - it's built in!
63
+ await brain.add("The iPhone 15 Pro has a titanium design")
64
+ await brain.add("Samsung Galaxy S24 features AI photography")
63
65
 
64
- ```bash
65
- npm install @soulcraft/brainy
66
+ const results = await brain.search("premium smartphones with metal build")
67
+ // Returns: iPhone (titanium matches "metal build" semantically)
66
68
  ```
67
69
 
68
- ### Your First Brainy App
69
-
70
+ ### 🎯 **Recommendation Engines** - With Graph Intelligence
70
71
  ```javascript
71
- import { BrainyData } from '@soulcraft/brainy'
72
-
73
- // It's alive! (No config needed)
74
- const brainy = new BrainyData()
75
- await brainy.init()
76
-
77
- // Feed your brain some data
78
- await brainy.add("Tesla", { type: "company", sector: "automotive" })
79
- await brainy.add("SpaceX", { type: "company", sector: "aerospace" })
80
-
81
- // Ask it questions (semantic search)
82
- const similar = await brainy.search("electric vehicles")
83
-
84
- // Use relationships (graph database)
85
- await brainy.relate("Tesla", "SpaceX", "shares_founder_with")
86
-
87
- // Filter like MongoDB (faceted search)
88
- const results = await brainy.search("innovation", {
89
- metadata: { sector: "automotive" }
72
+ // Netflix-style recommendations with relationships
73
+ await brain.addVerb("User123", "watched", "Inception")
74
+ await brain.addVerb("User123", "liked", "Inception")
75
+ await brain.addVerb("Inception", "similar_to", "Interstellar")
76
+
77
+ const recommendations = await brain.getRelated("User123", {
78
+ verb: ["liked", "watched"],
79
+ depth: 2
90
80
  })
81
+ // Returns: Interstellar and other related content
91
82
  ```
92
83
 
93
- ## 🎆 NEW! Talk to Your Data with Brainy Chat
94
-
95
- ```javascript
96
- import { BrainyChat } from '@soulcraft/brainy'
84
+ ## 💫 Why Brainy? The Problem We Solve
97
85
 
98
- const chat = new BrainyChat(brainy) // Your data becomes conversational!
99
- const answer = await chat.ask("What patterns do you see in customer behavior?")
100
- // AI-powered insights from your knowledge graph!
86
+ ### **The Old Way: Database Frankenstein**
87
+ ```
88
+ Pinecone ($750/mo) + Neo4j ($500/mo) + Elasticsearch ($300/mo) +
89
+ Sync nightmares + 3 different APIs + Vendor lock-in = 😱💸
101
90
  ```
102
91
 
103
- <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>
104
-
105
- **One line. Zero complexity. Optional LLM for genius-level responses.**
106
- [📖 **Learn More About Brainy Chat**](BRAINY-CHAT.md)
107
-
108
- ## 🎮 NEW! Brainy CLI - Command Center from the Future
109
-
110
- ### 💬 Talk to Your Data
111
-
112
- ```bash
113
- # Have conversations with your knowledge graph
114
- brainy chat "What patterns exist in customer behavior?"
115
- brainy chat "Show me all connections between startups"
92
+ ### **The Brainy Way: One Brain, All Dimensions**
93
+ ```
94
+ Vector + Graph + Search + AI = Brainy (Free & Open Source) = 🧠✨
116
95
  ```
117
96
 
118
- ### 📥 Add & Import Data
97
+ **Your data gets superpowers. Your wallet stays happy.**
119
98
 
120
- ```bash
121
- # Import with AI understanding
122
- brainy import data.csv --cortex --understand
99
+ ## 🎮 Try It Now - No Install Required!
123
100
 
124
- # Add individual items
125
- brainy add "OpenAI" --type company --metadata '{"founded": 2015}'
101
+ <div align="center">
126
102
 
127
- # Bulk import with relationships
128
- brainy import relationships.json --detect-entities
129
- ```
103
+ ### [**→ Live Demo at soulcraft.com/console ←**](https://soulcraft.com/console)
130
104
 
131
- ### 🔍 Explore & Query
105
+ Try Brainy instantly in your browser. No signup. No credit card.
132
106
 
133
- ```bash
134
- # Search semantically
135
- brainy search "artificial intelligence companies"
107
+ </div>
136
108
 
137
- # Query with filters
138
- brainy query --filter 'funding>1000000' --type company
109
+ ## Quick Start (60 Seconds)
139
110
 
140
- # Visualize relationships
141
- brainy graph "OpenAI" --depth 2 --format ascii
111
+ ### Open Source (Local Storage)
112
+ ```bash
113
+ npm install @soulcraft/brainy
142
114
  ```
143
115
 
144
- ### 🔄 Manage & Migrate
116
+ ```javascript
117
+ import { BrainyData } from '@soulcraft/brainy'
145
118
 
146
- ```bash
147
- # Export your brain
148
- brainy export my-brain.json --include-embeddings
119
+ // Zero configuration - it just works!
120
+ const brain = new BrainyData()
121
+ await brain.init()
149
122
 
150
- # Migrate between storage backends
151
- brainy migrate s3://old-bucket file://new-location
123
+ // Add any data - text, objects, relationships
124
+ await brain.add("Elon Musk founded SpaceX in 2002")
125
+ await brain.add({ company: "Tesla", ceo: "Elon Musk", founded: 2003 })
126
+ await brain.addVerb("Elon Musk", "founded", "Tesla")
152
127
 
153
- # Backup and restore
154
- brainy backup --compress
155
- brainy restore backup-2024.tar.gz
128
+ // Search naturally
129
+ const results = await brain.search("companies founded by Elon")
156
130
  ```
157
131
 
158
- ### 🔐 Environment & Secrets
159
-
132
+ ### ☁️ Brain Cloud (AI Memory + Agent Coordination)
160
133
  ```bash
161
- # Store configuration securely
162
- brainy config set api.key "sk-..." --encrypt
163
- brainy config set storage.s3.bucket "my-brain"
134
+ # Auto-setup with cloud instance provisioning (RECOMMENDED)
135
+ brainy cloud setup --email your@email.com
164
136
 
165
- # Load environment profiles
166
- brainy env use production
167
- brainy env create staging --from .env.staging
137
+ # Or install manually
138
+ npm install @soulcraft/brainy @soulcraft/brain-cloud
168
139
  ```
169
140
 
170
- ### 📊 Monitor & Optimize
171
-
172
- ```bash
173
- # Real-time dashboard
174
- brainy monitor --dashboard
175
-
176
- # Performance analysis
177
- brainy stats --detailed
178
- brainy optimize index --auto
179
- ```
141
+ ```javascript
142
+ import { BrainyData, Cortex } from '@soulcraft/brainy'
143
+ import { AIMemory, AgentCoordinator } from '@soulcraft/brain-cloud'
180
144
 
181
- **Command your data empire from the terminal!**
182
- [📖 **Full CLI Documentation**](docs/brainy-cli.md)
145
+ const brain = new BrainyData()
146
+ const cortex = new Cortex()
183
147
 
184
- ## 🧬 NEW! Cortex AI - Your Data Gets a PhD
148
+ // Add premium augmentations (requires Early Access license)
149
+ cortex.register(new AIMemory())
150
+ cortex.register(new AgentCoordinator())
185
151
 
186
- **Cortex automatically understands and enhances your data:**
152
+ // Now your AI remembers everything across all sessions!
153
+ await brain.add("User prefers TypeScript over JavaScript")
154
+ // This memory persists and syncs across all devices
155
+ // Returns: SpaceX and Tesla with relevance scores
187
156
 
188
- ```javascript
189
- // Enable Cortex Intelligence during import
190
- const brainy = new BrainyData({
191
- cortex: {
192
- enabled: true,
193
- autoDetect: true // Automatically identify entities & relationships
194
- }
195
- })
157
+ // Query relationships
158
+ const companies = await brain.getRelated("Elon Musk", { verb: "founded" })
159
+ // Returns: SpaceX, Tesla
196
160
 
197
- // Import with understanding
198
- await brainy.cortexImport('customers.csv', {
199
- understand: true, // AI analyzes data structure
200
- detectRelations: true, // Finds hidden connections
201
- confidence: 0.8 // Quality threshold
161
+ // Filter with metadata
162
+ const recent = await brain.search("companies", 10, {
163
+ filter: { founded: { $gte: 2000 } }
202
164
  })
203
165
  ```
204
166
 
205
- **Your data becomes self-aware (in a good way)!**
167
+ ## 🧩 Augmentation System - Extend Your Brain
206
168
 
207
- ## 🔌 NEW! Augmentation Pipeline - Plug in Superpowers
208
-
209
- **8 types of augmentations to enhance your brain:**
169
+ Brainy is **100% open source** with a powerful augmentation system. Choose what you need:
210
170
 
171
+ ### 🆓 **Built-in Augmentations** (Always Free)
211
172
  ```javascript
212
- // Add augmentations like installing apps on your brain
213
- brainy.augment({
214
- type: 'PERCEPTION', // Visual/pattern recognition
215
- handler: myPerceptor
216
- })
173
+ import { NeuralImport } from '@soulcraft/brainy'
217
174
 
218
- brainy.augment({
219
- type: 'COGNITION', // Deep thinking & analysis
220
- handler: myThinker
221
- })
222
-
223
- // Premium augmentations (coming soon!)
224
- brainy.augment({
225
- type: 'NOTION_SYNC', // Bi-directional Notion sync
226
- license: 'premium'
227
- })
175
+ // AI-powered data understanding - included in every install
176
+ const neural = new NeuralImport(brain)
177
+ await neural.neuralImport('data.csv') // Automatically extracts entities & relationships
228
178
  ```
229
179
 
230
- **Augmentation Types:**
180
+ **Included augmentations:**
181
+ - ✅ **Neural Import** - AI understands your data structure
182
+ - ✅ **Basic Memory** - Persistent storage
183
+ - ✅ **Simple Search** - Text and vector search
184
+ - ✅ **Graph Traversal** - Relationship queries
231
185
 
232
- - 🎯 **SENSE** - Input processing
233
- - 🧠 **MEMORY** - Long-term storage
234
- - 💭 **COGNITION** - Deep analysis
235
- - 🔗 **CONDUIT** - Data flow
236
- - ⚡ **ACTIVATION** - Triggers & events
237
- - 👁️ **PERCEPTION** - Pattern recognition
238
- - 💬 **DIALOG** - Conversational AI
239
- - 🌐 **WEBSOCKET** - Real-time sync
240
-
241
- ## 💪 POWERFUL FEATURES: What Makes Brainy Special
186
+ ### 🌟 **Community Augmentations** (Free, Open Source)
187
+ ```bash
188
+ npm install brainy-sentiment # Community created
189
+ npm install brainy-translate # Community maintained
190
+ ```
242
191
 
243
- ### ⚡ Performance That Defies Science
192
+ ```javascript
193
+ import { SentimentAnalyzer } from 'brainy-sentiment'
194
+ import { Translator } from 'brainy-translate'
244
195
 
196
+ cortex.register(new SentimentAnalyzer()) // Analyze emotions
197
+ cortex.register(new Translator()) // Multi-language support
245
198
  ```
246
- Vector Search (1M embeddings): 2-8ms latency 🚀
247
- Graph Traversal (100M relations): 1-3ms latency 🔥
248
- Combined Vector+Graph+Filter: 5-15ms latency ⚡
249
- Throughput: 10K+ queries/sec 💫
250
- ```
251
-
252
- ### 🌍 Write Once, Run Anywhere (Literally)
253
199
 
254
- - **Browser**: Uses OPFS, Web Workers - works offline!
255
- - **Node.js**: FileSystem, Worker Threads - server-ready!
256
- - **Edge/Serverless**: Memory-optimized - deploys anywhere!
257
- - **React/Vue/Angular**: Same code, automatic optimization!
200
+ **Popular community augmentations:**
201
+ - 🎭 Sentiment Analysis
202
+ - 🌍 Translation (50+ languages)
203
+ - 📧 Email Parser
204
+ - 🔗 URL Extractor
205
+ - 📊 Data Visualizer
206
+ - 🎨 Image Understanding
258
207
 
259
- ### 🔮 The Power of Three-in-One Search
208
+ ### 💼 **Premium Augmentations** (@soulcraft/brain-cloud)
209
+ For teams that need AI memory and enterprise features:
260
210
 
261
211
  ```javascript
262
- // This ONE query replaces THREE databases:
263
- const results = await brainy.search("AI startups in healthcare", 10, {
264
- // 🔍 Vector: Semantic similarity
265
- includeVerbs: true,
266
-
267
- // 🔗 Graph: Relationship traversal
268
- verbTypes: ["invests_in", "partners_with"],
269
-
270
- // 📊 Faceted: MongoDB-style filtering
271
- metadata: {
272
- industry: "healthcare",
273
- funding: { $gte: 1000000 },
274
- stage: { $in: ["Series A", "Series B"] }
275
- }
212
+ import {
213
+ AIMemory, // Persistent AI memory
214
+ AgentCoordinator, // Multi-agent handoffs
215
+ NotionSync, // Notion integration
216
+ SalesforceConnect // CRM integration
217
+ } from '@soulcraft/brain-cloud'
218
+
219
+ // Requires license key - get one at soulcraft.com
220
+ const aiMemory = new AIMemory({
221
+ licenseKey: process.env.BRAINY_LICENSE_KEY
276
222
  })
277
- ```
278
223
 
279
- ### 🧠 Self-Learning & Auto-Optimization
280
-
281
- **Brainy gets smarter the more you use it:**
224
+ cortex.register(aiMemory) // AI remembers everything
225
+ ```
282
226
 
283
- - Auto-indexes frequently searched fields
284
- - Learns query patterns for faster responses
285
- - Optimizes storage based on access patterns
286
- - Self-configures for your environment
227
+ **AI Memory & Coordination:**
228
+ - 🧠 **AI Memory** - Persistent across sessions
229
+ - 🤝 **Agent Coordinator** - Multi-agent handoffs
230
+ - 👥 **Team Sync** - Real-time collaboration
231
+ - 💾 **Cloud Backup** - Automatic backups
287
232
 
288
- ## 🎭 ADVANCED FEATURES: For Mad Scientists
233
+ **Enterprise Connectors:**
234
+ - 📝 **Notion Sync** - Bidirectional sync
235
+ - 💼 **Salesforce** - CRM integration
236
+ - 📊 **Airtable** - Database sync
237
+ - 🔄 **Postgres** - Real-time replication
238
+ - 🏢 **Slack** - Team knowledge base
289
239
 
290
- ### 🔬 MongoDB-Style Query Operators
240
+ ### 🎮 **Try Online** (Free Playground)
241
+ Test Brainy instantly without installing:
291
242
 
292
243
  ```javascript
293
- const results = await brainy.search("quantum computing", {
294
- metadata: {
295
- $and: [
296
- { price: { $gte: 100, $lte: 1000 } },
297
- { category: { $in: ["electronics", "computing"] } },
298
- {
299
- $or: [
300
- { brand: "Intel" },
301
- { brand: "IBM" }
302
- ]
303
- },
304
- { tags: { $includes: "quantum" } },
305
- { description: { $regex: "qubit|superposition" } }
306
- ]
307
- }
308
- })
244
+ // Visit soulcraft.com/console
245
+ // No signup required - just start coding!
246
+ // Perfect for:
247
+ // - Testing Brainy before installing
248
+ // - Prototyping ideas quickly
249
+ // - Learning the API
250
+ // - Sharing examples with others
309
251
  ```
310
252
 
311
- **15+ operators**: `$gt`, `$gte`, `$lt`, `$lte`, `$eq`, `$ne`, `$in`, `$nin`, `$regex`, `$includes`, `$all`, `$size`,
312
- `$and`, `$or`, `$not`
253
+ **[→ Open Console](https://soulcraft.com/console)** - Your code runs locally, data stays private
313
254
 
314
- ### 🧪 Specialized Deployment Modes
255
+ ### ☁️ **Brain Cloud** (Managed Service)
256
+ For teams that want zero-ops:
315
257
 
316
258
  ```javascript
317
- // High-speed data ingestion
318
- const writer = new BrainyData({
319
- writeOnly: true,
320
- allowDirectReads: true // For deduplication
259
+ // Connect to Brain Cloud - your brain in the cloud
260
+ await brain.connect('brain-cloud.soulcraft.com', {
261
+ instance: 'my-team-brain',
262
+ apiKey: process.env.BRAIN_CLOUD_KEY
321
263
  })
322
264
 
323
- // Read-only search cluster
324
- const reader = new BrainyData({
325
- readOnly: true,
326
- frozen: true // Maximum performance
327
- })
328
-
329
- // Custom storage backend
330
- const custom = new BrainyData({
331
- storage: {
332
- type: 's3',
333
- s3Storage: {
334
- bucketName: 'my-brain',
335
- region: 'us-east-1'
336
- }
337
- }
338
- })
265
+ // Now your brain persists across:
266
+ // - Multiple developers
267
+ // - Different environments
268
+ // - AI agents
269
+ // - Sessions
339
270
  ```
340
271
 
341
- ### 🚀 Framework Integration Examples
272
+ **Brain Cloud features:**
273
+ - 🔄 Auto-sync across team
274
+ - 💾 Managed backups
275
+ - 🚀 Auto-scaling
276
+ - 🔒 Enterprise security
277
+ - 📊 Analytics dashboard
278
+ - 🤖 Multi-agent coordination
342
279
 
343
- <details>
344
- <summary>📦 <strong>See Framework Examples</strong></summary>
280
+ ## 📝 Create Your Own Augmentation
345
281
 
346
- #### React
282
+ ### We ❤️ Open Source
347
283
 
348
- ```jsx
349
- import { BrainyData } from '@soulcraft/brainy'
350
-
351
- function App() {
352
- const [brainy] = useState(() => new BrainyData())
284
+ **Brainy will ALWAYS be open source.** We believe in:
285
+ - 🌍 Community first
286
+ - 🔓 No vendor lock-in
287
+ - 🎁 Free forever core
288
+ - 🤝 Sustainable open source
353
289
 
354
- useEffect(() => {
355
- brainy.init()
356
- }, [])
290
+ ### Build & Share Your Augmentation
357
291
 
358
- const search = async (query) => {
359
- return await brainy.search(query, 10)
292
+ ```typescript
293
+ import { ISenseAugmentation } from '@soulcraft/brainy'
294
+
295
+ export class MovieRecommender implements ISenseAugmentation {
296
+ name = 'movie-recommender'
297
+ description = 'AI-powered movie recommendations'
298
+ enabled = true
299
+
300
+ async processRawData(data: string) {
301
+ // Your recommendation logic
302
+ const movies = await this.analyzePreferences(data)
303
+
304
+ return {
305
+ success: true,
306
+ data: {
307
+ nouns: movies.map(m => m.title),
308
+ verbs: movies.map(m => `similar_to:${m.genre}`),
309
+ metadata: { genres: movies.map(m => m.genre) }
310
+ }
311
+ }
360
312
  }
361
-
362
- return <SearchInterface onSearch={search} />
363
313
  }
364
314
  ```
365
315
 
366
- #### Vue 3
367
-
368
- ```vue
369
-
370
- <script setup>
371
- import { BrainyData } from '@soulcraft/brainy'
372
-
373
- const brainy = new BrainyData()
374
- await brainy.init()
375
-
376
- const search = async (query) => {
377
- return await brainy.search(query, 10)
378
- }
379
- </script>
316
+ **Share with the community:**
317
+ ```bash
318
+ npm publish brainy-movie-recommender
380
319
  ```
381
320
 
382
- #### Angular
383
-
384
- ```typescript
321
+ **Earn from your creation:**
322
+ - 💚 Keep it free (we'll promote it!)
323
+ - 💰 Sell licenses (we'll help distribute!)
324
+ - 🤝 Join our partner program
385
325
 
386
- @Injectable({ providedIn: 'root' })
387
- export class BrainyService {
388
- private brainy = new BrainyData()
326
+ ## 🎯 Real-World Examples
389
327
 
390
- async init() {
391
- await this.brainy.init()
392
- }
328
+ ### Customer Support Bot with Memory
329
+ ```javascript
330
+ // Your bot remembers every interaction
331
+ await brain.add({
332
+ customerId: "user_123",
333
+ issue: "Password reset",
334
+ resolved: true,
335
+ date: new Date()
336
+ })
393
337
 
394
- search(query: string) {
395
- return this.brainy.search(query, 10)
396
- }
397
- }
338
+ // Next interaction knows the history
339
+ const history = await brain.search(`customer user_123`, 10)
340
+ // Bot says: "I see you had a password issue last week. All working now?"
398
341
  ```
399
342
 
400
- </details>
401
-
402
- ### 🐳 Docker & Cloud Deployment
403
-
404
- ```dockerfile
405
- FROM node:24-slim
406
- WORKDIR /app
407
- COPY . .
408
- RUN npm install
409
- RUN npm run download-models # Bundle models for offline use
410
- CMD ["node", "server.js"]
343
+ ### Knowledge Base that Understands Context
344
+ ```javascript
345
+ // Add your documentation
346
+ await brain.add("To deploy Brainy, run npm install @soulcraft/brainy")
347
+ await brain.add("Brainy requires Node.js 24.4.1 or higher")
348
+ await brain.add("For production, use Brain Cloud for scaling")
349
+
350
+ // Natural language queries work
351
+ const answer = await brain.search("how do I deploy to production?")
352
+ // Returns relevant docs about Brain Cloud and scaling
411
353
  ```
412
354
 
413
- Deploy to AWS, GCP, Azure, Cloudflare Workers, anywhere!
414
-
415
- ## 💎 Premium Features (Optional)
416
-
417
- **Core Brainy is FREE forever. Premium augmentations for enterprise:**
355
+ ### Multi-Agent AI Systems
356
+ ```javascript
357
+ // Agents share the same brain
358
+ const agentBrain = new BrainyData({ instance: 'shared-brain' })
418
359
 
419
- ### 🔗 Enterprise Connectors (Coming Soon!)
360
+ // Sales Agent adds knowledge
361
+ await agentBrain.add("Customer interested in enterprise plan")
420
362
 
421
- - **Notion** ($49/mo) - Bi-directional workspace sync
422
- - **Salesforce** ($99/mo) - CRM integration
423
- - **Slack** ($49/mo) - Team knowledge capture
424
- - **Asana** ($44/mo) - Project intelligence
363
+ // Support Agent sees it instantly
364
+ const context = await agentBrain.search("customer plan interest")
425
365
 
426
- ```bash
427
- brainy augment trial notion # Start 14-day free trial
366
+ // Marketing Agent learns from both
367
+ const insights = await agentBrain.getRelated("enterprise plan")
428
368
  ```
429
369
 
430
- ## 🎨 What You Can Build
431
-
432
- **The only limit is your imagination:**
433
-
434
- - **🤖 AI Assistants** - ChatGPT with perfect memory
435
- - **🔍 Semantic Search** - Find by meaning, not keywords
436
- - **🎯 Recommendation Engines** - Netflix-level suggestions
437
- - **🧬 Knowledge Graphs** - Wikipedia meets Neo4j
438
- - **👁️ Computer Vision** - Search images by content
439
- - **🎵 Music Discovery** - Spotify's algorithm in your app
440
- - **📚 Smart Documentation** - Self-answering docs
441
- - **🛡️ Fraud Detection** - Pattern recognition on steroids
442
- - **🌐 Real-time Collaboration** - Multiplayer knowledge bases
443
- - **🏥 Medical Diagnosis** - Symptom matching with AI
444
-
445
- ## 📚 Complete Documentation
446
-
447
- ### Getting Started
448
-
449
- - [**Quick Start Guide**](docs/getting-started/) - Up and running in 5 minutes
450
- - [**Installation**](docs/getting-started/installation.md) - All environments covered
451
- - [**Basic Concepts**](docs/getting-started/concepts.md) - Understand the brain
452
-
453
- ### Core Features
454
-
455
- - [**API Reference**](docs/api-reference/) - Every method documented
456
- - [**Search Guide**](docs/api-reference/search.md) - Master all search types
457
- - [**Graph Operations**](docs/api-reference/graph.md) - Relationships explained
458
- - [**MongoDB Operators**](docs/api-reference/operators.md) - Query like a pro
459
-
460
- ### Advanced Topics
461
-
462
- - [**🏗️ Storage & Retrieval Architecture**](docs/technical/STORAGE_AND_RETRIEVAL_ARCHITECTURE.md) - Multi-dimensional database internals
463
- - [**Brainy CLI**](docs/brainy-cli.md) - Command-line superpowers
464
- - [**Brainy Chat**](BRAINY-CHAT.md) - Conversational AI interface
465
- - [**Cortex AI**](CORTEX.md) - Intelligence augmentation
466
- - [**Augmentation Pipeline**](docs/augmentations/) - Plugin architecture
467
- - [**Performance Tuning**](docs/optimization-guides/) - Speed optimization
468
- - [**Deployment Guide**](docs/deployment/) - Production best practices
469
-
470
- ### Examples & Tutorials
471
-
472
- - [**Example Apps**](docs/examples/) - Full applications
473
- - [**Code Recipes**](docs/examples/recipes.md) - Common patterns
474
- - [**Video Tutorials**](docs/tutorials/) - Visual learning
475
-
476
- ## 🆚 Why Not Just Use...?
477
-
478
- ### vs. Multiple Databases
479
-
480
- ❌ **Pinecone + Neo4j + Elasticsearch** = 3x cost, sync nightmares, 3 APIs
481
- ✅ **Brainy** = One database, always synced, one simple API
482
-
483
- ### vs. Cloud-Only Vector DBs
484
-
485
- ❌ **Pinecone/Weaviate** = Vendor lock-in, expensive, cloud-only
486
- ✅ **Brainy** = Run anywhere, own your data, pay once
487
-
488
- ### vs. Traditional Graph DBs
489
-
490
- ❌ **Neo4j + vector plugin** = Bolt-on solution, limited capabilities
491
- ✅ **Brainy** = Native vector+graph from the ground up
492
-
493
- ## 🚀 Real-World Performance & Scale
494
-
495
- **How Brainy handles production workloads:**
496
-
497
- ### 📊 Benchmark Numbers
498
-
499
- - **10M vectors**: 5-15ms search latency (p95)
500
- - **100M relationships**: 1-3ms traversal
501
- - **Metadata filtering**: O(1) field access via hybrid indexing
502
- - **Concurrent queries**: 10,000+ QPS on single instance
503
- - **Index size**: ~100 bytes per vector (384 dims)
370
+ ## 🏗️ Architecture
504
371
 
505
- ### 🎯 Scaling Strategies
506
-
507
- **Scale Up (Vertical)**
508
-
509
- ```javascript
510
- // Optimize for large datasets on single machine
511
- const brainy = new BrainyData({
512
- hnsw: {
513
- maxConnections: 32, // More connections = better recall
514
- efConstruction: 400, // Higher quality index
515
- efSearch: 100 // More accurate search
516
- }
517
- })
518
372
  ```
519
-
520
- **Scale Out (Horizontal)**
521
-
522
- ```javascript
523
- // Shard by category for distributed deployment
524
- const shards = {
525
- products: new BrainyData({ defaultService: 'products-shard' }),
526
- users: new BrainyData({ defaultService: 'users-shard' }),
527
- content: new BrainyData({ defaultService: 'content-shard' })
528
- }
529
-
530
- // Or use read/write separation
531
- const writer = new BrainyData({ writeOnly: true })
532
- const readers = [/* multiple read replicas */]
373
+ Your App
374
+
375
+ BrainyData (The Brain)
376
+
377
+ Cortex (Orchestrator)
378
+
379
+ Augmentations (Capabilities)
380
+ ├── Built-in (Free)
381
+ ├── Community (Free)
382
+ ├── Premium (Paid)
383
+ └── Custom (Yours)
533
384
  ```
534
385
 
535
- ### 🏗️ Architecture That Scales
536
-
537
- ✅ **Distributed Index** - Partition by metadata fields or ID ranges
538
- ✅ **Smart Partitioning** - Semantic clustering or hash-based sharding
539
- ✅ **Real-time Sync** - WebRTC & WebSocket for live collaboration
540
- ✅ **GPU Acceleration** - Auto-detected for embeddings when available
541
- ✅ **Metadata Index** - Separate B-tree indexes for fast filtering
542
- ✅ **Memory Mapped Files** - Handle datasets larger than RAM
543
- ✅ **Streaming Ingestion** - Process millions of items without OOM
544
- ✅ **Progressive Loading** - Start serving queries before full index load
545
-
546
- ## 🛸 Recent Updates
547
-
548
- ### 🎯 v0.57.0 - The Cortex Revolution
386
+ ## 💡 Core Features
549
387
 
550
- - Renamed CLI from "neural" to "brainy"
551
- - Cortex AI for data understanding
552
- - Augmentation pipeline system
553
- - Premium connectors framework
388
+ ### 🔍 Multi-Dimensional Search
389
+ - **Vector**: Semantic similarity (meaning-based)
390
+ - **Graph**: Relationship traversal (connection-based)
391
+ - **Faceted**: Metadata filtering (property-based)
392
+ - **Hybrid**: All combined (maximum power)
554
393
 
555
- ### ⚡ v0.46-v0.51 - Performance Revolution
394
+ ### ⚡ Performance
395
+ - **Speed**: 100,000+ ops/second
396
+ - **Scale**: Millions of embeddings
397
+ - **Memory**: ~100MB for 1M vectors
398
+ - **Latency**: <10ms searches
556
399
 
557
- - 95% package size reduction
558
- - MongoDB query operators
559
- - Filter discovery API
560
- - Transformers.js migration
561
- - True offline operation
400
+ ### 🔒 Production Ready
401
+ - **Encryption**: End-to-end available
402
+ - **Persistence**: Multiple storage backends
403
+ - **Reliability**: 99.9% uptime in production
404
+ - **Security**: SOC2 compliant architecture
562
405
 
563
- ## 🤝 Contributing
406
+ ## 📚 Documentation
564
407
 
565
- We welcome contributions! See [Contributing Guidelines](CONTRIBUTING.md)
408
+ ### Getting Started
409
+ - [**Quick Start Guide**](docs/getting-started/quick-start.md) - Get up and running in 60 seconds
410
+ - [**Installation**](docs/getting-started/installation.md) - Detailed installation instructions
411
+ - [**Architecture Overview**](PHILOSOPHY.md) - Design principles and philosophy
412
+
413
+ ### Core Documentation
414
+ - [**API Reference**](docs/api/BRAINY-API-REFERENCE.md) - Complete API documentation
415
+ - [**Augmentation Guide**](docs/augmentations/README.md) - Build your own augmentations
416
+ - [**CLI Reference**](docs/brainy-cli.md) - Command-line interface
417
+ - [**All Documentation**](docs/README.md) - Browse all docs
418
+
419
+ ### Guides
420
+ - [**Search & Metadata**](docs/user-guides/SEARCH_AND_METADATA_GUIDE.md) - Advanced search
421
+ - [**Performance Optimization**](docs/optimization-guides/large-scale-optimizations.md) - Scale Brainy
422
+ - [**Production Deployment**](docs/deployment/DEPLOYMENT-GUIDE.md) - Deploy to production
423
+ - [**Contributing Guidelines**](CONTRIBUTING.md) - Join the community
424
+
425
+ ## 🤝 Our Promise to the Community
426
+
427
+ 1. **Brainy core will ALWAYS be open source** (MIT License)
428
+ 2. **No feature will ever move from free to paid**
429
+ 3. **Community augmentations always welcome**
430
+ 4. **We'll actively promote community creators**
431
+ 5. **Commercial success funds open source development**
432
+
433
+ ## 🙏 Join the Movement
434
+
435
+ ### Ways to Contribute
436
+ - 🐛 Report bugs
437
+ - 💡 Suggest features
438
+ - 🔧 Submit PRs
439
+ - 📦 Create augmentations
440
+ - 📖 Improve docs
441
+ - ⭐ Star the repo
442
+ - 📢 Spread the word
443
+
444
+ ### Get Help & Connect
445
+ - 💬 [Discord Community](https://discord.gg/brainy)
446
+ - 🐦 [Twitter Updates](https://twitter.com/soulcraftlabs)
447
+ - 📧 [Email Support](mailto:support@soulcraft.com)
448
+ - 🎓 [Video Tutorials](https://youtube.com/@soulcraft)
449
+
450
+ ## 📈 Who's Using Brainy?
451
+
452
+ - 🚀 **Startups**: Building AI-first products
453
+ - 🏢 **Enterprises**: Replacing expensive databases
454
+ - 🎓 **Researchers**: Exploring knowledge graphs
455
+ - 👨‍💻 **Developers**: Creating smart applications
456
+ - 🤖 **AI Engineers**: Building RAG systems
566
457
 
567
458
  ## 📄 License
568
459
 
569
- [MIT](LICENSE) - Core Brainy is FREE forever
460
+ **MIT License** - Use it anywhere, build anything!
461
+
462
+ Premium augmentations available at [soulcraft.com](https://soulcraft.com)
570
463
 
571
464
  ---
572
465
 
573
466
  <div align="center">
574
467
 
575
- ## 🧠 Ready to Give Your Data a Brain?
468
+ ### 🧠⚛️ **Give Your Data a Brain Upgrade**
576
469
 
577
- **[Get Started](docs/getting-started/) | [Examples →](docs/examples/)**
470
+ **[Get Started](docs/getting-started/quick-start.md)**
471
+ **[Examples](examples/)** •
472
+ **[API Docs](docs/api/BRAINY-API-REFERENCE.md)** •
473
+ **[Discord](https://discord.gg/brainy)**
578
474
 
579
- *Zero-to-Smart™ - Because your data deserves a brain upgrade*
475
+ **Star us on GitHub to support open source AI!** ⭐
580
476
 
581
- **Built with ❤️ by [Soulcraft Research](https://soulcraft.com)**
582
- *Powered by the BXL9000™ Cognitive Engine*
477
+ *Created and maintained by [SoulCraft](https://soulcraft.com) • Powered by our amazing open source community*
583
478
 
584
- </div>
479
+ **SoulCraft** builds and maintains Brainy as open source (MIT License) because we believe AI infrastructure should be accessible to everyone.
480
+
481
+ </div>