May we use cookies so Meta, Google, LinkedIn and ChatGPT see your visit and we learn which ads work? PrivacyMay we use cookies to see which pages help, and let Meta, Google, LinkedIn and ChatGPT see your visit, so we know which of our ads work? That way we spend less on ads that do not work. We do not sell your data, and the site works the same if you decline. You can change your answer at any time under Cookie settings at the foot of the page. Privacy policy
Loading...
2 system design questions lean on this idea. Each walks through the full answer.
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
Generative AI and Agentic AI Engineering
Unlock this lesson and the 208 other paid lessons
$35 once, by card or PayPal
See the Generative AI and Agentic AI courseread the rest of this lesson in
Generative AI and Agentic AI Engineering
Unlock this lesson and the 208 other paid lessons
$35 once, by card or PayPal
See the Generative AI and Agentic AI 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.
One-time payment by card or PayPal
Get Lifetime AccessOne-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.