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>
This commit is contained in:
parent
81cd16e41b
commit
da7d2ed29d
60 changed files with 3887 additions and 448557 deletions
12
README.md
12
README.md
|
|
@ -197,7 +197,7 @@ const brain = new Brainy({
|
|||
})
|
||||
```
|
||||
**Scale:** Thousands to hundreds of thousands • **Performance:** <5ms queries
|
||||
**→ [Production Service Architecture](docs/PRODUCTION_SERVICE_ARCHITECTURE.md)** — Singleton patterns, caching, and scaling for Express/Node.js services
|
||||
**→ [Production Service Architecture](docs/PRODUCTION_SERVICE_ARCHITECTURE.md)** — Singleton patterns, caching, and scaling for Bun/Node.js services
|
||||
|
||||
### 🏢 Growing Company → Multi-Million Scale
|
||||
```javascript
|
||||
|
|
@ -685,12 +685,18 @@ This comprehensive guide includes:
|
|||
|
||||
## Requirements
|
||||
|
||||
**Node.js 22 LTS** (recommended) or **Node.js 20 LTS**
|
||||
**Bun 1.0+** (recommended) or **Node.js 22 LTS**
|
||||
|
||||
```bash
|
||||
nvm use # We provide .nvmrc
|
||||
# Bun (recommended - best performance, single-binary deployment)
|
||||
bun install @soulcraft/brainy
|
||||
|
||||
# Node.js (fully supported)
|
||||
npm install @soulcraft/brainy
|
||||
```
|
||||
|
||||
> **Why Bun?** Brainy's Candle WASM engine works seamlessly with `bun --compile` for standalone binary deployment. No external model files, no runtime downloads.
|
||||
|
||||
---
|
||||
|
||||
## Why Brainy Exists
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue