migration guide

Migrate from Weaviate to altor-vec

Move from Weaviate's cloud-native AI database to zero-infrastructure browser vector search with altor-vec. For teams who need browser-local or offline search without Docker or Weaviate Cloud.

When migration makes sense

What you give up

Migration is not always the right call. altor-vec cannot replace Weaviate for:

Not sure? See the full altor-vec vs Weaviate comparison — it covers architecture differences and use-case fit in detail.

Step-by-step migration

Install altor-vec: npm install altor-vec @xenova/transformers
// 1. Export vectors from Weaviate (Python — most common Weaviate client)
import weaviate
import json, numpy as np

client = weaviate.Client("http://localhost:8080")

# Fetch all objects with their vectors
result = (client.query
  .get("YourClass", ["title", "content", "url"])
  .with_additional(["vector"])
  .with_limit(10000)
  .do())

objects = result["data"]["Get"]["YourClass"]
with open("weaviate-export.json", "w") as f:
    json.dump(objects, f)

# Extract vectors
vectors = np.array([obj["_additional"]["vector"] for obj in objects], dtype=np.float32)
np.save("weaviate-vectors.npy", vectors)
print(f"Exported {len(objects)} objects, vector dim: {vectors.shape[1]}")

// 2. Build altor-vec index (Node.js)
import init, { WasmSearchEngine } from 'altor-vec';
import { readFileSync, writeFileSync } from 'fs';
await init();

// Load numpy vectors (use a npy-js parser or convert to JSON first)
// Simple approach: convert numpy to JSON in the Python script above:
// np.savetxt('vectors.csv', vectors, delimiter=',')
const objects = JSON.parse(readFileSync('weaviate-export.json', 'utf8'));
const vectorData = readFileSync('vectors.csv', 'utf8')
  .trim().split('\n')
  .map(row => row.split(',').map(Number));

const DIM = vectorData[0].length;
const vecs = new Float32Array(vectorData.length * DIM);
vectorData.forEach((row, i) => vecs.set(row, i * DIM));

const engine = WasmSearchEngine.from_vectors(vecs, DIM, 16, 200, 50);
writeFileSync('public/search-index.json', engine.to_json());
writeFileSync('public/search-metadata.json', JSON.stringify(
  objects.map(o => ({ title: o.title, url: o.url }))
));

After migration

Once your index is built and deployed to public/search-index.json, load it in the browser:

import init, { WasmSearchEngine } from 'altor-vec';
import { pipeline } from '@xenova/transformers';

await init();
const embedder = await pipeline('feature-extraction', 'Xenova/all-MiniLM-L6-v2');
const resp = await fetch('/search-index.json');
const engine = WasmSearchEngine.from_json(await resp.text());

async function search(query, k = 5) {
  const out = await embedder(query, { pooling: 'mean', normalize: true });
  const hits = JSON.parse(engine.search(new Float32Array(out.data), k));
  return hits; // [{id, score}] - map id back to your metadata
}

Frequently asked questions

Can altor-vec replace Weaviate for production AI applications?

For browser-native search over static or session-scoped content, yes. For server-side RAG pipelines, multi-tenant applications, or billion-scale retrieval, Weaviate is the better choice. The key question is whether search needs to run in the browser or on a server.

How do I export existing vectors from Weaviate?

Use the Weaviate client's query with with_additional(['vector']) to retrieve stored vectors. Extract the _additional.vector field from each result and convert to a numpy array or Float32Array for altor-vec.

Does altor-vec support multi-modal search like Weaviate?

Not natively. altor-vec takes any Float32Array as input — you can use it with image embeddings (CLIP, ViT) or text embeddings separately, but not combined in one index. For true multi-modal search, Weaviate's img2vec and multi2vec modules have no equivalent in altor-vec.

What is the migration path if I later need to scale beyond altor-vec?

altor-vec and Weaviate use the same HNSW algorithm. Migration back is straightforward: embed your content server-side, upsert to Weaviate, and update your search client. The embedding model and query logic remain the same.