5 patterns

Agent Loops

One model chooses its next action, observes the result and loops, sometimes critiquing itself or learning across attempts.

Patterns in Agent Loops

Augmented LLM

Agent Loops · 6 nodes · 3 LLM calls · 2 scenarios

+2 variants · Schluntz & Zhang 2024

One LLM call that can use tools, retrieval and memory; every other pattern is built from this.

ReAct (Autonomous Agent)

Agent Loops · 5 nodes · 4 LLM calls · 2 scenarios

+2 variants · Yao et al. 2022

Alternate Thought, Action (tool call) and Observation until the model decides it is done.

CodeAct

Agent Loops · 6 nodes · 2 LLM calls · loop · parallel · 2 scenarios

Wang et al. 2024

The agent acts by writing code. One snippet can call many tools, loop and filter, and only its printed output comes back to the model.

CRITIC

Agent Loops · 6 nodes · 4 LLM calls · loop · branch · 2 scenarios

+1 variant · Gou et al. 2023

The model drafts an answer, checks its own claims with tools such as search or code, and revises from the evidence they return.

Reflexion

Agent Loops · 6 nodes · 3 LLM calls · loop · branch · 1 scenario

+2 variants · Shinn et al. 2023

After a failed attempt, the agent writes a lesson in plain language to memory and tries again with that lesson in context.