This guide walks you through getting an API key, installing the SDK, storing your first vector, querying it back, and verifying it on-chain. The entire flow takes under 5 minutes.
import { SolVec } from '@veclabs/solvec';const sv = new SolVec({ apiKey: 'vl_live_...' });const collection = sv.collection('my-collection', { dimensions: 1536 });
Hosted mode (with an API key) is the recommended way to get started. VecLabs
manages your Solana wallet, Shadow Drive storage, and Merkle root posting
automatically. See “Self-hosting” at the bottom of this page if you want to
bring your own wallet instead.
Each vector has an id, a values array (the actual embedding), and optional metadata.
await collection.upsert([ { id: 'doc_001', values: Array(1536).fill(0).map(() => Math.random()), // replace with real embeddings metadata: { text: 'The quick brown fox jumps over the lazy dog', source: 'my-document.pdf', page: 1 } }]);console.log('Vector stored.');
After upsert, Recall does three things automatically:
Inserts the vector into the in-memory HNSW index (~2ms)
Encrypts and persists to Shadow Drive (async, non-blocking)
Posts a Merkle root to Solana (async, non-blocking)
.verify() makes a Solana RPC call and takes ~400ms. It is an integrity
check, not part of the normal query path. Your queries remain at sub-5ms
regardless.
You can also run Recall without an API key by bringing your own Solana wallet.
import { SolVec } from '@veclabs/solvec';// Self-hosted: bring your own Solana walletconst sv = new SolVec({ network: 'devnet', walletPath: '/path/to/keypair.json',});
Self-hosted mode gives you full control. You manage your own Solana wallet and Shadow Drive storage. The SDK is MIT licensed and identical in both modes.