@soulcraft/brainy 5.6.1 β 5.6.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/CHANGELOG.md +12 -0
- package/README.md +145 -123
- package/dist/augmentations/typeMatching/brainyTypes.js +30 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [5.6.3](https://github.com/soulcraftlabs/brainy/compare/v5.6.2...v5.6.3) (2025-11-11)
|
|
6
|
+
|
|
7
|
+
- docs: add entity versioning to fork section (3e81fd8)
|
|
8
|
+
- docs: add asOf() time-travel to fork section (5706b71)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### [5.6.2](https://github.com/soulcraftlabs/brainy/compare/v5.6.1...v5.6.2) (2025-11-11)
|
|
12
|
+
|
|
13
|
+
- fix: update tests for Stage 3 CANONICAL taxonomy (42 nouns, 127 verbs) (c5dcdf6)
|
|
14
|
+
- docs: restructure README for better new user flow (2d3f59e)
|
|
15
|
+
|
|
16
|
+
|
|
5
17
|
## [5.6.1](https://github.com/soulcraftlabs/brainy/compare/v5.6.0...v5.6.1) (2025-11-11)
|
|
6
18
|
|
|
7
19
|
### π Bug Fixes
|
package/README.md
CHANGED
|
@@ -32,6 +32,25 @@ await brain.init()
|
|
|
32
32
|
|
|
33
33
|
---
|
|
34
34
|
|
|
35
|
+
## π Choose Your Path
|
|
36
|
+
|
|
37
|
+
**New to Brainy? Pick your starting point:**
|
|
38
|
+
|
|
39
|
+
### π Path 1: I want to build something NOW
|
|
40
|
+
**β [Complete API Reference](docs/api/README.md)** β **Most developers start here** β
|
|
41
|
+
- Every method documented with examples
|
|
42
|
+
- Quick start in 60 seconds
|
|
43
|
+
- 1,870 lines of copy-paste ready code
|
|
44
|
+
- **This is your primary resource**
|
|
45
|
+
|
|
46
|
+
### π§ Path 2: I want to understand the big picture first
|
|
47
|
+
**β Keep reading below** for demos, architecture, and use cases
|
|
48
|
+
|
|
49
|
+
### π Path 3: I'm evaluating database options
|
|
50
|
+
**β Jump to [Why Revolutionary](#why-brainy-is-revolutionary)** or **[Benchmarks](#benchmarks)**
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
35
54
|
## See It In Action
|
|
36
55
|
|
|
37
56
|
**30 seconds to understand why Brainy is different:**
|
|
@@ -72,98 +91,96 @@ const results = await brain.find({
|
|
|
72
91
|
|
|
73
92
|
---
|
|
74
93
|
|
|
75
|
-
##
|
|
94
|
+
## Quick Start
|
|
76
95
|
|
|
77
|
-
|
|
96
|
+
```bash
|
|
97
|
+
npm install @soulcraft/brainy
|
|
98
|
+
```
|
|
78
99
|
|
|
79
|
-
###
|
|
100
|
+
### Your First Knowledge Graph (60 seconds)
|
|
80
101
|
|
|
81
102
|
```javascript
|
|
82
|
-
|
|
103
|
+
import { Brainy, NounType, VerbType } from '@soulcraft/brainy'
|
|
104
|
+
|
|
83
105
|
const brain = new Brainy()
|
|
84
106
|
await brain.init()
|
|
85
107
|
|
|
86
|
-
//
|
|
87
|
-
|
|
88
|
-
|
|
108
|
+
// Add knowledge
|
|
109
|
+
const jsId = await brain.add({
|
|
110
|
+
data: "JavaScript is a programming language",
|
|
111
|
+
type: NounType.Concept,
|
|
112
|
+
metadata: { category: "language", year: 1995 }
|
|
113
|
+
})
|
|
89
114
|
|
|
90
|
-
|
|
115
|
+
const nodeId = await brain.add({
|
|
116
|
+
data: "Node.js runtime environment",
|
|
117
|
+
type: NounType.Concept,
|
|
118
|
+
metadata: { category: "runtime", year: 2009 }
|
|
119
|
+
})
|
|
91
120
|
|
|
92
|
-
|
|
121
|
+
// Create relationships
|
|
122
|
+
await brain.relate({ from: nodeId, to: jsId, type: VerbType.Executes })
|
|
93
123
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
path: './brainy-data',
|
|
100
|
-
compression: true // 60-80% space savings
|
|
101
|
-
}
|
|
124
|
+
// Query with Triple Intelligence
|
|
125
|
+
const results = await brain.find({
|
|
126
|
+
query: "JavaScript", // π Vector
|
|
127
|
+
where: { category: "language" }, // π Document
|
|
128
|
+
connected: { from: nodeId, depth: 1 } // πΈοΈ Graph
|
|
102
129
|
})
|
|
103
130
|
```
|
|
104
131
|
|
|
105
|
-
**
|
|
106
|
-
|
|
107
|
-
**
|
|
132
|
+
**Done.** No configuration. No complexity. Production-ready from day one.
|
|
133
|
+
|
|
134
|
+
**β Ready to dive deeper? [Complete API Documentation](docs/api/README.md)** has every method with examples.
|
|
108
135
|
|
|
109
|
-
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## From Prototype to Planet Scale
|
|
139
|
+
|
|
140
|
+
**The same API. Zero rewrites. Any scale.**
|
|
141
|
+
|
|
142
|
+
### π€ Individual Developer β Weekend Prototype
|
|
143
|
+
```javascript
|
|
144
|
+
const brain = new Brainy() // Zero config, starts in memory
|
|
145
|
+
await brain.init()
|
|
146
|
+
```
|
|
147
|
+
**Perfect for:** Hackathons, side projects, prototyping, learning
|
|
110
148
|
|
|
149
|
+
### π₯ Small Team β Production MVP
|
|
111
150
|
```javascript
|
|
112
|
-
// Scale to cloud - same API
|
|
113
151
|
const brain = new Brainy({
|
|
114
|
-
storage: {
|
|
115
|
-
type: 's3',
|
|
116
|
-
s3Storage: {
|
|
117
|
-
bucketName: 'my-knowledge-base',
|
|
118
|
-
region: 'us-east-1'
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
hnsw: { typeAware: true } // 87% memory reduction
|
|
152
|
+
storage: { type: 'filesystem', path: './data', compression: true }
|
|
122
153
|
})
|
|
123
154
|
```
|
|
155
|
+
**Scale:** Thousands to hundreds of thousands β’ **Performance:** <5ms queries
|
|
124
156
|
|
|
125
|
-
|
|
126
|
-
**Scale:** Millions of entities
|
|
127
|
-
**Performance:** <10ms queries, 12GB memory @ 10M entities
|
|
128
|
-
**Features:** Auto-scaling, distributed storage, cost optimization (96% savings)
|
|
129
|
-
|
|
130
|
-
### π **Enterprise / Planet Scale** β Billion+ Entities
|
|
131
|
-
|
|
157
|
+
### π’ Growing Company β Multi-Million Scale
|
|
132
158
|
```javascript
|
|
133
|
-
// Billion-scale - STILL the same API
|
|
134
159
|
const brain = new Brainy({
|
|
135
|
-
storage: {
|
|
136
|
-
|
|
137
|
-
gcsStorage: { bucketName: 'global-knowledge' }
|
|
138
|
-
},
|
|
139
|
-
hnsw: {
|
|
140
|
-
typeAware: true,
|
|
141
|
-
M: 32,
|
|
142
|
-
efConstruction: 400
|
|
143
|
-
}
|
|
160
|
+
storage: { type: 's3', s3Storage: { bucketName: 'my-kb', region: 'us-east-1' } },
|
|
161
|
+
hnsw: { typeAware: true } // 87% memory reduction
|
|
144
162
|
})
|
|
163
|
+
```
|
|
164
|
+
**Scale:** Millions of entities β’ **Performance:** <10ms queries, 12GB @ 10M entities
|
|
145
165
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
166
|
+
### π Enterprise β Billion+ Scale
|
|
167
|
+
```javascript
|
|
168
|
+
const brain = new Brainy({
|
|
169
|
+
storage: { type: 'gcs', gcsStorage: { bucketName: 'global-kb' } },
|
|
170
|
+
hnsw: { typeAware: true, M: 32, efConstruction: 400 }
|
|
149
171
|
})
|
|
150
172
|
```
|
|
151
|
-
|
|
152
|
-
**Perfect for:** Fortune 500, global platforms, research institutions, government
|
|
153
|
-
**Scale:** Billions of entities (tested at 1B+)
|
|
154
|
-
**Performance:** 18ms queries @ 1B scale, 50GB memory (87% reduction)
|
|
173
|
+
**Scale:** Billions (tested @ 1B+) β’ **Performance:** 18ms queries, 50GB memory
|
|
155
174
|
**Cost:** $138k/year β $6k/year with intelligent tiering (96% savings)
|
|
156
|
-
**Features:** Sharding, replication, monitoring, enterprise SLAs
|
|
157
175
|
|
|
158
|
-
|
|
176
|
+
**β [Capacity Planning Guide](docs/operations/capacity-planning.md)** | **[Cost Optimization](docs/operations/)**
|
|
159
177
|
|
|
160
|
-
|
|
178
|
+
### π― The Point
|
|
161
179
|
|
|
162
|
-
|
|
163
|
-
- Simple but doesn't scale (SQLite, Redis)
|
|
164
|
-
- Scales but complex (Kubernetes + 7 databases)
|
|
180
|
+
**Start simple. Scale infinitely. Never rewrite.**
|
|
165
181
|
|
|
166
|
-
|
|
182
|
+
Most systems make you choose: Simple (SQLite) OR Scalable (Kubernetes + 7 databases).
|
|
183
|
+
**Brainy gives you both.** Starts simple as SQLite. Scales like Google.
|
|
167
184
|
|
|
168
185
|
---
|
|
169
186
|
|
|
@@ -219,9 +236,9 @@ Brainy automatically:
|
|
|
219
236
|
|
|
220
237
|
**You write business logic. Brainy handles infrastructure.**
|
|
221
238
|
|
|
222
|
-
### π **
|
|
239
|
+
### π **Git-Style Version Control** β Database & Entity Level (v5.0.0+)
|
|
223
240
|
|
|
224
|
-
**Clone your entire database in <100ms.
|
|
241
|
+
**Clone your entire database in <100ms. Track every entity change. Full Git-style workflow.**
|
|
225
242
|
|
|
226
243
|
```javascript
|
|
227
244
|
// Fork instantly - Snowflake-style copy-on-write
|
|
@@ -240,19 +257,44 @@ const result = await brain.merge('test-migration', 'main', {
|
|
|
240
257
|
})
|
|
241
258
|
|
|
242
259
|
console.log(result) // { added: 1, modified: 0, conflicts: 0 }
|
|
260
|
+
|
|
261
|
+
// Time-travel: Query database at any past commit (read-only)
|
|
262
|
+
const commits = await brain.getHistory({ limit: 10 })
|
|
263
|
+
const snapshot = await brain.asOf(commits[5].id)
|
|
264
|
+
const pastResults = await snapshot.find({ query: 'historical data' })
|
|
265
|
+
await snapshot.close()
|
|
266
|
+
|
|
267
|
+
// Entity versioning: Track changes to individual entities (v5.3.0+)
|
|
268
|
+
const userId = await brain.add({ type: 'user', data: { name: 'Alice' } })
|
|
269
|
+
await brain.versions.save(userId, { tag: 'v1.0', description: 'Initial profile' })
|
|
270
|
+
|
|
271
|
+
await brain.update(userId, { data: { name: 'Alice Smith', role: 'admin' } })
|
|
272
|
+
await brain.versions.save(userId, { tag: 'v2.0', description: 'Added role' })
|
|
273
|
+
|
|
274
|
+
// Compare versions or restore previous state
|
|
275
|
+
const diff = await brain.versions.compare(userId, 1, 2) // See what changed
|
|
276
|
+
await brain.versions.restore(userId, 1) // Restore v1.0
|
|
243
277
|
```
|
|
244
278
|
|
|
245
|
-
**
|
|
279
|
+
**Database-level version control (v5.0.0):**
|
|
246
280
|
- β
`fork()` - Instant clone in <100ms
|
|
247
281
|
- β
`merge()` - Merge with conflict resolution
|
|
248
282
|
- β
`commit()` - Snapshot state
|
|
283
|
+
- β
`asOf()` - Time-travel queries (query at any commit)
|
|
249
284
|
- β
`getHistory()` - View commit history
|
|
250
285
|
- β
`checkout()`, `listBranches()` - Full branch management
|
|
251
286
|
- β
CLI support for all features
|
|
252
287
|
|
|
288
|
+
**Entity-level version control (v5.3.0):**
|
|
289
|
+
- β
`versions.save()` - Save entity snapshots with tags
|
|
290
|
+
- β
`versions.restore()` - Restore previous versions
|
|
291
|
+
- β
`versions.compare()` - Diff between versions
|
|
292
|
+
- β
`versions.list()` - View version history
|
|
293
|
+
- β
Automatic deduplication (content-addressable storage)
|
|
294
|
+
|
|
253
295
|
**How it works:** Snowflake-style COW shares HNSW index structures, copying only modified nodes (10-20% memory overhead).
|
|
254
296
|
|
|
255
|
-
**Perfect for:** Safe migrations, A/B testing, feature branches, distributed development
|
|
297
|
+
**Perfect for:** Safe migrations, A/B testing, feature branches, distributed development, time-travel debugging, audit trails, document versioning, compliance tracking
|
|
256
298
|
|
|
257
299
|
[β See Full Documentation](docs/features/instant-fork.md)
|
|
258
300
|
|
|
@@ -296,48 +338,6 @@ Every asset knows its relationships. Intelligent tagging, similarity-based disco
|
|
|
296
338
|
|
|
297
339
|
---
|
|
298
340
|
|
|
299
|
-
## Quick Start
|
|
300
|
-
|
|
301
|
-
```bash
|
|
302
|
-
npm install @soulcraft/brainy
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
### Your First Knowledge Graph (60 seconds)
|
|
306
|
-
|
|
307
|
-
```javascript
|
|
308
|
-
import { Brainy, NounType, VerbType } from '@soulcraft/brainy'
|
|
309
|
-
|
|
310
|
-
const brain = new Brainy()
|
|
311
|
-
await brain.init()
|
|
312
|
-
|
|
313
|
-
// Add knowledge
|
|
314
|
-
const jsId = await brain.add({
|
|
315
|
-
data: "JavaScript is a programming language",
|
|
316
|
-
type: NounType.Concept,
|
|
317
|
-
metadata: { category: "language", year: 1995 }
|
|
318
|
-
})
|
|
319
|
-
|
|
320
|
-
const nodeId = await brain.add({
|
|
321
|
-
data: "Node.js runtime environment",
|
|
322
|
-
type: NounType.Concept,
|
|
323
|
-
metadata: { category: "runtime", year: 2009 }
|
|
324
|
-
})
|
|
325
|
-
|
|
326
|
-
// Create relationships
|
|
327
|
-
await brain.relate({ from: nodeId, to: jsId, type: VerbType.Executes })
|
|
328
|
-
|
|
329
|
-
// Query with Triple Intelligence
|
|
330
|
-
const results = await brain.find({
|
|
331
|
-
query: "JavaScript", // π Vector
|
|
332
|
-
where: { category: "language" }, // π Document
|
|
333
|
-
connected: { from: nodeId, depth: 1 } // πΈοΈ Graph
|
|
334
|
-
})
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
**Done.** No configuration. No complexity. Production-ready from day one.
|
|
338
|
-
|
|
339
|
-
---
|
|
340
|
-
|
|
341
341
|
## Core Features
|
|
342
342
|
|
|
343
343
|
### π§ **Natural Language Queries**
|
|
@@ -355,6 +355,8 @@ await brain.find({
|
|
|
355
355
|
})
|
|
356
356
|
```
|
|
357
357
|
|
|
358
|
+
**β [See all query methods in API Reference](docs/api/README.md#search--query)**
|
|
359
|
+
|
|
358
360
|
### π **Virtual Filesystem** β Intelligent File Management
|
|
359
361
|
|
|
360
362
|
Build file explorers and IDEs that never crash:
|
|
@@ -566,40 +568,60 @@ brainy search "programming"
|
|
|
566
568
|
|
|
567
569
|
---
|
|
568
570
|
|
|
569
|
-
## Documentation
|
|
571
|
+
## π Complete Documentation
|
|
570
572
|
|
|
571
|
-
|
|
572
|
-
- **[API Reference](docs/api/README.md)** β Complete API documentation for all features
|
|
573
|
-
- **[v4.0.0 Migration Guide](docs/MIGRATION-V3-TO-V4.md)** β Upgrade from v3 (backward compatible)
|
|
573
|
+
**For most developers:** Start with the **[Complete API Reference](docs/api/README.md)** β
|
|
574
574
|
|
|
575
|
-
|
|
576
|
-
-
|
|
577
|
-
-
|
|
578
|
-
-
|
|
579
|
-
-
|
|
575
|
+
This comprehensive guide includes:
|
|
576
|
+
- β
Every method with parameters, returns, and examples
|
|
577
|
+
- β
Quick start in 60 seconds
|
|
578
|
+
- β
Core CRUD β Advanced features (branching, versioning, time-travel)
|
|
579
|
+
- β
TypeScript types and patterns
|
|
580
|
+
- β
1,870 lines of copy-paste ready code
|
|
581
|
+
|
|
582
|
+
---
|
|
583
|
+
|
|
584
|
+
### π― Essential Reading (Start Here)
|
|
585
|
+
|
|
586
|
+
1. **[π Complete API Reference](docs/api/README.md)** β **START HERE** β
|
|
587
|
+
- Your primary resource for building with Brainy
|
|
588
|
+
- Every method documented with working examples
|
|
580
589
|
|
|
581
|
-
|
|
590
|
+
2. **[Natural Language Queries](docs/guides/natural-language.md)**
|
|
591
|
+
- Master the `find()` method and Triple Intelligence queries
|
|
592
|
+
|
|
593
|
+
3. **[v4.0.0 Migration Guide](docs/MIGRATION-V3-TO-V4.md)**
|
|
594
|
+
- Upgrading from v3 (100% backward compatible)
|
|
595
|
+
|
|
596
|
+
### π§ Core Concepts & Architecture
|
|
597
|
+
|
|
598
|
+
- **[Triple Intelligence Architecture](docs/architecture/triple-intelligence.md)** β How vector + graph + document work together
|
|
599
|
+
- **[Noun-Verb Taxonomy](docs/architecture/noun-verb-taxonomy.md)** β The universal type system (42 nouns Γ 127 verbs)
|
|
582
600
|
- **[Architecture Overview](docs/architecture/overview.md)** β System design and components
|
|
583
601
|
- **[Data Storage Architecture](docs/architecture/data-storage-architecture.md)** β Type-aware indexing and HNSW
|
|
584
|
-
- **[Capacity Planning](docs/operations/capacity-planning.md)** β Memory, storage, and scaling guidelines
|
|
585
602
|
|
|
586
603
|
### βοΈ Production & Operations
|
|
604
|
+
|
|
587
605
|
- **[Cloud Deployment Guide](docs/deployment/CLOUD_DEPLOYMENT_GUIDE.md)** β Deploy to AWS, GCS, Azure
|
|
588
|
-
- **[
|
|
606
|
+
- **[Capacity Planning](docs/operations/capacity-planning.md)** β Memory, storage, and scaling to billions
|
|
607
|
+
- **Cost Optimization:** **[AWS S3](docs/operations/cost-optimization-aws-s3.md)** | **[GCS](docs/operations/cost-optimization-gcs.md)** | **[Azure](docs/operations/cost-optimization-azure.md)** | **[Cloudflare R2](docs/operations/cost-optimization-cloudflare-r2.md)**
|
|
589
608
|
|
|
590
609
|
### π Framework Integration
|
|
610
|
+
|
|
591
611
|
- **[Framework Integration Guide](docs/guides/framework-integration.md)** β React, Vue, Angular, Svelte
|
|
592
612
|
- **[Next.js Integration](docs/guides/nextjs-integration.md)**
|
|
593
613
|
- **[Vue.js Integration](docs/guides/vue-integration.md)**
|
|
594
614
|
|
|
595
|
-
### π³ Virtual Filesystem
|
|
615
|
+
### π³ Virtual Filesystem (VFS)
|
|
616
|
+
|
|
596
617
|
- **[VFS Quick Start](docs/vfs/QUICK_START.md)** β Build file explorers that never crash
|
|
597
618
|
- **[VFS Core Documentation](docs/vfs/VFS_CORE.md)**
|
|
598
|
-
- **[Semantic VFS Guide](docs/vfs/SEMANTIC_VFS.md)**
|
|
619
|
+
- **[Semantic VFS Guide](docs/vfs/SEMANTIC_VFS.md)** β AI-powered file navigation
|
|
599
620
|
- **[Neural Extraction API](docs/vfs/NEURAL_EXTRACTION.md)**
|
|
600
621
|
|
|
601
|
-
### π¦ Data Import
|
|
602
|
-
|
|
622
|
+
### π¦ Data Import & Processing
|
|
623
|
+
|
|
624
|
+
- **[Import Anything Guide](docs/guides/import-anything.md)** β CSV, Excel, PDF, URLs with auto-detection
|
|
603
625
|
|
|
604
626
|
---
|
|
605
627
|
|
|
@@ -31,6 +31,14 @@ const NOUN_TYPE_DESCRIPTIONS = {
|
|
|
31
31
|
[NounType.Organism]: 'organism animal plant bacteria fungi species living biological life creature being microorganism',
|
|
32
32
|
// Material Types (1) - Stage 3
|
|
33
33
|
[NounType.Substance]: 'substance material matter chemical element compound liquid gas solid molecule atom material',
|
|
34
|
+
// Property & Quality Types (1) - Stage 3
|
|
35
|
+
[NounType.Quality]: 'quality property attribute characteristic feature aspect trait dimension parameter value',
|
|
36
|
+
// Temporal Types (1) - Stage 3
|
|
37
|
+
[NounType.TimeInterval]: 'timeInterval period duration span range epoch era season quarter interval window',
|
|
38
|
+
// Functional Types (1) - Stage 3
|
|
39
|
+
[NounType.Function]: 'function purpose role capability capacity utility objective goal aim intent',
|
|
40
|
+
// Informational Types (1) - Stage 3
|
|
41
|
+
[NounType.Proposition]: 'proposition statement claim assertion declaration premise conclusion hypothesis theory',
|
|
34
42
|
// Digital/Content Types
|
|
35
43
|
[NounType.Document]: 'document file report article paper text pdf word contract agreement record documentation',
|
|
36
44
|
[NounType.Media]: 'media image photo video audio music podcast multimedia graphic visualization animation',
|
|
@@ -59,7 +67,18 @@ const NOUN_TYPE_DESCRIPTIONS = {
|
|
|
59
67
|
[NounType.Regulation]: 'regulation law rule policy standard compliance requirement guideline ordinance statute',
|
|
60
68
|
// Technical Infrastructure Types
|
|
61
69
|
[NounType.Interface]: 'interface API endpoint protocol specification contract schema definition connection',
|
|
62
|
-
[NounType.Resource]: 'resource infrastructure server database storage compute memory bandwidth capacity asset'
|
|
70
|
+
[NounType.Resource]: 'resource infrastructure server database storage compute memory bandwidth capacity asset',
|
|
71
|
+
// Custom/Extensible (1) - Stage 3
|
|
72
|
+
[NounType.Custom]: 'custom special unique particular specific domain-specific specialized tailored bespoke',
|
|
73
|
+
// Social Structures (3) - Stage 3
|
|
74
|
+
[NounType.SocialGroup]: 'socialGroup community tribe clan network circle collective society crowd gathering',
|
|
75
|
+
[NounType.Institution]: 'institution establishment foundation organization system structure framework tradition practice',
|
|
76
|
+
[NounType.Norm]: 'norm convention standard custom tradition protocol etiquette rule practice expectation',
|
|
77
|
+
// Information Theory (2) - Stage 3
|
|
78
|
+
[NounType.InformationContent]: 'informationContent story narrative knowledge data schema pattern model structure',
|
|
79
|
+
[NounType.InformationBearer]: 'informationBearer carrier medium vehicle signal token representation document',
|
|
80
|
+
// Meta-Level (1) - Stage 3
|
|
81
|
+
[NounType.Relationship]: 'relationship connection relation association link bond tie interaction dynamic'
|
|
63
82
|
};
|
|
64
83
|
const VERB_TYPE_DESCRIPTIONS = {
|
|
65
84
|
// Core Relationship Types
|
|
@@ -389,6 +408,16 @@ export class BrainyTypes {
|
|
|
389
408
|
generateReasoning(obj, selectedType, typeKind) {
|
|
390
409
|
const descriptions = typeKind === 'noun' ? NOUN_TYPE_DESCRIPTIONS : VERB_TYPE_DESCRIPTIONS;
|
|
391
410
|
const typeDesc = descriptions[selectedType];
|
|
411
|
+
// Handle missing descriptions gracefully
|
|
412
|
+
if (!typeDesc) {
|
|
413
|
+
if (typeKind === 'noun') {
|
|
414
|
+
const fields = Object.keys(obj).slice(0, 3).join(', ');
|
|
415
|
+
return `Matched to ${selectedType} based on semantic similarity and object fields: ${fields}`;
|
|
416
|
+
}
|
|
417
|
+
else {
|
|
418
|
+
return `Matched to ${selectedType} based on semantic similarity and relationship context`;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
392
421
|
if (typeKind === 'noun') {
|
|
393
422
|
const fields = Object.keys(obj).slice(0, 3).join(', ');
|
|
394
423
|
return `Matched to ${selectedType} based on semantic similarity to "${typeDesc.split(' ').slice(0, 5).join(' ')}..." and object fields: ${fields}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soulcraft/brainy",
|
|
3
|
-
"version": "5.6.
|
|
3
|
+
"version": "5.6.3",
|
|
4
4
|
"description": "Universal Knowledge Protocolβ’ - World's first Triple Intelligence database unifying vector, graph, and document search in one API. Stage 3 CANONICAL: 42 nouns Γ 127 verbs covering 96-97% of all human knowledge.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|