The knowledge hub
Every episode, supplement and Frontier Dispatch as a readable article — with the cinematic render, the full transcript, and the one idea that matters. 276 articles and counting.
07
The agent turn
20 articles#167Ep2:30
The model has amnesia.
The model is stateless — every call starts from a blank slate, and it remembers nothing between calls.
#168Ep2:45
So how does chat 'remember'?
The whole conversation history is resent every turn — chat "memory" is the app re-reading the entire transcript to a stateless model, not…
#169Ep2:30
The prompt IS the program.
Because a stateless model only knows what's in its context, the context you assemble is the software — prompting is programming in English.
#170Ep2:30
System vs. user vs. assistant roles.
Every message carries a role label — system (rules/identity), user (requests), assistant (the model's own prior replies) — and roles are…
#171Ep2:30
Context engineering beats prompt 'tricks.'
What you put in the context — the right information, examples, and clear instructions — matters far more than clever phrasing or magic…
#172Ep2:30
Making it output clean JSON.
To wire AI into software, force structured JSON output instead of chatty prose — machine-readable fields a program can parse.
#173Ep3:00
Forcing valid output with grammars.
Constrained decoding uses a grammar to allow only tokens that keep the output valid at each step — making invalid output impossible (only…
#174Ep2:45
How logit masking actually works.
At each step the model scores every token (a logit); constrained decoding sets forbidden tokens' logits to negative infinity before…
#175Ep2:30
The hidden cost of forcing structure.
Forcing structured output isn't free — clamping a rigid format on too early can make the model reason worse, because it deletes the…
#176Ep2:45
How a text model 'calls a function.'
A model can't run code — "tool calling" means it emits a structured request (function name + JSON arguments), and the surrounding program…
#177Ep2:30
Your tools are eating your prompt.
Every tool you give a model must be described in the context — and those schemas are tokens: paid for on every call, eating context…
#178Ep2:45
The loop that makes an 'agent.'
An agent is just a model in a loop: it thinks, calls a tool, observes the result, and repeats — choosing each next step from what it just…
#179Ep2:30
Chatbot vs. agent: the real difference.
A chatbot answers and stops; an agent runs the loop and acts. The real difference isn't intelligence — it's the scaffolding (loop + tools…
#180Ep2:30
How an agent plans a big task.
Faced with a goal too big for one step, an agent decomposes it into a tree of smaller subtasks, then works through them leaf by leaf with…
#181Ep2:30
How an agent checks its own work.
A reliable agent verifies each step instead of assuming it worked — using objective tool-based checks (run tests, compile, validate) where…
#182Ep2:30
Agents get stuck in loops.
The same loop that gives an agent its power can trap it — repeating a failing action, oscillating between states, or wandering — because…
#183Ep3:00
[LAB] Build an agent in 30 lines.
An agent is so simple you can build one in ~30 lines: define a couple of tools, write a system prompt, then loop — send the model the goal…
#184Ep2:45
Prompt injection: hijacking an agent.
Because an agent can't reliably separate its trusted instructions from untrusted text it reads (web pages, files, tool results), malicious…
#185Ep2:30
Why 'the model can act' is dangerous.
The leap from a model that talks to a model that acts crosses a bright line — mistakes and manipulations now cause real, often…
#186Ep2:30
Context rot: why long agent runs decay.
Over a long run, an agent's context fills with accumulated history — old steps, tool dumps, dead ends — burying the goal and drowning the…