brainy/examples
David Snelling da7d2ed29d feat: migrate embeddings to Candle WASM + remove semantic type inference
Major architectural changes:

1. EMBEDDINGS ENGINE (ONNX → Candle WASM):
   - Replace ONNX Runtime with Rust Candle compiled to WASM
   - Embedded model in WASM binary (no external downloads)
   - Quantized Q8 precision with <50MB memory footprint
   - Zero-download, offline-first operation
   - Same embedding quality (all-MiniLM-L6-v2)

2. REMOVE SEMANTIC TYPE INFERENCE:
   - Delete embeddedKeywordEmbeddings.ts (14MB of pre-computed embeddings)
   - Remove typeAwareQueryPlanner.ts and semanticTypeInference.ts
   - Remove VerbExactMatchSignal (uses keyword embeddings)
   - Update SmartRelationshipExtractor to 3 signals (55%/30%/15% weights)

API CHANGES (requires v7.0.0):
- Removed: inferTypes(), inferNouns(), inferVerbs(), inferIntent()
- Removed: getSemanticTypeInference(), SemanticTypeInference class
- Removed: TypeInference, SemanticTypeInferenceOptions types

Users can still use natural language queries in find() - they just
need to specify type explicitly for type-optimized searches.

PACKAGE SIZE IMPACT:
- Compressed: 90.1 MB → 86.2 MB (-4.3%)
- Uncompressed: 114.4 MB → 100.3 MB (-12%)
- ~448K lines of code removed

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 12:52:34 -08:00
..
tests feat: remove legacy ImportManager, standardize getStats() API 2025-10-09 11:40:31 -07:00
api-server-example.ts fix: update all imports and references from BrainyData to Brainy 2025-09-30 17:09:15 -07:00
augmentations-zero-config.ts fix: update all imports and references from BrainyData to Brainy 2025-09-30 17:09:15 -07:00
bluesky-distributed-setup.js feat: add distributed architecture with sharding and coordination 2025-09-22 15:45:35 -07:00
complete-import-demo.ts feat: add real-time progress callbacks for relationship building phase 2025-10-16 12:08:46 -07:00
demo.ts feat: Brainy 3.0 - Production-ready Triple Intelligence database 2025-09-11 16:23:32 -07:00
directory-import-with-caching.ts feat: add progress tracking, entity caching, and relationship confidence 2025-10-01 15:12:54 -07:00
import-excel-pdf-csv.ts feat: add intelligent import for CSV, Excel, and PDF files 2025-10-01 16:51:03 -07:00
import-with-progress.ts feat: add real-time progress callbacks for relationship building phase 2025-10-16 12:08:46 -07:00
instant-fork-usage.ts feat: ID-first storage architecture + remove memory-unsafe APIs (v6.0.0) 2025-11-19 16:46:11 -08:00
monitor-cache-performance.ts feat: implement always-adaptive caching with getCacheStats monitoring 2025-10-10 14:09:30 -07:00
quick-import-test.ts feat: add unified import system with auto-detection and dual storage 2025-10-08 16:55:30 -07:00
README.md feat: Brainy 3.0 - Production-ready Triple Intelligence database 2025-09-11 16:23:32 -07:00
smart-import-example.ts feat: add unified import system with auto-detection and dual storage 2025-10-08 16:55:30 -07:00
test-csv-performance.ts feat: extend batch processing and enhanced progress to CSV and PDF imports 2025-10-13 10:32:25 -07:00
test-deduplication.ts feat: add unified import system with auto-detection and dual storage 2025-10-08 16:55:30 -07:00
test-excel-import.ts feat: add unified import system with auto-detection and dual storage 2025-10-08 16:55:30 -07:00
test-excel-performance.ts feat: massive performance improvements for Excel imports with AI extraction 2025-10-13 10:05:58 -07:00
test-pdf-performance.ts feat: extend batch processing and enhanced progress to CSV and PDF imports 2025-10-13 10:32:25 -07:00
unified-import-example.ts feat: add confidence/weight to Entity and flatten Result fields for convenient access 2025-10-23 12:19:50 -07:00

Brainy Examples

This directory contains example code and test scripts for Brainy.

Structure

  • demo.ts - Basic demonstration of Brainy's core features
  • tests/ - Various test scripts demonstrating different aspects of Brainy
    • Performance tests
    • Memory tests
    • Storage adapter tests
    • API functionality tests
    • CLI tests

Running Examples

Basic Demo

npm run build
node dist/examples/demo.js

Test Scripts

The scripts in tests/ are standalone Node.js scripts that can be run directly:

node examples/tests/test-simple.js
node examples/tests/test-core-functionality.js

Note

These are examples and test scripts for reference. For production use, see the main documentation in the project root.