Part 2 of 16 · 3 min read
Context is rebuilt from a store every step, not remembered
The model keeps nothing between calls, so the string you hand it this time is the only thing it will ever know about this time.
Think of a desk: only what is on the desk right now can be used for the task. Everything else is in a drawer or another room, and the skill is choosing what is worth putting on the desk before you sit down.
In plain words: context engineering means deciding, at every step, what goes into the model's context, in what shape and in what order. It is a program the agent runs again and again, not a prompt you write once.
A worked example. A 60-step support session generates 14,146 tokens across 61 items: a pinned rule at step 0, build and deploy logs most steps, a handful of facts stated once and later corrected, and a question at each of the last 20 steps. The window never holds the whole session; the assembler decides, for each of the 100 questions asked across five seeded runs, which of those 61 items the model actually sees.
The key lines. From code/mini-window/assemble.py:
# from code/mini-window/assemble.py
def build(items: list[Item], query: str, budget: int, policy: str = "curated", order: str = "chrono", safe: bool = True) -> Context:
p = POLICIES[policy]
tail = f"\n{OPEN}user id=question{CLOSE}\n{escape(query) if safe else query}\n{OPEN}/user{CLOSE}"
chosen = arrange(select(items, query, budget - tokens.count(tail), p, safe), query, order) # the question is always sent, so its cost comes off first
text = "\n".join(fence(it, safe) for it in chosen) + tail
n = tokens.count(text)
return Context(chosen, text, n, n > budget)
Read it as: build never looks at what happened on the previous call. Every one of the four stages (fence, trim, select, arrange) runs fresh against the full items store each time. That is the literal meaning of "the model has no memory": whatever reaches the model on this step is only what this one function decided to put there.
Prompt, context, context window, context engineering
Prompt is the instruction text you write (the wording). Context is everything the model is shown for one call: instructions, tool definitions, conversation so far, tool results, retrieved passages, notes and the current question. The context window is the largest context a model accepts, counted in tokens; a request over the limit is refused. Context engineering is deciding, at every step, what goes into the context, in what shape and in what order.
Example: a sliding window of the last ten messages and a curated selection of the ten most relevant items are both valid contexts built from the same store; only context engineering decides which ten actually go in, which is why two agents with the same prompt can behave very differently.