esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
Let’s talk

I’ll build the agent for it.

When Must You Re-Embed Everything?

When a change means every document must be embedded again, and when it does not, explained simply for your AI interview.

In short

You must re-embed everything when a change alters the vectors themselves: a new embedding model, a new chunk size or a new prefix. Changing the chat model, the prompt or the number of results needs no new vectors.

12 min readAdvancedOccasional · estimateFacts checked 27 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

You re-embed everything when a change alters the vectors themselves. That means a new embedding model, a different chunk size, or a new prefix on each chunk. Changing the chat model, the prompt or the number of results doesn't touch the vectors, so nothing gets embedded again. When I do have to switch models, I build the new index beside the old one, score both on real questions, and keep the old one for rollback.

When must you re-embed everything, in plain words?

An embedding is a list of numbers that stands for the meaning of a piece of text. A search index is a large store of these lists, one per chunk of your documents. When someone asks a question, the question is turned into numbers too, and the search finds the chunks with the closest numbers.

Those numbers only compare well if they were made the same way. Re-embedding means turning every chunk into numbers again, with the new settings. It is the expensive step, because every document goes through the model again.

Think of a law firm's filing clerk. If the firm changes its filing code, every contract must be re-filed under the new code, including the ones already on the shelves. A search index has the same problem: change the code, and the old filing no longer matches the new one.

Key words

Embedding
A list of numbers, called a vector, that stands for the meaning of a piece of text.
Re-embed
Turn every document into vectors again, with the new settings.
Chunk
A piece of a document, usually a few hundred words, that gets its own vector.
Dimensions
How many numbers each vector has. The model sets it, unless the provider lets you ask for a shorter one.
Index
The store that holds the vectors and finds the closest ones to a question.

Which changes force a full re-embed?

The rule is simple: if a change alters the numbers a document turns into, every document needs a new run. If the settings stay the same, only new or edited documents are embedded, and deleted ones are simply removed. The chart shows the split for a typical search app.

What a change touches

A settings change

a model, text or search setting

Changes the vectors

New embedding model

a new model gives new numbers

New chunk size or cleaning

different text gets embedded

Add context to each chunk

the prefix becomes part of the text

Changes only search

Swap the chat model

it reads chunks, writes answers

Change how many results

how many chunks, how it asks

Add a reranker

reorders results after search

Embed every document again

the whole library is redone

Keep the stored vectors

nothing gets embedded again

  1. 1A change that alters the vectors takes the orange path.
  2. 2A search-only change takes the blue path.
  3. 3Every document goes back through the model.
  4. 4Stored vectors stay, and nothing is embedded again.
Settings that change the vectors send every document back through the model. Settings that only change search leave the stored vectors alone, so nothing is embedded again.
  • A new embedding model or version

    A new model, or a new version of one, gives different numbers for the same text.

  • New chunk size, overlap or cleaning

    The text that gets embedded is different, so the numbers are different too.

  • Context added to each chunk

    A short explanation written for each chunk, placed before it, changes what gets embedded. Anthropic's contextual retrieval does this, prepending chunk-specific explanatory context to each chunk before embedding.

  • A different task label

    Some models take a task label. Documents and questions should carry different labels, so changing the document label means re-embedding.

  • “The configuration of an index cannot be changed after creation.”

    Cloudflare Vectorize

  • “To get the best performance, you must use different task types to generate embeddings for your corpus and your queries.”

    Google Cloud

  • “Contextual Retrieval solves this problem by prepending chunk-specific explanatory context to each chunk before embedding”

    Anthropic

A new vector size is a separate question. The index is built for one size, so in Vectorize a new size always needs a new index. Whether the vectors must be made again depends on the model. OpenAI says developers can shorten embeddings with the dimensions parameter, which means a new call for every document. The same page also shows a route that needs no new call: cut a stored vector by hand, then rescale it so its length is 1 (normalise it).

Here is a tiny check a team could run before any settings change. It sorts each change into one of three outcomes. The settings are made up, and the output is real.

Python
# Decide what a settings change costs. Vector settings change the numbers themselves.
# dims is a full re-embed here. A vendor that documents shortening stored vectors (OpenAI does) can skip it.
VECTOR_KEYS = ["model", "dims", "chunk_size", "doc_prefix", "clean"]
INDEX_KEYS = ["metric"]

def plan(old, new):
    changed = [k for k in VECTOR_KEYS if old[k] != new[k]]
    if changed:
        return "FULL RE-EMBED: " + ", ".join(changed)
    if any(old[k] != new[k] for k in INDEX_KEYS):
        return "REBUILD INDEX ONLY: vectors kept"
    return "NOTHING TO EMBED"

stored = {"model": "model-a", "dims": 1024, "chunk_size": 400, "doc_prefix": "", "clean": "v2", "metric": "cosine", "top_k": 5, "chat_model": "chat-a"}
print("top_k 5 -> 8:", plan(stored, {**stored, "top_k": 8}))
print("metric cosine -> dot:", plan(stored, {**stored, "metric": "dot"}))
print("add heading prefix:", plan(stored, {**stored, "doc_prefix": "Section: "}))
print("chat model swapped:", plan(stored, {**stored, "chat_model": "chat-b"}))

Output

top_k 5 -> 8: NOTHING TO EMBED
metric cosine -> dot: REBUILD INDEX ONLY: vectors kept
add heading prefix: FULL RE-EMBED: doc_prefix
chat model swapped: NOTHING TO EMBED

What does a full re-embed cost in a real project?

Take a legal team that searches 40,000 contracts. Each contract is about 30 chunks, and each chunk is about 350 tokens, where a token is a small piece of text that models count. That is 1.2 million chunks and about 420 million tokens to embed once.

Now the team wants a short heading, such as Termination, added to every chunk, because lawyers search by clause name. That changes the embedded text, so everything gets embedded again. The heading adds about 40 tokens to each chunk, which is 48 million more, so the full run comes to about 468 million tokens. That is roughly 11 per cent more than the first pass.

Tip

Multiply the token count by your provider's rate per million tokens. The rate is on the provider's pricing page, so read it on the day rather than trusting an old figure.

The old index keeps answering while the new one is built in the background, in one long run. Nothing is lost, but the bill and the wait are real. So the team tests the heading on a small set of questions first, and only pays for the whole run if the heading helps.

How do you switch models without breaking search?

The switch is safe only when old and new vectors never share one index. Mixing two models gives scores that look normal but mean nothing, so the search misses the right chunks without any error showing.

  1. 1

    Tag every vector

    Store the model name, the vector size and the chunk settings with each vector, so you can tell which run made it.

  2. 2

    Build the new index beside the old

    The old index keeps answering users while the new one fills up.

  3. 3

    Score both on real questions

    Keep a gold set: a few hundred real questions with known right answers. Measure how often each index finds the right chunk.

  4. 4

    Switch when the new one wins

    Move traffic over in one step, and only after the scores show the new index is better.

  5. 5

    Keep the old index for rollback

    If something breaks in live use, switch back in minutes. Delete the old index only after that.

Cloudflare's index, for one, fixes its size and metric when it is created, so the new setup has to be a new index from the start.

How would you handle a retired embedding model?

A bank's policy assistant indexes 85,000 pages of internal rules. The provider says its embedding model will be retired on a date a few months away. Nothing breaks today, but the new model needs every page embedded again, and the two sets of vectors cannot share an index.

Switching models without a mixed index

New index beside old

each vector tagged with its model

Score both, same questions

a few hundred real questions

Switch when new wins

old index kept for rollback

  1. 1The new index fills up while the old one keeps answering users.
  2. 2Both indexes answer the same questions, and the scores decide the switch.
Build the new index beside the old one, score both on the same questions, and switch only when the new one wins. The old index stays ready for rollback.
  • Without a plan

    Swap the model in place

    Old and new vectors end up in one index. Scores look fine at first, then answers go wrong after the switch.

  • With a plan

    Run both, then switch

    Each index holds one model. The switch happens after the scores prove the new one finds the right pages.

Start early. Re-embedding 85,000 pages takes a while, so the team plans the rebuild well before the retirement date.

What does the interviewer want to hear?

A strong answer covers

  • The answer: re-embed when the stored numbers would no longer match the new settings.
  • The changes that alter vectors: model, chunking, cleaning, prefix, task label. Vector size needs a new index, and often new vectors.
  • The changes that don't: chat model, prompt, number of results, reranker.
  • Never mix vectors from two models in one index.
  • A safe switch: a new index, a set of real questions to score it, and a rollback.

Common traps

  • Trap"Just embed the new documents, the old ones are fine."

    BetterOnly if no setting changed. A new model or chunk size means every document goes back through the model.

  • Trap"Changing the chat model means re-embedding."

    BetterNo. The chat model reads the chunks it is given. The stored vectors stay the same.

  • Trap"Tagging the mixed vectors makes them safe."

    BetterTags help you find the mess. Unless every search filters by model, scores still compare across models. Separate indexes are the simple, safe route.

Can you spot the risk?

Spot the risk

The team moved to a new embedding model on Monday. Which change puts the search at risk?

Quick check

A team changes only the chat model that writes the answer. Do they need to re-embed the documents?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q149How do you clean and deduplicate documents first?11 min
  2. Q150How would you design RAG for 10 million documents?12 min
  3. Q148What are vector and embedding security weaknesses?13 min
  4. Q146How do you pick top-k?11 min
  5. Q151"The answer was in the docs, but the bot missed it." How do you debug?12 min

Learn it in depth

Last updated on 27 November 2026

Planning a switch to a new embedding model?

I design and build AI products and agents, including the search behind them. Book a short call and say how many documents you have and how often they change.