| Crates.io | exo-wasm |
| lib.rs | exo-wasm |
| version | 0.1.0 |
| created_at | 2025-12-02 04:21:17.12714+00 |
| updated_at | 2025-12-02 04:21:17.12714+00 |
| description | WASM bindings for EXO-AI 2025 cognitive substrate - browser and edge deployment |
| homepage | https://ruv.io |
| repository | https://github.com/ruvnet/ruvector |
| max_upload_size | |
| id | 1961131 |
| size | 86,396 |
WASM bindings for EXO-AI 2025 Cognitive Substrate, enabling browser-based deployment of advanced AI substrate operations.
# Build the WASM package
wasm-pack build --target web
# Or for Node.js
wasm-pack build --target nodejs
import init, { ExoSubstrate, Pattern } from './pkg/exo_wasm.js';
async function main() {
// Initialize WASM module
await init();
// Create substrate
const substrate = new ExoSubstrate({
dimensions: 384,
distance_metric: "cosine",
use_hnsw: true,
enable_temporal: true,
enable_causal: true
});
// Create a pattern
const embedding = new Float32Array(384);
for (let i = 0; i < 384; i++) {
embedding[i] = Math.random();
}
const pattern = new Pattern(
embedding,
{ type: "concept", name: "example" },
[] // antecedents
);
// Store pattern
const id = substrate.store(pattern);
console.log("Stored pattern:", id);
// Query for similar patterns
const results = await substrate.query(embedding, 5);
console.log("Search results:", results);
// Get stats
const stats = substrate.stats();
console.log("Substrate stats:", stats);
}
main();
const { ExoSubstrate, Pattern } = require('./pkg/exo_wasm.js');
const substrate = new ExoSubstrate({
dimensions: 128,
distance_metric: "euclidean",
use_hnsw: false
});
// Use as shown above
Main substrate interface.
new ExoSubstrate(config)
Config options:
dimensions (number): Vector dimensions (required)distance_metric (string): "euclidean", "cosine", "dotproduct", or "manhattan" (default: "cosine")use_hnsw (boolean): Enable HNSW index (default: true)enable_temporal (boolean): Enable temporal tracking (default: true)enable_causal (boolean): Enable causal tracking (default: true)store(pattern): Store a pattern, returns pattern IDquery(embedding, k): Search for k similar patterns (returns Promise)get(id): Retrieve pattern by IDdelete(id): Delete pattern by IDlen(): Get number of patternsisEmpty(): Check if substrate is emptystats(): Get substrate statisticsRepresents a cognitive pattern.
new Pattern(embedding, metadata, antecedents)
Parameters:
embedding (Float32Array): Vector embeddingmetadata (object, optional): Arbitrary metadataantecedents (string[], optional): IDs of causal antecedentsid: Pattern ID (set after storage)embedding: Vector embedding (Float32Array)metadata: Pattern metadatatimestamp: Creation timestamp (milliseconds since epoch)antecedents: Causal antecedent IDs# Development build
wasm-pack build --dev
# Production build (optimized)
wasm-pack build --release
# Build for specific target
wasm-pack build --target web # Browser ES modules
wasm-pack build --target nodejs # Node.js
wasm-pack build --target bundler # Webpack/Rollup
# Run tests in browser
wasm-pack test --headless --firefox
# Run tests in Node.js
wasm-pack test --node
The WASM bindings are optimized for browser deployment:
This crate provides WASM bindings for the EXO-AI 2025 cognitive substrate. It currently uses ruvector-core as the underlying implementation, with plans to integrate with the full EXO substrate layer.
exo-wasm/
├── src/
│ ├── lib.rs # Main WASM bindings
│ ├── types.rs # Type conversions
│ └── utils.rs # Utility functions
├── Cargo.toml
└── README.md
MIT OR Apache-2.0