← All tutorials
Anthropic Agent Architectures

Anthropic's agent architectures — workflows & the loop

In Building Effective Agents, Anthropic draws one crucial line: workflows orchestrate LLMs and tools along predefined code paths, while agents let the LLM dynamically direct its own process in a loop. Both are built from one primitive — the augmented LLM — and the whole art is choosing the simplest structure that works.

workflows — code defines the path — predictable vs agents — the model decides — flexible
The headline advice. Don't build an agent when a single well-crafted prompt or a simple workflow will do. Add autonomy (and its cost, latency and unpredictability) only when the task genuinely needs it.

Building block  The augmented LLM

Everything is composed from an augmented LLM — a model enhanced with three capabilities it can use itself:

🔎 Retrieval

Pull in relevant external knowledge on demand (RAG) to ground its answers.

🛠️ Tools

Call functions/APIs to act on the world and get real results back.

🧠 Memory

Retain context across steps and turns so it can build on prior work.

Workflows and agents differ only in how these augmented calls are arranged — by your code, or by the model.

Predefined paths  Workflow patterns

Five composable patterns cover most workflow needs — the code, not the model, decides the route:

① Prompt chaining sequential steps

Shape Decompose a task into a fixed sequence of LLM calls, each acting on the previous output — with optional programmatic gates to check progress between steps.

Use when The task cleanly splits into predictable subtasks (e.g. outline → draft → polish); trading latency for accuracy.

② Routing classify, then specialize

Shape Classify the input and send it to a specialized prompt or tool tuned for that category.

Use when Inputs fall into distinct kinds that are each handled better separately (e.g. refund vs. technical vs. sales).

③ Parallelization sectioning & voting

Shape Run LLM calls in parallel — either sectioning (split into independent subtasks) or voting (run the same task several times for diverse takes / consensus).

Use when Subtasks are independent (speed), or multiple attempts improve confidence (e.g. guardrail checks, majority vote).

④ Orchestrator–workers dynamic delegation

Shape A central orchestrator LLM breaks a task into subtasks at runtime, delegates them to worker LLMs, and synthesizes the results.

Use when You can't predict the subtasks up front (e.g. multi-file code changes, research over many sources).

⑤ Evaluator–optimizer generate → critique → refine

Shape One LLM generates, another evaluates against criteria and gives feedback; loop until it passes.

Use when You have clear evaluation criteria and iterative refinement measurably helps (e.g. translation, literary polish).

All runnable here. The experiments folder has working scaffolds for these (sequential, parallel, loop, review & critique, iterative refinement) on the LangChain/LangGraph stack.

The model decides  The agent loop

An agent drops the predefined path. Given a task, the LLM plans, calls a tool, observes the result, and loops — repeating until it decides it's done (or hits a stopping condition / human checkpoint). Its trajectory isn't fixed in advance.

The autonomous agent loop A task goes to the LLM, which plans and calls a tool, observes the result, and loops back to plan again until it decides the task is done. not done → loop done? Task LLM reasons/ plans Act — call a tool Observe result Done ✓
the loop, conceptually
# An agent is a loop: reason → act (tool) → observe → repeat, until done.
messages = [user_task]
while True:
    reply = llm(messages, tools=TOOLS)        # reason / plan
    if reply.tool_calls:
        results = run_tools(reply.tool_calls)  # act
        messages += [reply, results]           # observe, then loop
    else:
        return reply                           # no tool call → done
Use agents for open-ended tasks where the number of steps can't be predicted and you can't (or don't want to) hard-code the path — with guardrails: tool-call limits, stopping conditions, and human checkpoints for high-stakes actions.

Choosing — start simple

If the task…Reach for…
Fits one well-crafted promptJust the augmented LLM — no orchestration
Splits into fixed, ordered stepsPrompt chaining
Falls into distinct categoriesRouting
Has independent subtasks / needs consensusParallelization
Has unpredictable subtasks decided at runtimeOrchestrator–workers
Needs iterative refinement against criteriaEvaluator–optimizer
Is open-ended with an unknown number of stepsAn agent (the loop)
Rule of thumb. Increase autonomy only as the task demands it. More autonomy means more capability but also more latency, cost and unpredictability — so climb this ladder one rung at a time, and measure.

Cheat sheet

QuestionShort answer
Workflow vs agent?Workflow = code defines the path; agent = the LLM decides at runtime.
The base building block?The augmented LLM (retrieval + tools + memory).
The five workflow patterns?Prompt chaining, routing, parallelization, orchestrator–workers, evaluator–optimizer.
What is an agent, mechanically?A loop: reason → act (tool) → observe → repeat until done.
Core advice?Start simple; add autonomy only when the task needs it.
Agent guardrails?Tool-call limits, stopping conditions, human checkpoints.

Knowledge check

Six questions on Anthropic's agent architectures. Pick an answer for each, then check your score.

1. What is the key distinction Anthropic draws?

2. What is the "augmented LLM"?

3. Inputs fall into distinct categories each handled better separately. Which pattern?

4. Subtasks can't be predicted up front and must be decided at runtime. Which pattern?

5. Mechanically, an agent is…

6. What is Anthropic's core piece of advice?

Next steps

🧭 Google agent patterns

The other taxonomy — Google Cloud's design patterns, organized by who decides the route.

🔄 Getting started with loops

Loop engineering — running the agent loop unattended until a stop condition.

🧰 Agent Development Kits

Build these patterns — the frameworks (Google ADK, Strands, LangGraph) that implement them.

🧪 Runnable experiments

Scaffolds for each pattern — sequential, parallel, loop, review & critique, and more.

📓 All tutorials

The hub — LLMs, agents, protocols, cloud & more.