Step 1: Getting Started with Brainy
-Let's start by initializing the database and exploring basic operations.
- -diff --git a/.github/workflows/deploy-demo.yml b/.github/workflows/deploy-demo.yml index 01ff0a7b..6c34a4d4 100644 --- a/.github/workflows/deploy-demo.yml +++ b/.github/workflows/deploy-demo.yml @@ -36,15 +36,20 @@ jobs: - name: Build project ๐๏ธ run: | npm run build - npm run build:browser + + - name: Build Angular demo ๐๏ธ + run: | + cd demo/brainy-angular-demo + npm install --legacy-peer-deps + npm run build - name: Prepare deployment ๐ฆ run: | mkdir -p _site mkdir -p _site/demo mkdir -p _site/dist - cp index.html _site/ - cp demo/index.html _site/demo/ + cp demo/index.html _site/index.html + cp -r demo/brainy-angular-demo/dist/brainy-angular-demo/* _site/demo/ cp -r dist/* _site/dist/ cp brainy.png _site/ # Copy dist directly to demo/dist for easier access diff --git a/.gitignore b/.gitignore index 519463f3..0e332618 100644 --- a/.gitignore +++ b/.gitignore @@ -75,3 +75,4 @@ debug*.ts /temp-tests/ /brainy-models-package/node_modules/ /test-consumer/node_modules/ +/test-install/node_modules/ diff --git a/README.md b/README.md index 1e4f341b..5b731a74 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -
- 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.
-This page tests the Brainy worker thread implementation in a browser environment.
- - -Results will appear here...
-This page tests the Brainy fallback mechanism when threading is not available.
- - -Results will appear here...
-This page tests TensorFlow.js and TextEncoder functionality in a browser environment.
- - -Results will appear here...
-