Labs / Lab 06

Build a tiny agent loop

Make the plan-act-observe cycle visible before a real model starts driving it.

What this adds

Expose the control loop.

The planner here is deliberately simple. That keeps the important part visible: observe the request, choose a tool call, execute it, inspect the result, then stop or continue.

Once you can see the loop clearly, replacing the planner with a model becomes a smaller conceptual jump.

Boundary

The loop owns state transitions. The model or planner supplies a decision, but the runtime must still execute and record each step.

Done when

Every step leaves a visible trace showing the chosen action, the result, and the reason the loop stopped.

Real-world analog

LangGraph is a useful real-world comparison because it makes loops, state, and transitions explicit rather than hiding them in one prompt.

Read alongside it

The broader frame for this layer lives on the agents page.

Next lab

Lab 07: add durable state.