The unit you index decides what retrieval can ever find. Choose it per data shape, with evidence.
| Shape | Example | Strategy |
|---|---|---|
| Small structured record | A listing; a CRM contact with requests and visits | One chunk per record: render the fields as a short text ("3-bed apartment, Ghent, 385,000, EPC B, garden...") and store the raw fields as metadata |
| Long prose document | Sale contract, brochure | Split on structure (sections, clauses) into ~200-500 token chunks, then prepend a context line |
| Frequently-changing feed | Price updates, status changes | Same as records, but design ingest so a change re-renders and re-embeds exactly that record's chunk |
Chunking strategy measurably moves retrieval quality: Chroma's evaluation found differences of up to ~9% recall between reasonable-looking strategies on the same corpus, and that simple structure-aware splitting is a strong baseline.[1] Do not take any strategy on faith - Lesson 6 gives you the measuring loop.
A chunk pulled out of a contract loses its surroundings: "The balance is due 30 days after the deed" - which property, which parties? Contextual retrieval fixes this: before embedding, prepend a generated one-liner situating the chunk.[2]
chunk_context = generate("Situate this chunk within the document", document, chunk)
index(embed(chunk_context + chunk), keywords(chunk_context + chunk), metadata)
Anthropic measured a 49% reduction in failed retrievals from this alone, 67% combined with reranking.[2] For record chunks the "context" is free: it is the field rendering itself.
Price, city, bedrooms, property type, status, owner tenant, dates: store them as typed fields next to the vector, never only inside the text. Text similarity is approximate; a later lesson makes "under 400,000" a hard filter, and a filter can only bind to a field. Rule: anything a user could constrain exactly becomes a metadata field and appears in the rendered text.
From memory, before scrolling up.
Read Contextual Retrieval end to end (15 minutes) - it is the rare engineering post with an eval behind every claim. Then skim Chroma's chunking evaluation for the method, not just the numbers.
Unsure how to chunk a specific document you have? Ask your teaching agent with a sample - it can design the split with you.