0 Making Custom Agents Work
How language models, tools, state, and feedback become a working system.
Updated
A language model produces a prediction. An agentic system puts predictions into a loop: choose an action, observe its result, update the working state, and decide what to do next. The interesting engineering lives in the connections between those steps.
Begin with the loop
Section titled “Begin with the loop”Consider a research assistant answering a question about a paper. It may search a collection, open a relevant document, extract evidence, and then write an answer. Each result changes what the assistant should do next. The same model without access to those observations must answer from the context it already has.
The architecture chapter develops a small, explicit model of this loop. It separates the language model’s decisions from the application code that validates actions, executes tools, and enforces limits.
Questions to ask of any agent
Section titled “Questions to ask of any agent”- State: What information persists between steps, and which part is sent to the model?
- Actions: What operations can the system perform, and who authorizes them?
- Feedback: How does it distinguish an attempted operation from a successful result?
- Termination: What stops the loop when the task is complete, impossible, or too costly?
- Evaluation: What observable outcome would make the run a success?
These questions remain useful whether the implementation uses one model call or several collaborating workers.
The model and its environment
Section titled “The model and its environment”The model remains one component of the larger system. Attention explains how a transformer mixes information within its context. The agent loop explains how new information enters that context over time. Infrastructure makes those interactions observable and operationally manageable.
The goal of this section is to make each boundary explicit enough to inspect, test, and change independently.