Trail 04 · 14 lessons · 13 on video
Building agents
Give the model autonomy without the classic accidents: loops with a budget, a small toolset, subagents, and multiple agents only when they pay off.
- 01Pattern▶ 10 minReAct LoopAlternate reasoning, action, and observation until the task is done.
- 02Smell▶ 8 minUnbounded LoopThe agent can call tools forever; the only limit is the credit card.
- 03Refactoring▶ 8 minAdd Loop BudgetCap steps, time, and money for each run and define what happens at the limit.
- 04Pattern▶ 9 minStop ConditionsDefine clearly when the agent is done, has given up, or needs help.
- 05Smell▶ 8 minTool SprawlThe agent has 40 similarly named tools and often picks the wrong one.
- 06Refactoring▶ 9 minConsolidate ToolsMerge similar tools and remove the ones nobody uses.
- 07Pattern▶ 8 minTool RouterPick a small subset of tools before calling the main model.
- 08Smell▶ 8 minMega AgentOne agent researches, writes, reviews, and publishes with the same context and the same tools.
- 09Refactoring▶ 9 minExtract SubagentGive a large task its own agent with a clean context and only the tools it needs.
- 10Pattern▶ 9 minSubagent DelegationThe main agent spawns subagents for focused tasks and receives only the conclusion.
- 11Pattern▶ 8 minOrchestrator-WorkersOne model decides subtasks on the fly and hands them to workers.
- 12Smell▶ 8 minDecorative Multi-AgentFive agents with job titles passing text to each other without splitting any real work.
- 13Refactoring▶ 9 minCollapse AgentsMerge agents that only pass text along into one agent with the right tools.
- 14Real-world scenarioCoding agentAn agent that reads the repo, edits files, runs tests, and opens a PR.
- Final projectLangGraph LabCoding agentAn agent that takes the task, edits the repo, runs the tests and opens the PR for review.