Context Engineering Concepts › What the model gets to read
01 · part 1, conceptsconcept

What the model gets to read

Context engineering means choosing, on purpose, what text you send to the model with each request, and checking that your choice works.

Why you have to choose

A model starts every request from zero:

  • It remembers nothing from earlier requests.
  • It can't open your files, your database or your code.
  • It knows nothing about your company, your product or your customers.

So on every request, your program packs one block of text and sends it. The model reads that block and nothing else.

What goes into the block

What the model will read one request, filling in the order your program fills it 1200 words — the hard edge the task the user's request, unmodified carried context attached to every request, by you fetched context looked up for this request only fills upward Nothing else builds this. There is no memory between calls and no filesystem the model can reach. Fetched context goes in last, so it is the first thing that does not fit.
One request, filling up. Follow it from the bottom.
The order matters. Step 3 shows what it costs.
  1. The block has a size limit. The top edge is the most it can hold: 1,200 words in this volume's labs.
  2. The user's question goes in first. The user chooses it, not you.
  3. Next comes carried text: text you attach to every request, such as your rules or a style guide. You choose it when you build the system.
  4. Last comes fetched text: text your code looks up for this request only, such as the help article that matches the question.
  5. Fetched text goes in last, so it's the first to be left out when the block is full.
part of the blockwhat it iswho chooses itwhen
the questionthe user's request, as writtenthe userwhen they ask
carried texttext attached to every requestyouwhen you build the system
fetched texttext looked up for this request onlyyour codewhen they ask

When it gets hard

While everything fits and nothing changes, packing the block is easy. It gets hard in either of two cases:

  • You have too much text. Your material is bigger than the limit, so you have to decide what to leave out.
  • Your text changes. A policy or a how-to guide gets updated. Any old copy pasted into a program is now wrong, and nothing warns you.
The size limit is called the context window. It's usually counted in tokens, which are pieces of words. This volume counts words instead, which works just as well for comparing one choice with another.

Both problems are silent

  • The model doesn't say a document is missing.
  • It doesn't say your text was cut off.
  • It answers anyway, just as confidently.
You can't catch these by watching for errors, because there aren't any. You catch them by counting what went into the block.

How big the labs are

in this volume's labs
pieces of text per jobsix
requests per job30
size limit1,200 words
choices comparedevery way to carry or fetch the six pieces

Six pieces is small. It's enough to show how this works, but not enough to promise the same result with sixty. Step 12 covers that.

Try it. In the labs folder, run:
python3 lab.py

Part 1 draws the code review job's six documents as bars, and shows them inside the size limit, like the diagram above.

What to remember

  • The model starts from zero. Your program builds everything it reads.
  • The block holds the user's question, the text you always send, and the text you look up.
  • Missing or cut-off text causes no error, so you have to count what you send.