Skip to content
AIMODELRACE
Stage 11 of 12 · Expert

Loops, Graphs & Agents

Iterate, branch, merge and orchestrate: the structures behind expert prompting.

The most capable AI workflows are not single prompts. They are loops that refine until criteria are met, trees that explore options, graphs that branch and merge with shared state, and agents that plan, act and observe. Learn each pattern, the research behind it, how to keep it under control, and how to ground it with tools, retrieval and memory.

0/11

11

modules

113

minutes total

Modules

  1. 1

    Thinking in loops and graphs

    9 min

    The five shapes of AI workflow, the vocabulary of nodes, edges and state, and how to choose between them.

    Start here →

  2. 2

    Refinement loops: generate, critique, revise

    11 min

    Improve outputs by looping through feedback, as Self-Refine and Reflexion do, without drifting into blandness.

  3. 3

    Agent loops: plan, act, observe (ReAct)

    11 min

    How agents interleave reasoning with actions, how to brief one well, and the plan-and-execute variant.

  4. 4

    Coding loops: keep going until the tests pass

    10 min

    Use tests as the stopping condition for coding agents, keep them honest, and stay in control of the result.

  5. 5

    Loop control: stopping conditions, budgets and drift

    10 min

    Design loops that finish: success criteria, caps, budgets, progress checks, oscillation detection and escalation.

  6. 6

    Tree of Thoughts: branching and searching

    10 min

    Explore several lines of reasoning, evaluate them, and pursue the promising ones, in a single prompt or with orchestration.

  7. 7

    Graphs: Graph of Thoughts and agent workflow graphs

    12 min

    Branch, merge and loop with shared state, from Graph of Thoughts to stateful agent graphs you can build and debug.

  8. 8

    Tool use and function calling

    10 min

    How models call tools, how to describe tools so they're used well, and how to keep tool use safe.

  9. 9

    RAG and grounding with sources

    10 min

    Answer from your documents, cite them, and say 'not found' instead of guessing.

  10. 10

    Long context, context engineering and memory

    10 min

    Decide what goes into the context window and where, and how agents remember across steps and sessions.

  11. 11

    Multi-agent patterns

    10 min

    Orchestrator-worker, pipelines, debate and reviewers: when several agents beat one, and when they don't.