Skip to main content

Shadow Drive

When enabled, VecLabs uploads your encrypted collection to decentralized storage after every write - creating a permanent backup that survives server restarts and infrastructure changes.

How it works

After every upsert() or delete():
  1. The encrypted .db file is written to disk (synchronous - Phase 4)
  2. The same encrypted buffer is uploaded to decentralized storage (async)
Shadow Drive never blocks upsert(). If upload fails, the operation completes normally. No error is thrown to the caller.

Enable Shadow Drive

import { SolVec } from "@veclabs/solvec";

const sv = new SolVec({
  network: "devnet",
  walletPath: "/path/to/keypair.json",
  shadowDrive: true,
});

const memory = sv.collection("agent-memory", { dimensions: 1536 });
shadowDrive: true requires walletPath. Without it, Shadow Drive is disabled silently and a warning is logged.

Cold start restore

const memory = sv.collection("agent-memory", { dimensions: 1536 });
const restored = await memory.restoreFromShadowDrive();

if (restored) {
  console.log("memory restored");
} else {
  console.log("no backup found - starting fresh");
}

Privacy

Everything uploaded is the same AES-256-GCM ciphertext already written to disk. Storage nodes see only encrypted bytes. VecLabs cannot read your vectors.

Error handling

Shadow Drive errors are caught and logged silently:
[SolVec] Shadow Drive upload failed for 'name': reason
The upsert() call returns normally. The available flag is set to false for future calls.

Cost

Approximately 0.05/GB/year.At1Mvectorswith1536dimensions:roughly0.05/GB/year. At 1M vectors with 1536 dimensions: roughly 0.025/month.