Skip to main content

System Requirements

Before building VecLabs from source, ensure you have the following tools installed:

Rust

Version 1.85 or higher required for the core HNSW engine

Node.js

Version 18 or higher for the TypeScript SDK

Python

Version 3.10 or higher for the Python SDK

Solana CLI

Version 2.0 or higher for deploying programs
Anchor CLI 0.32+ is also required if you plan to build or test the Solana program.

Clone the Repository

1

Clone from GitHub

git clone https://github.com/veclabs/veclabs
cd veclabs
2

Verify repository structure

The repository is organized as a Cargo workspace with the following structure:
veclabs/
├── crates/
│   ├── solvec-core/      # Rust HNSW engine
│   └── solvec-wasm/      # WASM bindings (in progress)
├── programs/
│   └── solvec/           # Solana Anchor program
├── sdk/
│   ├── typescript/       # TypeScript SDK
│   └── python/           # Python SDK
└── benchmarks/           # Criterion benchmark suite

Building the Rust Core

The Rust core contains the HNSW graph implementation, distance functions, Merkle tree generation, and encryption.
1

Build the workspace

cargo build --workspace
This builds all crates including solvec-core and solvec-wasm.
2

Build in release mode (optional)

For production builds with full optimizations:
cargo build --workspace --release
Release builds enable SIMD optimizations and remove debug assertions.
3

Verify the build

Run the test suite to ensure everything compiled correctly:
cargo test --workspace

Building the TypeScript SDK

The TypeScript SDK (@veclabs/solvec) provides the Node.js interface to VecLabs.
1

Navigate to the SDK directory

cd sdk/typescript
2

Install dependencies

npm install
This installs Solana dependencies including @solana/web3.js and @coral-xyz/anchor.
3

Build the SDK

npm run build
This compiles TypeScript to JavaScript and generates type definitions in the dist/ directory.
4

Verify with tests

npm test

Building the Python SDK

The Python SDK (solvec) uses Hatch as its build backend.
1

Navigate to the SDK directory

cd sdk/python
2

Install Hatch

If you don’t have Hatch installed:
pip install hatch
3

Build the package

hatch build
This creates wheel and source distributions in the dist/ directory.
4

Install in development mode (optional)

To install the package locally for development:
pip install -e .

Building the Solana Program

The Solana Anchor program handles on-chain Merkle root storage and collection management.
Building and testing the Solana program requires devnet SOL in your wallet. You can get devnet SOL from the Solana faucet.
1

Navigate to the program directory

cd programs/solvec
2

Build the program

anchor build
This compiles the Anchor program and generates IDL files.
3

Run tests

anchor test --skip-deploy
The --skip-deploy flag runs tests against the already deployed devnet program.

Building Everything at Once

You can build all components sequentially with this one-liner:
cargo build --workspace && \
cd sdk/typescript && npm install && npm run build && cd ../.. && \
cd sdk/python && pip install hatch && hatch build && cd ../.. && \
cd programs/solvec && anchor build

Troubleshooting

Update Rust to version 1.85 or higher:
rustup update stable
Clear npm cache and reinstall:
npm cache clean --force
rm -rf node_modules package-lock.json
npm install
Install Anchor CLI:
cargo install --git https://github.com/coral-xyz/anchor avm --locked --force
avm install 0.32.0
avm use 0.32.0
Ensure you have a recent version of pip:
pip install --upgrade pip
pip install hatch

Next Steps

Running Tests

Learn how to run the full test suite

Benchmarks

Run performance benchmarks and compare results

Build docs developers (and LLMs) love