CSE Roadmap

Core tier · about 5 hours · 6 parts

Part 1 of 6 · 1 min read

Overview

In this module you will

  • Write the agent loop from scratch: call the model, parse its choice, run the tool, feed back the result, repeat.
  • Explain the ReAct format (Thought, Action, Action Input, Observation) and why each part exists.
  • Name the common failure modes of the loop and which guard fixes which.
  • Choose a step limit and say what each extra step costs.
  • Decide when an agent loop is the wrong tool and a fixed workflow (Level 3) is better.

Levels 2 to 4 gave you pieces: calling a model, structured output, prompts, retrieval. An agent is what you get when the model chooses what to do next and your code keeps asking it until it says it is done. Every framework (LangGraph, the OpenAI and Anthropic agent SDKs, and the rest) is a wrapper around this loop, so building it once makes all of them readable. It is also where most production agent bugs live: loops that never end, tools called with bad arguments, a model that ignores what a tool just told it.

About the examples

The "language model" in the code is a rule program that reads the question and the observations so far and replies in the Thought / Action / Action Input format. A second wrapper gives it one bad habit at a time (repeating itself, breaking the format, naming a tool that does not exist, answering without tools). This makes the loop's behaviour visible and testable offline, but a real model fails in many more ways, more subtly, and differently from run to run. The world is tiny: 13 wiki sentences, one CSV file and 12 tasks. The percentages show the shape of the effect, not benchmarks. No real model was called.