Start studying
Module 9 · RAG Module contents
Module 9  ·  Card 6 / 19beginner

Embedding Chunks

Every chunk is converted to a vector by the embedding model.

That vector is what retrieval actually searches over.

The original text is stored alongside it for later use.

Prepending the document title or section heading to a chunk often improves recall.

Changing embedding model means re-embedding your entire corpus.

Learn in depth ↓
Module 09 · RAG · 19 concepts
In depth  /  15 lines

Embedding Chunks, in more detail

Each chunk is passed through the embedding model and stored as a vector.

That vector is what retrieval searches, so it must represent the chunk fairly.

The original text is stored alongside, since the vector cannot be read back into words.

A chunk taken out of its document loses the context that framed it.

Prepending the document title and section heading restores much of that.

It costs a few tokens and reliably improves recall.

Contextual retrieval goes further, adding a generated sentence explaining where the chunk sits.

Watch the model's input limit, since anything over it is silently truncated.

A chunk of 2,000 tokens sent to a 512-token model is mostly discarded without warning.

Embedding is a batch job and providers charge per token, so a large corpus has a real cost.

It is cheap compared with generation and expensive enough to notice at millions of documents.

Cache by content hash so unchanged chunks are never re-embedded.

Queries must use the same model as the documents, without exception.

Some models want an instruction prefix, differing for queries and documents.

Changing the model means re-embedding everything, so treat the choice as a migration.

Test yourself

One question on this card. Every option explains itself once you pick, right or wrong.

Question 1
What must you do if you switch to a different embedding model?
RAG

19 concepts in this module, then a graded test with every answer explained.

Study this module →
↑↓ move↵ openesc close