AI Engineering · Agents In Production
Free preview: the first part of this 11-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
AI Engineering
Unlock this lesson and the 199 other paid lessons
$49 once, by PayPal
See the AI Engineering courseread the rest of this lesson in
AI Engineering
Unlock this lesson and the 199 other paid lessons
$49 once, by PayPal
See the AI Engineering coursein Agents In Production
This lesson is part of the AI Engineering course. Unlock the full course, a separate one-time payment, for lifetime access.
This idea carries a full system design question on its own. Each walks through the full answer.
One-time payment: UPI, card or netbanking
Get Lifetime AccessFoundation lessons of this course are free, no payment needed. Try them now
Nothing. The model remembers nothing between steps.
A language model is stateless. It does not carry anything from one call to the next. So on every step of the loop from lesson one, the orchestrator resends the entire conversation so far: the goal, every action the model took, and every observation that came back. That block of text is the only thing the model sees. It is not remembering the task. It is rereading a transcript you hand it, from the top, every time.
This one fact drives the whole lesson. If the model only knows what is in the transcript on this step, then two things decide how the agent behaves: what you put into that transcript, and what you leave out. Both are choices, and both are yours. The word "memory" hides that. It makes the transcript sound like something the model owns and manages. It does not. You manage it, or it manages you by growing until it breaks.
It helps to see what actually occupies that transcript on a single step, because "memory" is not one undifferentiated blob. It is a fixed token budget, and several different things compete for the same space: a small block of system instructions and safety rules, the schema of every tool in scope, whatever long-term facts you retrieved for this step, a compressed summary of older turns, and the recent turns kept word for word. Each line has a different cost and a different claim on being kept.

Notice which line dominates. The verbatim recent turns are more than two thirds of the budget on their own, while the fixed lines at the top, the system prompt and the tool schemas, are cheap. That single fact is why cost balloons on a long run and why, when the budget is blown, every cutting decision revolves around those recent turns and almost never the small fixed blocks.