How to re-embed a RAG corpus after changing embedding models
To re-embed a RAG corpus after changing embedding models, keep the converted text and passage ids from chunks.jsonl, throw away the old vectors, embed the same text with the new model into a separate index, and test known questions against both before switching, because vectors from different models cannot be compared with each other.
How do I re-embed a RAG corpus when I change embedding models?
Keep the text and ids from chunks.jsonl and discard the old vectors. Embed the same text with the new model into a separate index, since one index must hold vectors of a single dimension and metric. Embed queries with that same model, run questions you know the answers to against old and new, then switch and delete the old index.
Why a new embedding model means new vectors, not a new conversion
A RAG pipeline does two jobs that people tend to blur. Conversion turns a PDF, a Word file or a scan into clean passages. Embedding turns each passage into a list of numbers. The first job depends on your files. The second depends on the model, and the model is the part you will change: a better one ships, a license changes, or you discover your first choice was a placeholder.
Vectors from different models are not interchangeable. They can differ in length, and even when the length matches, the numbers mean different things, so a similarity score between a vector from one model and a vector from another is noise. OpenAI's embeddings guide shows the pattern in its code search example: the functions are indexed with text-embedding-3-small, and the natural-language query is embedded with the same model before comparing. The default vector length there is 1536 for text-embedding-3-small and 3072 for text-embedding-3-large.
So the work splits cleanly. Reconverting means re-reading every file, and it is the slow, sometimes costly half. Re-embedding means pushing text you already hold through a different model. If you kept the text, you only need the second half. That is the argument for keeping the JSONL, not just the index. See what a JSONL corpus looks like if you have not opened one.
What RAG Converter's export gives you to re-embed from
RAG Converter's export is two files. `chunks.jsonl` has one object per passage with an `id`, the `text`, an `embedding` and `metadata`. `manifest.json` sits beside it and says what the JSONL cannot say about itself. The manifest exists so you can tell which embedding model ran, because someone who loads placeholder vectors into a production index believing they are semantic has been misled.
Read the manifest first. It names the embedding family: either a bag-of-words hash, which is fast and deterministic but not semantic, or a sentence-transformer with its name and dimension. Mixing packs from the two is silently wrong, because the similarity between them is meaningless. The browser runs the hash engine until you opt in to the semantic one, which the homepage describes as optional and the project's own capability list marks as Preview. So a default browser export may carry vectors you will want to replace before you rely on them for search.
The manifest also lists, per document, the range of passages it occupies in the JSONL, any truncation, files that contributed nothing, and how many verbatim duplicates were dropped. That is useful when you re-embed: you can slice one document's passages, and you can see what was never in the corpus to begin with.
One limit to state plainly. RAG Converter converts and exports. I found no re-embedding step in it, and its persistent corpus and query API is listed as Planned, returning nothing today. The embedding in this guide happens in your own code or tool, using the text it exported. Here is how to re-embed a RAG corpus in three steps.
Step one: keep the text and the ids, drop the vectors
Treat `text`, `id` and `metadata` as the durable record and the `embedding` field as disposable. Keep passage ids exactly as they are, so a citation, a deletion or an evaluation set written against the old index still points at the same passage. Stable ids are also what make the incremental indexing approach work, and the same ids let you run the deletion test on the new index.
Step two: check the new model's input window
An embedding model reads only as much text as its window allows, and RAG Converter sizes its default passages to a 256-token window with 32 tokens of overlap, by its documentation. If the new model reads fewer tokens than that, it will quietly cut the end of every passage, and you should re-chunk first. If it reads more, you can keep the passages as they are. The chunk sizing guide explains why chunk size follows the embedding model.
Step three: write the new vectors next to the old ones
Do not overwrite in place. Qdrant's collections documentation says every vector in a collection must share one dimensionality and be compared by a single metric. Its named-vectors feature, available from version 1.18.0 per the same page, is described as useful for embedding model migration: add a new vector for the new model, re-embed points in the background, and remove the old vector when you are ready. In Postgres, the pgvector README shows a table with a model id beside the vector, and notes that indexes only cover rows with the same number of dimensions. Whatever store you use, keep old and new apart until the check below passes.
Test retrieval before you switch
Before cutting over, pick questions whose answers you already know, perhaps twenty from real use, and write down which passage ids should come back. Run them against the old index with the old query model, then against the new index with the new query model. Compare which expected passages appear in the top few results. That is a small, honest test of your own corpus, which tells you more than a public leaderboard for a different dataset. The page on why vector microbenchmarks are not retrieval evaluations explains why speed charts do not substitute for it.
When the new index does at least as well, point your application at it and keep the old one for a short while, so a rollback is one setting. Then delete the old vectors. If your files stay on your own machine, none of this needs to send a document anywhere: the browser converter produces the JSONL locally, and re-embedding happens wherever you choose to run your embedding model. The conversion libraries come from Remade with Rust, the same crates the free tier runs in the tab.
I have not run a migration for this article, and I make no claim about which embedding model is best. The steps above are the parts that hold for any model and any store, from the sources linked. Check your vendor's current limits before you start.