🧠 Zero-Configuration AI Database with Triple Intelligence™ https://soulcraft.com
Find a file
David Snelling 90961c5ce9 docs: streamline README for better readability and user engagement
- Reduce README from 1800+ to ~220 lines for better readability
- Focus on features, quick start, and excitement for new users
- Remove obsolete references to brainy-cli and brainy-web-service packages
- Add clear performance metrics and zero-configuration examples upfront
- Move detailed documentation to /docs folder with proper linking
- Improve information architecture with better organization and navigation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-04 07:50:00 -07:00
.github docs: add guidelines for Conventional Commit format and structured commit messages 2025-08-03 09:47:09 -07:00
brainy-models-package **feat: add scripts to reproduce and test race conditions, write-only mode, and indexing issues** 2025-08-02 15:09:14 -07:00
demo **feat(tests): add tests for TextEncoder, TensorFlow.js, and fallback mechanisms** 2025-07-11 11:11:56 -07:00
docs feat(docs): add S3 migration guide for optimized data transfer strategies 2025-08-03 18:01:30 -07:00
examples **feat(utils): add type utility functions and examples for runtime type management** 2025-07-31 14:24:16 -07:00
models/sentence-encoder **feat(docs): add comprehensive documentation for model bundling and robust loading** 2025-08-01 15:35:29 -07:00
scripts **chore: remove unused CLI and utility files** 2025-08-02 17:22:49 -07:00
src feat(auto-configuration): implement automatic configuration system for optimal settings 2025-08-03 17:27:01 -07:00
tests **feat(models): enhance loader reliability and compatibility** 2025-08-01 18:31:37 -07:00
.gitignore chore: add CLAUDE.md to .gitignore 2025-08-03 09:45:33 -07:00
.npmignore **feat(docs): add comprehensive architecture documentation for Brainy** 2025-08-02 16:05:48 -07:00
.versionrc.json chore(versioning): switch to standard-version for automated changelog generation 2025-07-31 13:15:04 -07:00
brainy.png Initial commit 2025-06-24 11:41:30 -07:00
CHANGELOG.md chore(release): 0.37.0 [skip ci] 2025-08-03 17:34:36 -07:00
CODE_OF_CONDUCT.md Initial commit 2025-06-24 11:41:30 -07:00
CONTRIBUTING.md **docs: restructure CLI usage details and update scripts for clarity** 2025-07-17 07:53:41 -07:00
favicon.ico **feat(cli, workers): introduce text encoding patches and worker improvements** 2025-07-04 14:42:33 -07:00
LICENSE Initial commit 2025-06-24 11:41:30 -07:00
package-lock.json chore(release): 0.37.0 [skip ci] 2025-08-03 17:34:36 -07:00
package.json chore(release): 0.37.0 [skip ci] 2025-08-03 17:34:36 -07:00
README.md docs: streamline README for better readability and user engagement 2025-08-04 07:50:00 -07:00
reproduce_error.js **feat(storage): add script to reproduce FileSystemStorage initialization error** 2025-08-01 18:31:44 -07:00
reproduce_race_condition.cjs **feat: add scripts to reproduce and test race conditions, write-only mode, and indexing issues** 2025-08-02 15:09:14 -07:00
reproduce_writeonly_issue.js **feat: add scripts to reproduce and test race conditions, write-only mode, and indexing issues** 2025-08-02 15:09:14 -07:00
rollup.config.js **fix(cache): remove outdated ES module compatibility solution and enhance shims for 'os' and 'url' modules** 2025-08-01 15:35:41 -07:00
test-results.json **build: update test results file** 2025-07-30 09:34:54 -07:00
test_race_condition_fixes.cjs **feat: add scripts to reproduce and test race conditions, write-only mode, and indexing issues** 2025-08-02 15:09:14 -07:00
tsconfig.browser.json **feat(config): add support for 'DOM.Asynciterable' in TypeScript config files** 2025-07-24 11:21:29 -07:00
tsconfig.json **feat(config): add support for 'DOM.Asynciterable' in TypeScript config files** 2025-07-24 11:21:29 -07:00
tsconfig.unified.json **feat(config): add support for 'DOM.Asynciterable' in TypeScript config files** 2025-07-24 11:21:29 -07:00
vitest.config.ts **chore: remove unused CLI package references and update gitignore** 2025-08-02 17:23:03 -07:00

Brainy Logo

License Node.js TypeScript PRs Welcome

A lightning-fast vector database that runs everywhere - from browsers to servers to edge functions

Live Demo | Quick Start | Documentation | Examples

Why Brainy?

Brainy is a production-ready vector database that automatically adapts to your environment. Whether you're building AI applications, recommendation systems, or knowledge graphs, Brainy provides blazing-fast semantic search with zero configuration.

🚀 Key Features

  • Lightning Fast - Sub-second search across millions of vectors
  • 🌍 Runs Everywhere - Browser, Node.js, Deno, Bun, Edge Workers, Containers
  • 🧠 Zero Configuration - Auto-detects environment and optimizes automatically
  • 📈 Self-Optimizing - Gets faster the more you use it through adaptive learning
  • 🔄 Graph Relationships - Connect data with semantic relationships, not just vectors
  • 💾 75% Memory Reduction - Advanced compression and intelligent caching
  • 🎯 Production Ready - Battle-tested with comprehensive optimizations

📊 Performance at Scale

Dataset Size Search Time Memory Usage
10k vectors ~50ms Standard
100k vectors ~200ms 30% reduction
1M+ vectors ~500ms 75% reduction

🎯 Quick Start

Installation

npm install @soulcraft/brainy

Zero Configuration Setup

import { createAutoBrainy } from '@soulcraft/brainy'

// That's it! Everything is auto-configured
const brainy = createAutoBrainy()

// Add data (automatically converted to vectors)
await brainy.add("Cats are independent pets", {
  category: 'animal',
  type: 'domestic'
})

// Search semantically
const results = await brainy.searchText("feline companions", 5)
console.log(results) // Returns similar items with scores

Choose Your Scale

import { createQuickBrainy } from '@soulcraft/brainy'

// Pick your scale: 'small', 'medium', 'large', 'enterprise'
const brainy = await createQuickBrainy('large', {
  bucketName: 'my-vector-storage' // Optional S3 storage
})
Scale Dataset Size Best For
small ≤10k vectors Development, prototypes
medium ≤100k vectors Production apps
large ≤1M vectors Large applications
enterprise ≤10M vectors Enterprise systems

🔥 Core Concepts

Vector + Graph = Knowledge

Brainy combines vector similarity with graph relationships:

// Add entities (automatically vectorized)
const catId = await db.add("Cats are independent pets", {
  noun: NounType.Thing,
  category: 'animal'
})

const dogId = await db.add("Dogs are loyal companions", {
  noun: NounType.Thing,
  category: 'animal'
})

// Create relationships
await db.addVerb(catId, dogId, {
  verb: VerbType.RelatedTo,
  relationship: 'both are pets'
})

// Search returns both similar vectors AND related entities
const results = await db.searchText("household pets", 5)

Advanced Search Capabilities

// Search within JSON document fields
const results = await db.search("Acme Corp", 10, {
  searchField: "company"
})

// Search by entity type
const people = await db.searchByNounTypes([NounType.Person], 10)

// Batch operations for performance
const ids = await db.addBatch([
  { vectorOrData: "First item", metadata: { category: 'A' }},
  { vectorOrData: "Second item", metadata: { category: 'B' }}
], { concurrency: 4, batchSize: 50 })

🏗️ Architecture

Brainy uses cutting-edge technologies to deliver exceptional performance:

  • HNSW Algorithm - Hierarchical Navigable Small World for O(log n) search
  • TensorFlow.js - Hardware-accelerated embeddings using GPU/WebGL
  • Multi-tier Storage - Hot (RAM) → Warm (Fast Storage) → Cold (S3/Disk)
  • Semantic Partitioning - Auto-clusters similar vectors for faster retrieval
  • Adaptive Caching - Learns your access patterns and optimizes accordingly

📚 Documentation

🛠️ Advanced Features

Augmentation Pipeline

Extend Brainy with custom data processing:

import { createSenseAugmentation, pipeline } from '@soulcraft/brainy'

// Create custom augmentation
const customProcessor = createSenseAugmentation({
  name: 'my-processor',
  processRawData: async (data, type) => {
    // Your custom logic
    return { nouns: [], verbs: [] }
  }
})

// Register and use
pipeline.register(customProcessor)

Model Control Protocol (MCP)

Let AI models interact with your Brainy database:

import { BrainyMCPAdapter } from '@soulcraft/brainy'

const adapter = new BrainyMCPAdapter(brainy)
// Now AI models can query and update your database

🎮 Live Demo

Try it now!

See Brainy in action with our interactive demo showcasing vector search, graph relationships, and cross-environment compatibility.

🤝 Contributing

We welcome contributions! Please see our Contributing Guide and Code of Conduct.

Development

# Install dependencies
npm install

# Run tests
npm test

# Build project
npm run build

# Run demo locally
npm run demo

📄 License

MIT - Use it freely in your projects!

🙏 Acknowledgments

Built with ❤️ using:


Ready to build something amazing?
Get Started →