Step 1: Getting Started with Brainy
Let's start by initializing the database and exploring basic operations.
A powerful graph & vector data platform for AI applications across any environment
Explore all of Brainy's powerful capabilities in this interactive demo:
Run Brainy in a browser, container, serverless cloud service or the terminal!
Find semantically similar content using embeddings (like having ESP for your data!)
Connect data with meaningful relationships (your data's social network)
Process data in real-time as it flows through the system (like a data waterslide!)
Customize and extend functionality with pluggable components (LEGO blocks for your data!)
Sync and scale across instances with WebSocket and WebRTC (your data's teleportation system!)
Use TensorFlow.js for high-quality embeddings (included as a required dependency)
Automatically optimizes for your environment and usage patterns
Works everywhere you do: browsers, Node.js and server environments
Data persists across sessions and scales to any size (no memory loss here!)
Fully typed API with generics (for those who like their code tidy)
Powerful command-line interface for data management (command line wizardry)
Interactive graph and vector space visualizations
Easy deployment to Google, AWS, Azure and other cloud platforms
Allow external AI models to access Brainy data and use augmentation pipeline as tools
Find content based on meaning, not just keywords
Suggest similar items based on vector similarity
Build connected data structures with relationships
Store and retrieve embeddings for machine learning models
Build applications that leverage vector embeddings for intelligent data processing
Automatically categorize and connect related information
Create applications that learn and evolve with your users
Connect external AI models to Brainy data and tools using MCP
This interactive demo guides you through Brainy's features step by step, from basic operations to advanced capabilities.
Let's start by initializing the database and exploring basic operations.
Search your data using vector embeddings for semantic understanding.
Try searching for topics in the sample data like "machine learning", "AI ethics", "computer vision", "robotics", "quantum computing", "cybersecurity", or specific concepts like "large language models", "federated learning", "explainable AI", "climate science", etc.
Now that your database is initialized, let's add some entities (nouns) to it.
Connect your entities with meaningful relationships to build a knowledge graph.
Explore Brainy's advanced capabilities for more complex use cases.
Explore how HNSW makes semantic search fast and efficient.
Navigate through connected entities in your knowledge graph.
Backup, restore and manage your data.
See how text is converted to vectors for semantic understanding.
Try Brainy's CLI commands for scripting and automation.
import { BrainyData, NounType, VerbType } from '@soulcraft/brainy' // Create and initialize the database const db = new BrainyData() await db.init() // Add data (automatically converted to vectors) 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' }) // Search for similar items const results = await db.searchText("feline pets", 2) console.log(results) // Returns items similar to "feline pets" with similarity scores // Add a relationship between items await db.addVerb(catId, dogId, { verb: VerbType.RelatedTo, description: 'Both are common household pets' })
Brainy uses a unified build that automatically adapts to your environment:
// Standard import - automatically adapts to any environment import { BrainyData, NounType, VerbType } from '@soulcraft/brainy' // Use the same API as in Node.js const db = new BrainyData() await db.init() // ...
<script type="module"> // Use local files instead of CDN // For GitHub Pages, use relative path: './dist/unified.js' // For local development, use absolute path: '/dist/unified.js' // This import is replaced by the dynamic import below // Or minified version // import { BrainyData, NounType, VerbType } from '/dist/unified.min.js' const db = new BrainyData() await db.init() // ... </script>
Modern bundlers like Webpack, Rollup and Vite will automatically use the unified build which adapts to any environment.