skip to content

How do you move a live vector index from an embedded store to a server or managed service without re-embedding the corpus?

level: seniorimportance: should knowfreq 40%

answer

  1. vectors move, the index does not
  2. model, metric and normalisation travel
  3. check the target's limits first
  4. counts, IDs, then sample queries
  5. a watermark for later writes

basics

~20 s

Export each record's ID, full-precision vector and metadata with the model identity, metric and normalisation, bulk-load them so the target builds its own index, verify counts, IDs and sample-query overlap, then catch up later writes and switch reads.

solid answer

~50 s

Re-embedding is avoidable only if the original vectors can be read back at full precision, so check first: some stores keep only compressed codes, and decoded vectors are approximations. Index files do not travel between engines; you move raw vectors and the target builds its own index. Carry the embedding model's identity, the distance metric and whether vectors were normalised, because a metric mismatch silently changes rankings. Check the target's limits before loading: ID formats, dimension caps, metadata size and which fields are filterable. Export by paging through the source from a recorded watermark, bulk-load, then verify in order: record counts, the set of IDs, a few vectors compared exactly, and top-k overlap on sample queries, expecting high but not perfect overlap because both sides are approximate. Finally apply the writes made since the watermark, switch reads, and keep the old store read-only for a rollback window.

code

json · 15 lines
json
{
  "manifest": {
    "embedding_model": "encoder-v3",
    "dimensions": 1024,
    "metric": "cosine",
    "normalized": true,
    "record_count": 2481330,
    "watermark": "2026-10-14T02:00:00Z"
  },
  "sample_record": {
    "id": "doc-4812:chunk-03",
    "vector": [0.0132, -0.0871, 0.0450, 0.0219],
    "metadata": { "tenant": "t-017", "source_doc": "doc-4812", "updated_at": "2026-10-12T09:41:07Z" }
  }
}

go deeper

for a junior

Remember that the vectors can be moved without re-embedding, but the index itself is rebuilt by the new store.

for a middle

List what travels with the vectors: model identity, metric, normalisation, dimensions, stable IDs and filterable metadata. Explain why a metric mismatch is silent.

for a senior

Lay out the full procedure with a watermark, bulk load and the verification ladder, and explain why imperfect top-k overlap between two approximate indexes is expected.

for a principal

Plan the migration's risk: rollback window, the build time on the target, and whether compressed-only vectors make re-embedding the cheaper honest path.

## What actually moves A vector index is two things: the **vectors** (with their IDs and metadata) and the **index structure** built over them, such as a graph or a set of partitions. Only the first is portable. Index files are an engine's private format, often tied to its version, so a different engine cannot load them; only a move to the same engine's own server mode can sometimes reuse them. The migration therefore moves raw vectors and lets the target **build its own index**, which takes time proportional to the corpus and is worth estimating before the cutover date. Re-embedding the corpus is expensive and changes the vectors, so the goal is to move the existing vectors unchanged. ## Before exporting: can you read the vectors back? - **Full-precision vectors.** If the source keeps them, export is lossless. - **Compressed only.** Some stores keep only quantised codes to save memory or disk. Decoded vectors are approximations; loading them loses recall, so either measure the loss against exact search or accept re-embedding. - **Records missing vectors.** A store fed partly by a service that embedded text for you may hold vectors you cannot read through its API. Find out before promising "no re-embedding". ## What must travel with the vectors 1. **Embedding model identity and version**, so queries are embedded with the same model. 2. **Distance metric**: cosine, dot product or Euclidean distance. 3. **Normalisation**: whether vectors were scaled to unit length. Cosine and dot product rank identically when every stored vector has the same length, which normalisation guarantees, so a target set to dot product over unnormalised vectors ranks differently without any error. 4. **Dimension count**, checked against the target's cap. 5. **Stable IDs and metadata**, including whatever fields queries filter on. An illustrative export manifest and record are shown in the code example; the field names are invented. ## Check the target's limits | Constraint | Why it matters | |---|---| | ID format | Some services accept only certain ID types or lengths; a mapping table may be needed | | Dimension cap | A model's dimension may exceed the target's limit | | Metadata size and types | Large payloads may need to live elsewhere, referenced by ID | | Filterable fields | Some services require filter fields declared up front | | Bulk-load path | A bulk import is usually far cheaper and faster than per-record upserts | ## The procedure 1. **Record a watermark** (a timestamp or sequence number) and start logging application writes from that point, or briefly pause writes if the corpus is small enough. 2. **Export** by paging through the source in ID order, writing records to files. 3. **Bulk-load** into the target and let it build its index. 4. **Verify**, cheapest check first: - record counts match; - the sets of IDs match, so nothing was dropped or duplicated; - a sample of vectors is numerically identical, or equal within the target's storage precision; - top-k overlap on a few hundred real queries is high. It will not be perfect, because both indexes are approximate with different parameters; compare each side's recall against exact search on a sample before blaming the data. 5. **Catch up** the writes made since the watermark, then **switch reads**. How to keep writes flowing safely during a long rebuild is a broader subject; here a short write log replayed in order, keyed by record ID, is usually enough. 6. **Keep the old store read-only** for a rollback window, then retire it. ## What changes for the application Moving from an embedded store to a server or managed service turns a function call into a **network call**: add timeouts, connection reuse, authentication and batching of queries where the target supports it. Latency rises by the network round trip, which matters for agents that search many times per request. Three more changes are easy to miss: - **Query embedding stays the same.** The application must still embed queries with the recorded model, now on a path that no longer sits beside the store. - **Failure modes are new.** The store can be unreachable or throttle requests, so retrieval needs a decision about what to answer when search fails. - **Credentials appear.** A network service needs a key or identity, stored and rotated like any other secret. ## How to answer in an interview Say up front that only vectors move, then list what must travel with them, check the target's limits, and describe the verification ladder. The detail that marks a strong answer is the metric and normalisation check, and knowing that imperfect top-k overlap is normal for two approximate indexes.

  • What if the source store kept only compressed vectors?
    Decoded vectors are approximations, so the target's index starts from lossy input. Measure recall on a query sample against exact search over the original vectors if you have them, or against relevance labels. If the loss is acceptable, migrate the decoded vectors; if not, re-embedding is the honest answer.
  • Why can top-k results differ between old and new stores when every vector matches?
    Both stores run approximate nearest-neighbour search with different index structures and parameters, so each misses a slightly different few true neighbours. Compare each side's recall against exact search on a sample; if both are close to their targets, the difference is approximation, not data loss.

  • Index files from one engine can be loaded directly by a different vector service.
  • Any move between vector stores requires re-embedding every document.
  • Identical top-k results on every query are required before cutting over.
  • Cosine and dot product always rank the same, so the metric setting is irrelevant.
  • Exporting from a store that keeps only compressed vectors returns the originals.