Skip to content

Changing the vector DB or the embedding model

Vectors from one embedding model cannot be searched with another, and a new vector DB starts empty. Pagelore tracks which index each document went into, so it can tell you what is out of date and rebuild only that.

How it is tracked

  • Each collection records the vector DB backend, the embedding provider and model, the dimension and the distance method that created it (the collections table).
  • Each indexed document records the collection instance it went into.

After you change VECTOR_DB_BACKEND, its URL, or EMBEDDING_*, documents still marked indexed show "stale": true. List them with GET /projects/{id}/documents?stale=true.

Searching a project whose index does not match the configuration returns 409 with the reason. The keyword mode keeps working, because the keyword index lives in Postgres.

Check

curl localhost:8000/api/v1/projects/1/index
Field
problem missing (no collection in this vector DB), model_mismatch (made by another model), unregistered or external_vectors (not made by Pagelore), or none
documents Counts of indexed, stale, failed, pending and processing
needs_reindex Whether a reindex is needed

Rebuild

curl -X POST localhost:8000/api/v1/projects/1/reindex \
     -H 'Content-Type: application/json' -d '{"background": true}'
  1. If the model doesn't match, the collection is recreated; if it is missing, it is created.
  2. The stale and failed documents are re-embedded. Each document keeps its earlier chunking unless you send chunking.
Option Default
all false Re-chunk every document, not only the stale and failed ones
chunking each document's own New chunking options for the documents re-indexed
reload false Re-extract each file from the kept copy
force false Also take documents stuck in processing
recreate_shared false Required to recreate a collection that other projects also use. Their documents then show as stale until they are re-indexed too
background false Return at once with a job_id (Background jobs)

Typical changes

  1. Change EMBEDDING_PROVIDER / EMBEDDING_MODEL and restart.
  2. GET /projects/{id}/index shows model_mismatch.
  3. POST /projects/{id}/reindex recreates the collection and re-embeds every document.
  1. Change VECTOR_DB_BACKEND / VECTOR_DB_URL and restart.
  2. GET /projects/{id}/index shows missing.
  3. POST /projects/{id}/reindex creates the collection and re-embeds. Chunk text comes from Postgres, so nothing has to be uploaded again.
curl -X POST localhost:8000/api/v1/projects/1/reindex -H 'Content-Type: application/json' \
     -d '{"all": true, "chunking": {"chunk_size": 2000}, "background": true}'
curl -X POST localhost:8000/api/v1/projects/1/reindex -H 'Content-Type: application/json' \
     -d '{"all": true, "reload": true, "background": true}'