docs: update documentation for accurate v3.9.0 API examples and technical claims
- Fix all API examples to use proper enum syntax (NounType.Concept vs "concept") - Correct noun/verb type counts (31 noun types × 40 verb types = 1,240 combinations) - Update package references from 'brainy' to '@soulcraft/brainy' - Standardize version references to be version-agnostic - Ensure all examples match actual v3.9.0 implementation - Add proper TypeScript imports throughout documentation
This commit is contained in:
parent
6113b39109
commit
8508cfc97d
5 changed files with 43 additions and 42 deletions
54
README.md
54
README.md
|
|
@ -9,7 +9,7 @@
|
||||||
[](LICENSE)
|
[](LICENSE)
|
||||||
[](https://www.typescriptlang.org/)
|
[](https://www.typescriptlang.org/)
|
||||||
|
|
||||||
**🧠 Brainy 3.0 - Universal Knowledge Protocol™**
|
**🧠 Brainy - Universal Knowledge Protocol™**
|
||||||
|
|
||||||
**World's first Triple Intelligence™ database** unifying vector similarity, graph relationships, and document filtering in one magical API. **Framework-friendly design** works seamlessly with Next.js, React, Vue, Angular, and any modern JavaScript framework.
|
**World's first Triple Intelligence™ database** unifying vector similarity, graph relationships, and document filtering in one magical API. **Framework-friendly design** works seamlessly with Next.js, React, Vue, Angular, and any modern JavaScript framework.
|
||||||
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
**Framework-first design.** Built for modern web development with zero configuration and automatic framework compatibility. O(log n) performance, <10ms search latency, production-ready.
|
**Framework-first design.** Built for modern web development with zero configuration and automatic framework compatibility. O(log n) performance, <10ms search latency, production-ready.
|
||||||
|
|
||||||
## 🎉 What's New in 3.0
|
## 🎉 Key Features
|
||||||
|
|
||||||
### 🧠 **Triple Intelligence™ Engine**
|
### 🧠 **Triple Intelligence™ Engine**
|
||||||
|
|
||||||
|
|
@ -49,7 +49,7 @@ npm install @soulcraft/brainy
|
||||||
### 🎯 **True Zero Configuration**
|
### 🎯 **True Zero Configuration**
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import {Brainy} from '@soulcraft/brainy'
|
import { Brainy, NounType } from '@soulcraft/brainy'
|
||||||
|
|
||||||
// Just this - auto-detects everything!
|
// Just this - auto-detects everything!
|
||||||
const brain = new Brainy()
|
const brain = new Brainy()
|
||||||
|
|
@ -58,7 +58,7 @@ await brain.init()
|
||||||
// Add entities with automatic embedding
|
// Add entities with automatic embedding
|
||||||
const jsId = await brain.add({
|
const jsId = await brain.add({
|
||||||
data: "JavaScript is a programming language",
|
data: "JavaScript is a programming language",
|
||||||
type: "concept",
|
nounType: NounType.Concept,
|
||||||
metadata: {
|
metadata: {
|
||||||
type: "language",
|
type: "language",
|
||||||
year: 1995,
|
year: 1995,
|
||||||
|
|
@ -68,7 +68,7 @@ const jsId = await brain.add({
|
||||||
|
|
||||||
const nodeId = await brain.add({
|
const nodeId = await brain.add({
|
||||||
data: "Node.js runtime environment",
|
data: "Node.js runtime environment",
|
||||||
type: "concept",
|
nounType: NounType.Concept,
|
||||||
metadata: {
|
metadata: {
|
||||||
type: "runtime",
|
type: "runtime",
|
||||||
year: 2009,
|
year: 2009,
|
||||||
|
|
@ -100,7 +100,7 @@ const filtered = await brain.find({
|
||||||
|
|
||||||
## 🌐 Framework Integration
|
## 🌐 Framework Integration
|
||||||
|
|
||||||
**Brainy 3.0 is framework-first!** Works seamlessly with any modern JavaScript framework:
|
**Brainy is framework-first!** Works seamlessly with any modern JavaScript framework:
|
||||||
|
|
||||||
### ⚛️ **React & Next.js**
|
### ⚛️ **React & Next.js**
|
||||||
```javascript
|
```javascript
|
||||||
|
|
@ -194,7 +194,7 @@ If using nvm: `nvm use` (we provide a `.nvmrc` file)
|
||||||
|
|
||||||
**Enabled by Triple Intelligence, standardized for everyone:**
|
**Enabled by Triple Intelligence, standardized for everyone:**
|
||||||
|
|
||||||
- **24 Noun Types × 40 Verb Types**: 960 base combinations
|
- **31 Noun Types × 40 Verb Types**: 1,240 base combinations
|
||||||
- **∞ Expressiveness**: Unlimited metadata = model ANY data
|
- **∞ Expressiveness**: Unlimited metadata = model ANY data
|
||||||
- **One Language**: All tools, augmentations, AI models speak the same types
|
- **One Language**: All tools, augmentations, AI models speak the same types
|
||||||
- **Perfect Interoperability**: Move data between any Brainy instance
|
- **Perfect Interoperability**: Move data between any Brainy instance
|
||||||
|
|
@ -211,10 +211,10 @@ await brain.find("Documentation about authentication from last month")
|
||||||
|
|
||||||
### 🎯 Zero Configuration Philosophy
|
### 🎯 Zero Configuration Philosophy
|
||||||
|
|
||||||
Brainy 3.0 automatically configures **everything**:
|
Brainy automatically configures **everything**:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import {Brainy} from '@soulcraft/brainy'
|
import { Brainy } from '@soulcraft/brainy'
|
||||||
|
|
||||||
// 1. Pure zero-config - detects everything
|
// 1. Pure zero-config - detects everything
|
||||||
const brain = new Brainy()
|
const brain = new Brainy()
|
||||||
|
|
@ -368,6 +368,8 @@ const brain = new Brainy({
|
||||||
### Real-World Example: Social Media Firehose
|
### Real-World Example: Social Media Firehose
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
|
import { Brainy, NounType } from '@soulcraft/brainy'
|
||||||
|
|
||||||
// Ingestion nodes (optimized for writes)
|
// Ingestion nodes (optimized for writes)
|
||||||
const ingestionNode = new Brainy({
|
const ingestionNode = new Brainy({
|
||||||
storage: {type: 's3', options: {bucket: 'social-data'}},
|
storage: {type: 's3', options: {bucket: 'social-data'}},
|
||||||
|
|
@ -378,7 +380,7 @@ const ingestionNode = new Brainy({
|
||||||
// Process Bluesky firehose
|
// Process Bluesky firehose
|
||||||
blueskyStream.on('post', async (post) => {
|
blueskyStream.on('post', async (post) => {
|
||||||
await ingestionNode.add(post, {
|
await ingestionNode.add(post, {
|
||||||
nounType: 'social-post',
|
nounType: NounType.Message,
|
||||||
platform: 'bluesky',
|
platform: 'bluesky',
|
||||||
author: post.author,
|
author: post.author,
|
||||||
timestamp: post.createdAt
|
timestamp: post.createdAt
|
||||||
|
|
@ -417,21 +419,19 @@ const trending = await searchNode.find('trending AI topics', {
|
||||||
```javascript
|
```javascript
|
||||||
// Store documentation with rich relationships
|
// Store documentation with rich relationships
|
||||||
const apiGuide = await brain.add("REST API Guide", {
|
const apiGuide = await brain.add("REST API Guide", {
|
||||||
nounType: 'document',
|
nounType: NounType.Document,
|
||||||
title: "API Guide",
|
title: "API Guide",
|
||||||
category: "documentation",
|
category: "documentation",
|
||||||
version: "2.0"
|
version: "2.0"
|
||||||
})
|
})
|
||||||
|
|
||||||
const author = await brain.add("Jane Developer", {
|
const author = await brain.add("Jane Developer", {
|
||||||
nounType: 'person',
|
nounType: NounType.Person,
|
||||||
type: "person",
|
|
||||||
role: "tech-lead"
|
role: "tech-lead"
|
||||||
})
|
})
|
||||||
|
|
||||||
const project = await brain.add("E-commerce Platform", {
|
const project = await brain.add("E-commerce Platform", {
|
||||||
nounType: 'project',
|
nounType: NounType.Project,
|
||||||
type: "project",
|
|
||||||
status: "active"
|
status: "active"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -462,21 +462,18 @@ const similar = await brain.search(existingContent, {
|
||||||
```javascript
|
```javascript
|
||||||
// Store conversation with relationships
|
// Store conversation with relationships
|
||||||
const userId = await brain.add("User 123", {
|
const userId = await brain.add("User 123", {
|
||||||
nounType: 'user',
|
nounType: NounType.User,
|
||||||
type: "user",
|
|
||||||
tier: "premium"
|
tier: "premium"
|
||||||
})
|
})
|
||||||
|
|
||||||
const messageId = await brain.add(userMessage, {
|
const messageId = await brain.add(userMessage, {
|
||||||
nounType: 'message',
|
nounType: NounType.Message,
|
||||||
type: "message",
|
|
||||||
timestamp: Date.now(),
|
timestamp: Date.now(),
|
||||||
session: "abc"
|
session: "abc"
|
||||||
})
|
})
|
||||||
|
|
||||||
const topicId = await brain.add("Product Support", {
|
const topicId = await brain.add("Product Support", {
|
||||||
nounType: 'topic',
|
nounType: NounType.Topic,
|
||||||
type: "topic",
|
|
||||||
category: "support"
|
category: "support"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -602,7 +599,7 @@ for (const cluster of feedbackClusters) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find related documents
|
// Find related documents
|
||||||
const docId = await brain.add("Machine learning guide", { nounType: 'document' })
|
const docId = await brain.add("Machine learning guide", { nounType: NounType.Document })
|
||||||
const similar = await neural.neighbors(docId, 5)
|
const similar = await neural.neighbors(docId, 5)
|
||||||
// Returns 5 most similar documents
|
// Returns 5 most similar documents
|
||||||
|
|
||||||
|
|
@ -637,7 +634,7 @@ Brainy includes enterprise-grade capabilities at no extra cost. **No premium tie
|
||||||
- **Built-in monitoring** with metrics and health checks
|
- **Built-in monitoring** with metrics and health checks
|
||||||
- **Production ready** with circuit breakers and backpressure
|
- **Production ready** with circuit breakers and backpressure
|
||||||
|
|
||||||
📖 **Enterprise features coming in Brainy 3.1** - Stay tuned!
|
📖 **More enterprise features coming soon** - Stay tuned!
|
||||||
|
|
||||||
## 📊 Benchmarks
|
## 📊 Benchmarks
|
||||||
|
|
||||||
|
|
@ -651,13 +648,14 @@ Brainy includes enterprise-grade capabilities at no extra cost. **No premium tie
|
||||||
| Bulk Import (1000 items) | 2.3s | +8MB |
|
| Bulk Import (1000 items) | 2.3s | +8MB |
|
||||||
| **Production Scale (10M items)** | **5.8ms** | **12GB** |
|
| **Production Scale (10M items)** | **5.8ms** | **12GB** |
|
||||||
|
|
||||||
## 🔄 Migration from 2.x
|
## 🔄 Migration from Previous Versions
|
||||||
|
|
||||||
Key changes for upgrading to 3.0:
|
Key changes in the latest version:
|
||||||
|
|
||||||
- Search methods consolidated into `search()` and `find()`
|
- Search methods consolidated into `search()` and `find()`
|
||||||
- Result format now includes full objects with metadata
|
- Result format now includes full objects with metadata
|
||||||
- New natural language capabilities
|
- Enhanced natural language capabilities
|
||||||
|
- Distributed architecture support
|
||||||
|
|
||||||
## 🤝 Contributing
|
## 🤝 Contributing
|
||||||
|
|
||||||
|
|
@ -678,10 +676,10 @@ We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
||||||
### The Math of Infinite Expressiveness
|
### The Math of Infinite Expressiveness
|
||||||
|
|
||||||
```
|
```
|
||||||
24 Nouns × 40 Verbs × ∞ Metadata × Triple Intelligence = Universal Protocol
|
31 Nouns × 40 Verbs × ∞ Metadata × Triple Intelligence = Universal Protocol
|
||||||
```
|
```
|
||||||
|
|
||||||
- **960 base combinations** from standardized types
|
- **1,240 base combinations** from standardized types
|
||||||
- **∞ domain specificity** via unlimited metadata
|
- **∞ domain specificity** via unlimited metadata
|
||||||
- **∞ relationship depth** via graph traversal
|
- **∞ relationship depth** via graph traversal
|
||||||
- **= Model ANYTHING**: From quantum physics to social networks
|
- **= Model ANYTHING**: From quantum physics to social networks
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ Get up and running with Brainy in 5 minutes!
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install brainy
|
npm install @soulcraft/brainy
|
||||||
```
|
```
|
||||||
|
|
||||||
Or install globally for CLI access:
|
Or install globally for CLI access:
|
||||||
|
|
@ -18,7 +18,7 @@ npm install -g brainy
|
||||||
### 1. Initialize Brainy
|
### 1. Initialize Brainy
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import { BrainyData } from 'brainy'
|
import { BrainyData, NounType } from '@soulcraft/brainy'
|
||||||
|
|
||||||
const brain = new BrainyData()
|
const brain = new BrainyData()
|
||||||
await brain.init()
|
await brain.init()
|
||||||
|
|
@ -34,11 +34,11 @@ That's it! No configuration needed. Brainy automatically:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
// Add a simple string
|
// Add a simple string
|
||||||
await brain.add("JavaScript is a versatile programming language", { nounType: 'concept' })
|
await brain.add("JavaScript is a versatile programming language", { nounType: NounType.Concept })
|
||||||
|
|
||||||
// Add with metadata
|
// Add with metadata
|
||||||
await brain.add("React is a JavaScript library", {
|
await brain.add("React is a JavaScript library", {
|
||||||
nounType: 'concept',
|
nounType: NounType.Concept,
|
||||||
type: "library",
|
type: "library",
|
||||||
category: "frontend",
|
category: "frontend",
|
||||||
popularity: "high"
|
popularity: "high"
|
||||||
|
|
@ -50,7 +50,7 @@ await brain.add({
|
||||||
content: "TypeScript adds static typing to JavaScript",
|
content: "TypeScript adds static typing to JavaScript",
|
||||||
author: "John Doe"
|
author: "John Doe"
|
||||||
}, {
|
}, {
|
||||||
nounType: 'document',
|
nounType: NounType.Document,
|
||||||
type: "article",
|
type: "article",
|
||||||
date: "2024-01-15"
|
date: "2024-01-15"
|
||||||
})
|
})
|
||||||
|
|
@ -77,11 +77,11 @@ const libraries = await brain.search("JavaScript", {
|
||||||
### Example 1: Document Search System
|
### Example 1: Document Search System
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import { BrainyData } from 'brainy'
|
import { BrainyData, NounType } from '@soulcraft/brainy'
|
||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
|
|
||||||
const brain = new BrainyData({
|
const brain = new BrainyData({
|
||||||
storage: {
|
storage: {
|
||||||
type: 'filesystem',
|
type: 'filesystem',
|
||||||
path: './document-index'
|
path: './document-index'
|
||||||
}
|
}
|
||||||
|
|
@ -97,6 +97,7 @@ const documents = [
|
||||||
|
|
||||||
for (const doc of documents) {
|
for (const doc of documents) {
|
||||||
await brain.add(doc.content, {
|
await brain.add(doc.content, {
|
||||||
|
nounType: NounType.Document,
|
||||||
filename: doc.file,
|
filename: doc.file,
|
||||||
type: 'documentation',
|
type: 'documentation',
|
||||||
indexed: new Date().toISOString()
|
indexed: new Date().toISOString()
|
||||||
|
|
@ -112,7 +113,7 @@ results.forEach(r => console.log(`- ${r.metadata.filename} (${(r.score * 100).to
|
||||||
### Example 2: AI Chat with Memory
|
### Example 2: AI Chat with Memory
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import { BrainyData } from 'brainy'
|
import { BrainyData, NounType } from '@soulcraft/brainy'
|
||||||
|
|
||||||
const brain = new BrainyData()
|
const brain = new BrainyData()
|
||||||
await brain.init()
|
await brain.init()
|
||||||
|
|
@ -125,6 +126,7 @@ class ChatWithMemory {
|
||||||
|
|
||||||
async addMessage(role, content) {
|
async addMessage(role, content) {
|
||||||
await this.brain.add(content, {
|
await this.brain.add(content, {
|
||||||
|
nounType: NounType.Message,
|
||||||
role,
|
role,
|
||||||
sessionId: this.sessionId,
|
sessionId: this.sessionId,
|
||||||
timestamp: Date.now()
|
timestamp: Date.now()
|
||||||
|
|
@ -164,7 +166,7 @@ const response = await chat.chat("What did we discuss about JavaScript?")
|
||||||
### Example 3: Semantic Code Search
|
### Example 3: Semantic Code Search
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import { BrainyData } from 'brainy'
|
import { BrainyData, NounType } from '@soulcraft/brainy'
|
||||||
import { glob } from 'glob'
|
import { glob } from 'glob'
|
||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
|
|
||||||
|
|
@ -180,6 +182,7 @@ for (const file of files) {
|
||||||
const functions = content.match(/function\s+(\w+)|const\s+(\w+)\s*=/g) || []
|
const functions = content.match(/function\s+(\w+)|const\s+(\w+)\s*=/g) || []
|
||||||
|
|
||||||
await brain.add(content, {
|
await brain.add(content, {
|
||||||
|
nounType: NounType.File,
|
||||||
file,
|
file,
|
||||||
type: 'code',
|
type: 'code',
|
||||||
language: 'javascript',
|
language: 'javascript',
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# 🚀 Brainy 3.0 - Production-Ready Features
|
# 🚀 Brainy - Production-Ready Features
|
||||||
|
|
||||||
> **Status**: All features listed here are IMPLEMENTED and TESTED
|
> **Status**: All features listed here are IMPLEMENTED and TESTED
|
||||||
|
|
||||||
|
|
@ -292,5 +292,5 @@ These features are documented but NOT yet implemented:
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
*Last Updated: Brainy 3.0.0*
|
*Last Updated: Latest Version*
|
||||||
*All features listed above are production-ready and tested*
|
*All features listed above are production-ready and tested*
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
Brainy 3.0 introduces a groundbreaking **zero-configuration distributed system** that transforms how vector databases scale. Unlike traditional distributed databases that require complex setup (Consul, etcd, Zookeeper), Brainy uses your existing storage (S3, GCS, R2) as the coordination layer.
|
Brainy introduces a groundbreaking **zero-configuration distributed system** that transforms how vector databases scale. Unlike traditional distributed databases that require complex setup (Consul, etcd, Zookeeper), Brainy uses your existing storage (S3, GCS, R2) as the coordination layer.
|
||||||
|
|
||||||
## Key Innovation: Storage-Based Coordination
|
## Key Innovation: Storage-Based Coordination
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ This guide will help you get up and running with Brainy, the multi-dimensional A
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install brainy
|
npm install @soulcraft/brainy
|
||||||
```
|
```
|
||||||
|
|
||||||
## Basic Setup
|
## Basic Setup
|
||||||
|
|
@ -13,7 +13,7 @@ npm install brainy
|
||||||
### Simple Initialization
|
### Simple Initialization
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { BrainyData } from 'brainy'
|
import { BrainyData } from '@soulcraft/brainy'
|
||||||
|
|
||||||
// Create a new Brainy instance with defaults
|
// Create a new Brainy instance with defaults
|
||||||
const brain = new BrainyData()
|
const brain = new BrainyData()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue