Skip to content
anythingai.space
Retrieval & RAGintermediate12 min · 9 steps

Context Assembly

Retrieval hands you a pile of chunks; context assembly turns it into a prompt the model can use — budgeted, de-duplicated, merged, ordered and laid out in labelled sections.

context9,400tok
grounded71%
RAW RETRIEVED CHUNKS, IN RETRIEVAL ORDERFAQ: refunds?shipping infoshipping info…within 14 daysshipping info— except annual…blog post 2022policy §4 header…[truncated]Duplicates · fragments · wrong order · overbudget
datarequest
metrics are illustrative
1 / 9
ProblemStep 1 of 9

Twelve chunks pasted in a row is not a context

The retriever returns 12 chunks. Pasted as-is: three repeat the same shipping paragraph, the refund rule and its exception sit in separate fragments in the middle, an FAQ answer comes before the official policy, and the history plus chunks overflow the window — so the tail is silently truncated.

Context assembly is the step between retrieval and generation that decides what goes in, in what form, in what order, within what budget.

Lesson 28 of 37 in Retrieval & RAG