Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 04 · AI · The string and the contract · about 27 min to read

Play it as a journeyTutor comes with a plan

Context Engineering (what goes in the window, and who decides)

Context Engineering
Context Engineering · Open board

Building with LLMs, the third board of the run. “What the Model Sees” (What the Model Sees (one string, every turn, from the top)) showed the returns desk’s whole string, spent to the last token. “Prompt Engineering” (Prompt Engineering (shaping the next-token distribution)) took the 1,200 tokens a person writes once and made each one earn its place. This board is the other 6,000: a help centre thirty times the window’s size squeezed into three pages, a table where fetching more text made the answers worse, three small edits a harness makes on every turn, and four ways the window goes wrong before the answer does.

Before you start. A token is a word or a piece of one, and the model can see only a fixed number of them at a time: 8,000 for the returns desk. That whole 8,000 is the context window, the single string handed over on one call, and inside it sits the system prompt, the standing instructions a person writes once (What the Model Sees (one string, every turn, from the top), Prompt Engineering (shaping the next-token distribution)). A tool call is the model asking outside code to look something up, with the answer pasted back into the string. Reading the window is fast, writing the reply is slow, and both are paid for one token at a time, so a token spent on the wrong page is one the right page cannot have. Nothing here changes any of that. It only asks who fills the tokens that neither a person nor the customer wrote.

Lesson 43 of 83 in AI

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • Monday: the window said 30 days, the policy said 14
  • 1994: finding a page by the words on it
  • 2019: two pieces of text that never meet
  • 2020: teaching the model to open a book instead of guessing
  • The second trip: reading the question and the page together
  • The window, packed again mid-conversation
  • 2023: the middle of the window is where things get lost
  • Three pages in, out of four hundred
  • The jacket test: did it arrive, did it help?
  • Three edits before the model reads anything
  • Four ways Monday happens again
  • Would a huge window end the packing?
  • All of it in code
  • The whole picture

Terms it explains: embedding, chunks, retrieval-augmented generation, retriever, reranker, compaction, Context engineering, overlap, metadata, top-k, bi-encoder, cross-encoder, Recall@k, Accuracy, Hybrid retrieval, BM25, Prefill, TFLOP.

Related paper

Review AI