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
collectionstable). - 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¶
| 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}'
- If the model doesn't match, the collection is recreated; if it is missing, it is created.
- 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¶
- Change
EMBEDDING_PROVIDER/EMBEDDING_MODELand restart. GET /projects/{id}/indexshowsmodel_mismatch.POST /projects/{id}/reindexrecreates the collection and re-embeds every document.
- Change
VECTOR_DB_BACKEND/VECTOR_DB_URLand restart. GET /projects/{id}/indexshowsmissing.POST /projects/{id}/reindexcreates the collection and re-embeds. Chunk text comes from Postgres, so nothing has to be uploaded again.