🧠 Zero-Configuration AI Database with Triple Intelligence™ https://soulcraft.com
Find a file
David Snelling 483c59319e feat: revolutionize README with problem-focused approach
- Lead with "The Search Problem Every Developer Faces" to create immediate connection
- Showcase "Three-in-One Search" as the killer differentiator (Vector + Graph + Faceted)
- Streamline to 8-line quickstart demo showing all three search types
- Remove verbose technical details in favor of developer pain/solution narrative
- Highlight MCP integration and LLM generation as coming features
- Use collapsible sections for advanced features to maintain focus
- Emphasize universal deployment and zero-config philosophy
- 50% shorter while being 2x more compelling

This positions Brainy as the solution to a universal developer problem rather than
just another database option.
2025-08-06 16:26:39 -07:00
.github refactor: simplify build system and improve model loading flexibility 2025-08-05 16:09:30 -07:00
brainy-models-package feat\!: migrate from TensorFlow.js to Transformers.js with ONNX Runtime 2025-08-05 19:29:59 -07:00
docs feat: establish Brainy as world's only true Vector + Graph database 2025-08-06 16:06:03 -07:00
examples fix: update Dockerfile and README to replace model extraction with download 2025-08-05 20:39:39 -07:00
models feat\!: migrate from TensorFlow.js to Transformers.js with ONNX Runtime 2025-08-05 19:29:59 -07:00
models-cache/Xenova/all-MiniLM-L6-v2 feat\!: migrate from TensorFlow.js to Transformers.js with ONNX Runtime 2025-08-05 19:29:59 -07:00
scripts fix: correct typo in README major updates section 2025-08-06 12:29:32 -07:00
src feat: implement pagination methods for OPFSStorage adapter 2025-08-06 15:00:34 -07:00
tests feat: implement pagination methods for OPFSStorage adapter 2025-08-06 15:00:34 -07:00
.gitignore chore: add models-download to gitignore 2025-08-05 18:09:35 -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.48.0 [skip ci] 2025-08-05 20:02:32 -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
METADATA_OPTIMIZATION_PROPOSAL.md fix: correct typo in README major updates section 2025-08-06 12:29:32 -07:00
METADATA_PERFORMANCE_ANALYSIS.md fix: correct typo in README major updates section 2025-08-06 12:29:32 -07:00
MIGRATION_PLAN_DEPRECATED_METHODS.md refactor: clean up deprecated functions and unused code 2025-08-05 10:16:05 -07:00
OFFLINE_MODELS.md feat\!: migrate from TensorFlow.js to Transformers.js with ONNX Runtime 2025-08-05 19:29:59 -07:00
package-lock.json chore: bump version to 0.50.0 2025-08-06 16:08:55 -07:00
package.json chore: bump version to 0.50.0 2025-08-06 16:08:55 -07:00
PERFORMANCE_OPTIMIZATION_TODO.md feat: v0.49 - Filter discovery API, remove deprecated methods, improve performance 2025-08-06 14:39:33 -07:00
README.md feat: revolutionize README with problem-focused approach 2025-08-06 16:26:39 -07:00
TENSORFLOW_TO_TRANSFORMERS_ANALYSIS.md feat\!: migrate from TensorFlow.js to Transformers.js with ONNX Runtime 2025-08-05 19:29:59 -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



License Node.js TypeScript PRs Welcome

The world's only true Vector + Graph database - unified semantic search and knowledge graphs


The Search Problem Every Developer Faces

"I need to find similar content, explore relationships, AND filter by metadata - but that means juggling 3+ databases"

Current Reality: Pinecone + Neo4j + Elasticsearch + Custom Sync Logic
Brainy Reality: One database. One API. All three search types.

// This ONE query does what used to require 3 databases:
const results = await brainy.search("AI startups in healthcare", 10, {
  // 🔍 Vector: Semantic similarity 
  includeVerbs: true,
  
  // 🔗 Graph: Relationship traversal
  verbTypes: ["invests_in", "partners_with"],
  
  // 📊 Faceted: MongoDB-style filtering  
  metadata: {
    industry: "healthcare",
    funding: { $gte: 1000000 },
    stage: { $in: ["Series A", "Series B"] }
  }
})
// Returns: Companies similar to your query + their relationships + matching your criteria

Three search paradigms. One lightning-fast query. Zero complexity.

🚀 Install & Go

npm install @soulcraft/brainy
import { BrainyData } from '@soulcraft/brainy'

const brainy = new BrainyData()  // Auto-detects your environment
await brainy.init()              // Auto-configures everything

// Add data with relationships
const openai = await brainy.add("OpenAI", { type: "company", funding: 11000000 })
const gpt4 = await brainy.add("GPT-4", { type: "product", users: 100000000 })
await brainy.relate(openai, gpt4, "develops")

// Search across all dimensions
const results = await brainy.search("AI language models", 5, {
  metadata: { funding: { $gte: 10000000 } },
  includeVerbs: true
})

That's it. You just built a knowledge graph with semantic search and faceted filtering in 8 lines.

🏆 Why Brainy Wins

  • 🧠 Triple Search Power - Vector + Graph + Faceted filtering in one query
  • 🌍 Runs Everywhere - Same code: React, Node.js, serverless, edge
  • Zero Config - Auto-detects environment, optimizes itself
  • 🔄 Always Synced - No data consistency nightmares between systems
  • 📦 Truly Offline - Works without internet after initial setup
  • 🔒 Your Data - Run locally, in browser, or your own cloud

🔮 Coming Soon

  • 🤖 MCP Integration - Let Claude, GPT, and other AI models query your data directly
  • LLM Generation - Built-in content generation powered by your knowledge graph
  • 🌊 Real-time Sync - Live updates across distributed instances

🎯 Perfect For

🤖 AI Chat Applications - ChatGPT-like apps with long-term memory and context
🔍 Semantic Search - Find "that thing like a cat but bigger" → returns "tiger"
🧬 Knowledge Graphs - Connect everything. Wikipedia meets Neo4j meets magic
🎯 Recommendation Engines - "Users who liked this also liked..." but actually good
📚 Smart Documentation - Docs that answer questions before you ask them

🌍 Works Everywhere - Same Code

// This EXACT code works in ALL environments
import { BrainyData } from '@soulcraft/brainy'

const brainy = new BrainyData()
await brainy.init()

// Works in: React, Vue, Angular, Node.js, Deno, Bun, 
// Cloudflare Workers, Vercel Edge, AWS Lambda, browsers, anywhere

Brainy automatically detects and optimizes for your environment:

Environment Storage Optimization
🌐 Browser OPFS Web Workers, Memory Cache
🟢 Node.js FileSystem / S3 Worker Threads, Clustering
Serverless S3 / Memory Cold Start Optimization
🔥 Edge Memory / KV Minimal Footprint

🆚 Why Not Just Use...?

vs. Multiple Databases

Pinecone + Neo4j + Elasticsearch - 3 databases, sync nightmares, 3x the cost
Brainy - One database, always synced, built-in intelligence

vs. Traditional Solutions

PostgreSQL + pgvector + extensions - Complex setup, performance issues
Brainy - Zero config, purpose-built for AI, works everywhere

vs. Cloud-Only Vector DBs

Pinecone/Weaviate/Qdrant - Vendor lock-in, expensive, cloud-only
Brainy - Run anywhere, your data stays yours, cost-effective

vs. Graph Databases with "Vector Features"

Neo4j + vector plugin - Bolt-on solution, not native, limited
Brainy - Native vector+graph architecture from the ground up

📦 Advanced Features

🔧 MongoDB-Style Metadata Filtering
const results = await brainy.search("machine learning", 10, {
  metadata: {
    // Comparison operators
    price: { $gte: 100, $lte: 1000 },
    category: { $in: ["AI", "ML", "Data"] },
    rating: { $gt: 4.5 },
    
    // Logical operators  
    $and: [
      { status: "active" },
      { verified: true }
    ],
    
    // Text operators
    description: { $regex: "neural.*network", $options: "i" },
    
    // Array operators
    tags: { $includes: "tensorflow" }
  }
})

15+ operators supported: $gt, $gte, $lt, $lte, $eq, $ne, $in, $nin, $and, $or, $not, $regex, $includes, $exists, $size

🔗 Graph Relationships & Traversal
// Create entities and relationships
const company = await brainy.add("OpenAI", { type: "company" })
const product = await brainy.add("GPT-4", { type: "product" })
const person = await brainy.add("Sam Altman", { type: "person" })

// Create meaningful relationships
await brainy.relate(company, product, "develops")
await brainy.relate(person, company, "leads")
await brainy.relate(product, person, "created_by")

// Traverse relationships
const products = await brainy.getVerbsBySource(company) // What OpenAI develops
const leaders = await brainy.getVerbsByTarget(company)  // Who leads OpenAI
const connections = await brainy.findSimilar(product, { 
  relationType: "develops" 
})

// Search with relationship context
const results = await brainy.search("AI models", 10, {
  includeVerbs: true,
  verbTypes: ["develops", "created_by"],
  searchConnectedNouns: true
})
🌐 Universal Storage & Deployment
// Development: File system
const dev = new BrainyData({ 
  storage: { fileSystem: { path: './data' } } 
})

// Production: S3/R2  
const prod = new BrainyData({
  storage: { s3Storage: { bucketName: 'my-vectors' } }
})

// Browser: OPFS
const browser = new BrainyData() // Auto-detects OPFS

// Edge: Memory
const edge = new BrainyData({
  storage: { memory: {} }
})

// Redis: High performance  
const redis = new BrainyData({
  storage: { redis: { connectionString: 'redis://...' } }
})

Extend with any storage: MongoDB, PostgreSQL, DynamoDB - see storage adapters guide

🐳 Docker & Cloud Deployment
# Production-ready Dockerfile
FROM node:24-slim AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run download-models  # Embed models for offline operation
RUN npm run build

FROM node:24-slim AS production  
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/models ./models  # Offline models included
CMD ["node", "dist/server.js"]

Deploy to: Google Cloud Run, AWS Lambda/ECS, Azure Container Instances, Cloudflare Workers, Railway, Render, Vercel, anywhere Docker runs.

📚 Documentation & Resources

🤝 Contributing

We welcome contributions! Please see:

📄 License

MIT


Ready to build the future of search? Get started with Brainy today!

Get Started → | View Examples → | Join Community →