Context EngineeringLesson 17 of 87

Contents

Context Engineering

Lesson 17 of 87. Sign in to keep your place.

Module 2 · Selection: what earns a place

The header on every chunk

8 min read

Multiply before you decide

A per-chunk header looks free. It is not, and the arithmetic is the whole lesson.

A header carrying title, section path, date, source URL and an internal id runs about 45 tokens. At k=12 that is 540 tokens per request. At a million requests a month, on a typical hosted input price, it is a four-figure annual line item for text that is mostly not read.

So the question for each field is not “might this be useful” but “what decision does the model make differently because this is here”. Fields that pass:

A citation handle. Short. [7] or S3. It is what makes “cite the passage you used” work at all, and it is four tokens. This one always pays.

A date, when passages can disagree over time. Covered in the previous lesson.

A source identity a user would recognise: the document title, or the product area. Two purposes: the model can say where an answer came from in words a human trusts, and it can weigh a policy page above a forum post.

A section path, when chunks come from long structured documents. Refunds > Sale items > Exceptions tells the model what the chunk is about even when the chunk itself uses pronouns. This is often the highest-value 8 tokens in the header.

Fields that usually fail:

  • Internal UUIDs. 15 to 20 tokens each, meaningless to the model, and the citation handle already does the job. Keep the mapping in your code, not in the window.
  • The similarity score. Tempting and quietly harmful: it invites the model to treat rank as truth, and a 0.82 next to a passage reads like a confidence claim about its content, which it is not.
  • Ingestion timestamps, embedding model versions, chunk indices. Debugging data. Log them; do not send them.
  • Full URLs. A long URL is 20 to 40 tokens. If the user needs a link, attach it in your application layer after the model has cited [7], which costs nothing.

Format compactly, and consistently

Within a header, dense is better than pretty:

Text
[7] Refund policy · Sale items · 2026-03-14
Customers may request a refund within 30 days of delivery...

Three things matter more than the exact style. Use the same shape for every passage, so the model learns the pattern within the request. Put the header immediately before its text with no blank line drift. And make the boundary between passages unmistakable: the delimiters lesson later covers why a consistent marker beats an elegant one.

The metadata that never enters the window

A useful discipline: most metadata exists to be filtered on, not read. Tenant, ACL groups, language, document type, source system, permissions version. All of it belongs in the index for the pre-filter, and none of it belongs in the context.

Sending tenant_id: acme-corp to the model achieves nothing except telling a prompt-injection attempt what your tenant ids look like. Filter on it; do not print it.

Where the header earns the most

One case is worth calling out because it changes results more than the others: chunks that do not stand alone.

A chunk from the middle of a long page begins “This does not apply to items purchased during a promotional period.” What is this? Without the section path, the model does not know, and neither would a human. With Refund policy > Sale items in front of it, the sentence becomes usable.

That is the same problem the chunking lesson solves by carrying context down into the chunk. A section-path header is the cheap version, applied at retrieval time and costing eight tokens; a generated contextual sentence is the expensive version, applied at ingestion. The next module covers when the expensive version is worth it.

Measure the header like anything else

Headers are a cheap experiment because they are pure assembly: no re-indexing, no re-embedding. Run your evaluation set with the full header, then with only the citation handle, then with handle plus section path.

Teams commonly find that the handle and the section path carry almost all the benefit and the rest is decoration. Which is a 30-token-per-chunk saving, discovered in an hour, that nobody would have believed without the numbers.

Every lesson here is open. Your progress is recorded once you pass the Data, SQL and Getting to the Answer exam.

Check your understanding

A team includes the similarity score in each passage header, hoping the model will weight better-matching passages more heavily. What is the most likely effect?

Pick the one you would defend. Your answer stays private.

Next lesson · 9 minThe source or a summary of it

Stuck on something?Ask Sayali, your AI tutor

How to cite: Addaly (2026) ‘The header on every chunk’, in Context Engineering. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/context-engineering/metadata-that-earns-its-tokens (Accessed: 13 October 2026).