Mid-level interview question
A chunk is whole and correct but never retrieved. What's the fix?
Model answer
Give it its context. Cut from its document, it may never say what it's about: “It usually arrives in 5 to 7 business days” doesn't say “refund”.
Scroll sideways to see the whole diagram
Cut out of its document, a chunk can lose what it's about. This one never says “refund”.
Text version
- Cut out of its document, a chunk can lose what it's about. This one never says “refund”.
- The cheap fix is metadata: the document title, the section heading, tags, or entities such as error codes.
- Anthropic's contextual retrieval uses a model instead: given the whole document and the chunk, it writes a short context, usually 50–100 tokens, situating the chunk.
- The context is prepended to the chunk.
- Then the augmented chunk is indexed, so a search for “refund” can now find it.
Prepend the title and section, add keywords or entities, list questions it answers, or generate a short context with a model, as Anthropic's contextual retrieval does.
Practise the rest
6 Chunking questions, 492 in all, each with a model answer. Free.