Build an Agent
Write a tool-using agent from scratch, one piece per problem: parsing, dispatch, the loop, guardrails, memory, planning, evals.
Intermediate · 12 problems · 0 passed · Background reading: ReAct Agents in Production
This is one program built in stages. Each stage's starter code includes the finished code from the stages before it, so you can start anywhere, but going in order is how it's meant to be read.
- 01Parse a Tool Call From Model Outputeasy
- 02Validate Tool Arguments Against a Schemaeasy
- 03Dispatch Tool Calls Without Crashing the Agenteasy
- 04The Agent Loopmedium
- 05Recover From Malformed and Failing Tool Callsmedium
- 06Guardrails: Loop Detection and Token Budgetsmedium
- 07Trim Context Without Orphaning Tool Resultsmedium
- 08Parallel Tool Calls With IDsmedium
- 09Long-Term Memory Recallmedium
- 10Plan-and-Execute With Dependencieshard
- 11Evaluate Your Agenthard
- 12Capstone: A Production Agent Loophard
Next track: Specify, Verify, Debug