ruflo

πŸ“¦ Embeddings Package v3

/docs/core-features/embeddings-package-v3

The embeddings package (v3.0.0-alpha.12) provides high-performance vector embeddings with multiple backends.

Key Features:

FeatureDescriptionPerformance
sql.js backendCross-platform SQLite (WASM)No native compilation needed
Document chunkingConfigurable overlap and sizeHandles large documents
NormalizationL2, L1, min-max, z-score4 normalization methods
Hyperbolic embeddingsPoincarΓ© ball modelBetter hierarchical representation
agentic-flow ONNXIntegrated ONNX runtimefaster with ONNX runtime than API calls
Neural substrateRuVector integrationFull learning pipeline

Models Available:

ModelDimensionsSpeedQuality
all-MiniLM-L6-v2384FastGood
all-mpnet-base-v2768MediumBetter

Usage:

bash
# Initialize embeddings system
npx ruflo@latest embeddings init

# Generate embedding for text
npx ruflo@latest embeddings embed "authentication patterns"

# Batch embed multiple texts
npx ruflo@latest embeddings batch --file texts.txt

# Search with semantic similarity
npx ruflo@latest embeddings search "login flow" --top-k 5

Programmatic:

typescript
import { createEmbeddingServiceAsync } from '@claude-flow/embeddings';

const service = await createEmbeddingServiceAsync({
  model: 'all-MiniLM-L6-v2',
  hyperbolic: true,  // Enable PoincarΓ© ball embeddings
  cacheSize: 256
});

// Generate embedding
const embedding = await service.embed("authentication flow");

// Search similar patterns
const results = await service.search("login", { topK: 5 });