@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 +345 -448
- package/bin/brainy.js +605 -15
- package/dist/augmentationPipeline.d.ts +19 -12
- package/dist/augmentationPipeline.js +19 -11
- package/dist/cli/catalog.d.ts +47 -0
- package/dist/cli/catalog.js +325 -0
- package/dist/cortex/cliWrapper.d.ts +32 -0
- package/dist/cortex/cliWrapper.js +209 -0
- package/dist/cortex/cortex-legacy.d.ts +264 -0
- package/dist/cortex/cortex-legacy.js +2463 -0
- package/dist/cortex/serviceIntegration.d.ts +1 -1
- package/dist/cortex/serviceIntegration.js +1 -1
- package/dist/cortex.d.ts +11 -0
- package/dist/cortex.js +14 -0
- package/dist/index.d.ts +11 -2
- package/dist/index.js +13 -3
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -4,581 +4,478 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://badge.fury.io/js/%40soulcraft%2Fbrainy)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://soulcraft.com)
|
|
8
|
+
[](https://soulcraft.com/brain-cloud)
|
|
7
9
|
[](https://nodejs.org/)
|
|
8
10
|
[](https://www.typescriptlang.org/)
|
|
9
11
|
|
|
10
|
-
# BRAINY:
|
|
12
|
+
# 🧠 BRAINY: Your AI-Powered Second Brain
|
|
11
13
|
|
|
12
|
-
**The
|
|
13
|
-
*Vector similarity • Graph relationships • Metadata facets •
|
|
14
|
+
**The World's First Multi-Dimensional AI Database™**
|
|
15
|
+
*Vector similarity • Graph relationships • Metadata facets • Neural understanding*
|
|
14
16
|
|
|
15
|
-
|
|
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
|
-
## 🚀
|
|
23
|
+
## 🚀 What Can You Build?
|
|
22
24
|
|
|
25
|
+
### 💬 **AI Chat Apps** - That Actually Remember
|
|
23
26
|
```javascript
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
###
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
|
|
65
|
-
|
|
66
|
+
const results = await brain.search("premium smartphones with metal build")
|
|
67
|
+
// Returns: iPhone (titanium matches "metal build" semantically)
|
|
66
68
|
```
|
|
67
69
|
|
|
68
|
-
###
|
|
69
|
-
|
|
70
|
+
### 🎯 **Recommendation Engines** - With Graph Intelligence
|
|
70
71
|
```javascript
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
##
|
|
94
|
-
|
|
95
|
-
```javascript
|
|
96
|
-
import { BrainyChat } from '@soulcraft/brainy'
|
|
84
|
+
## 💫 Why Brainy? The Problem We Solve
|
|
97
85
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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
|
-
|
|
97
|
+
**Your data gets superpowers. Your wallet stays happy.**
|
|
119
98
|
|
|
120
|
-
|
|
121
|
-
# Import with AI understanding
|
|
122
|
-
brainy import data.csv --cortex --understand
|
|
99
|
+
## 🎮 Try It Now - No Install Required!
|
|
123
100
|
|
|
124
|
-
|
|
125
|
-
brainy add "OpenAI" --type company --metadata '{"founded": 2015}'
|
|
101
|
+
<div align="center">
|
|
126
102
|
|
|
127
|
-
|
|
128
|
-
brainy import relationships.json --detect-entities
|
|
129
|
-
```
|
|
103
|
+
### [**→ Live Demo at soulcraft.com/console ←**](https://soulcraft.com/console)
|
|
130
104
|
|
|
131
|
-
|
|
105
|
+
Try Brainy instantly in your browser. No signup. No credit card.
|
|
132
106
|
|
|
133
|
-
|
|
134
|
-
# Search semantically
|
|
135
|
-
brainy search "artificial intelligence companies"
|
|
107
|
+
</div>
|
|
136
108
|
|
|
137
|
-
|
|
138
|
-
brainy query --filter 'funding>1000000' --type company
|
|
109
|
+
## ⚡ Quick Start (60 Seconds)
|
|
139
110
|
|
|
140
|
-
|
|
141
|
-
|
|
111
|
+
### Open Source (Local Storage)
|
|
112
|
+
```bash
|
|
113
|
+
npm install @soulcraft/brainy
|
|
142
114
|
```
|
|
143
115
|
|
|
144
|
-
|
|
116
|
+
```javascript
|
|
117
|
+
import { BrainyData } from '@soulcraft/brainy'
|
|
145
118
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
119
|
+
// Zero configuration - it just works!
|
|
120
|
+
const brain = new BrainyData()
|
|
121
|
+
await brain.init()
|
|
149
122
|
|
|
150
|
-
|
|
151
|
-
|
|
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
|
-
|
|
154
|
-
|
|
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
|
-
###
|
|
159
|
-
|
|
132
|
+
### ☁️ Brain Cloud (AI Memory + Agent Coordination)
|
|
160
133
|
```bash
|
|
161
|
-
#
|
|
162
|
-
brainy
|
|
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
|
-
#
|
|
166
|
-
|
|
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
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
-
|
|
182
|
-
|
|
145
|
+
const brain = new BrainyData()
|
|
146
|
+
const cortex = new Cortex()
|
|
183
147
|
|
|
184
|
-
|
|
148
|
+
// Add premium augmentations (requires Early Access license)
|
|
149
|
+
cortex.register(new AIMemory())
|
|
150
|
+
cortex.register(new AgentCoordinator())
|
|
185
151
|
|
|
186
|
-
|
|
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
|
-
|
|
189
|
-
|
|
190
|
-
|
|
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
|
-
//
|
|
198
|
-
await
|
|
199
|
-
|
|
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
|
-
|
|
167
|
+
## 🧩 Augmentation System - Extend Your Brain
|
|
206
168
|
|
|
207
|
-
|
|
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
|
-
|
|
213
|
-
brainy.augment({
|
|
214
|
-
type: 'PERCEPTION', // Visual/pattern recognition
|
|
215
|
-
handler: myPerceptor
|
|
216
|
-
})
|
|
173
|
+
import { NeuralImport } from '@soulcraft/brainy'
|
|
217
174
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
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
|
-
**
|
|
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
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
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
|
-
|
|
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
|
-
|
|
255
|
-
-
|
|
256
|
-
-
|
|
257
|
-
-
|
|
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
|
-
###
|
|
208
|
+
### 💼 **Premium Augmentations** (@soulcraft/brain-cloud)
|
|
209
|
+
For teams that need AI memory and enterprise features:
|
|
260
210
|
|
|
261
211
|
```javascript
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
//
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
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
|
-
|
|
280
|
-
|
|
281
|
-
**Brainy gets smarter the more you use it:**
|
|
224
|
+
cortex.register(aiMemory) // AI remembers everything
|
|
225
|
+
```
|
|
282
226
|
|
|
283
|
-
|
|
284
|
-
-
|
|
285
|
-
-
|
|
286
|
-
-
|
|
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
|
-
|
|
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
|
-
###
|
|
240
|
+
### 🎮 **Try Online** (Free Playground)
|
|
241
|
+
Test Brainy instantly without installing:
|
|
291
242
|
|
|
292
243
|
```javascript
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
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
|
-
**
|
|
312
|
-
`$and`, `$or`, `$not`
|
|
253
|
+
**[→ Open Console](https://soulcraft.com/console)** - Your code runs locally, data stays private
|
|
313
254
|
|
|
314
|
-
###
|
|
255
|
+
### ☁️ **Brain Cloud** (Managed Service)
|
|
256
|
+
For teams that want zero-ops:
|
|
315
257
|
|
|
316
258
|
```javascript
|
|
317
|
-
//
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
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
|
-
//
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
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
|
-
|
|
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
|
-
|
|
344
|
-
<summary>📦 <strong>See Framework Examples</strong></summary>
|
|
280
|
+
## 📝 Create Your Own Augmentation
|
|
345
281
|
|
|
346
|
-
|
|
282
|
+
### We ❤️ Open Source
|
|
347
283
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
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
|
-
|
|
355
|
-
brainy.init()
|
|
356
|
-
}, [])
|
|
290
|
+
### Build & Share Your Augmentation
|
|
357
291
|
|
|
358
|
-
|
|
359
|
-
|
|
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
|
-
|
|
367
|
-
|
|
368
|
-
|
|
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
|
-
|
|
383
|
-
|
|
384
|
-
|
|
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
|
-
|
|
387
|
-
export class BrainyService {
|
|
388
|
-
private brainy = new BrainyData()
|
|
326
|
+
## 🎯 Real-World Examples
|
|
389
327
|
|
|
390
|
-
|
|
391
|
-
|
|
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
|
-
|
|
395
|
-
|
|
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
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
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
|
-
|
|
414
|
-
|
|
415
|
-
|
|
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
|
-
|
|
360
|
+
// Sales Agent adds knowledge
|
|
361
|
+
await agentBrain.add("Customer interested in enterprise plan")
|
|
420
362
|
|
|
421
|
-
|
|
422
|
-
|
|
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
|
-
|
|
427
|
-
|
|
366
|
+
// Marketing Agent learns from both
|
|
367
|
+
const insights = await agentBrain.getRelated("enterprise plan")
|
|
428
368
|
```
|
|
429
369
|
|
|
430
|
-
##
|
|
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
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
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
|
-
|
|
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
|
-
|
|
551
|
-
-
|
|
552
|
-
-
|
|
553
|
-
-
|
|
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
|
-
### ⚡
|
|
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
|
-
|
|
558
|
-
-
|
|
559
|
-
-
|
|
560
|
-
-
|
|
561
|
-
-
|
|
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
|
-
##
|
|
406
|
+
## 📚 Documentation
|
|
564
407
|
|
|
565
|
-
|
|
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
|
-
|
|
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
|
-
|
|
468
|
+
### 🧠⚛️ **Give Your Data a Brain Upgrade**
|
|
576
469
|
|
|
577
|
-
**[Get Started
|
|
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
|
-
|
|
475
|
+
⭐ **Star us on GitHub to support open source AI!** ⭐
|
|
580
476
|
|
|
581
|
-
|
|
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
|
-
|
|
479
|
+
**SoulCraft** builds and maintains Brainy as open source (MIT License) because we believe AI infrastructure should be accessible to everyone.
|
|
480
|
+
|
|
481
|
+
</div>
|