Skip to content
AgenticAIWiki
  1. Learn
  2. Part 8. Agentic AI and orchestration
  3. Chapter 42

The agent loop and agent SDKs

4 lessons · 24 min

Builds on 33. The tool use loop

Gather, act, check, repeat

Full screen
contextchangeresultgo againTaskfix failing testGather contextread test and codeTake actionedit the functionCheck the workrun the testsDecidecontinue or stop?

Swipe to change step

Step 1 of 8. The loop starts by gathering context. Good agents look before they act: here it reads the failing test and the code it covers. Task (fix failing test). Gather context (read test and code), highlighted. Take action (edit the function). Check the work (run the tests). Decide (continue or stop?). arrow from Task to Gather context. arrow from Gather context to Take action, labelled context. arrow from Take action to Check the work, labelled change. arrow from Check the work to Decide, labelled result. arrow from Decide to Gather context, labelled go again. a task moving along e0.

In this chapter

  1. 42.1The agent loop5 min read
  2. 42.2Building with an agent SDK7 min read
  3. 42.3Stop conditions, turn limits and budgets6 min read
  4. 42.4Session state across turns6 min read

Chapter check

Already know this? Score 80% or more and you can skip ahead. Each attempt draws 4 questions from 12.

Loading check…