Overview

AI agent architecture patterns are the reusable structures that compose an LLM, tools, and control flow into a working system. The core distinction is between workflows, where the path is predefined, and agents, where the model directs its own steps at runtime. This page is the pillar for the architecture cluster; it catalogs the patterns and when each fits. For the workflow-side detail see agentic-workflow-patterns, for production hardening see reliable-agents-in-production, and for multi-agent coordination see multi-agent.

Start with the augmented LLM, not an agent

The simplest pattern is a single LLM augmented with retrieval, tools, and memory. Most “agent” requirements are met by one model call with the right context and a few tools. Reach for autonomy only when the task has an unbounded number of steps that cannot be planned in advance. Add structure incrementally; every added agent is added failure surface. See tool-use-and-function-calling.

Choose a workflow when the steps are known

When the path is predictable, hard-code it as a workflow and keep the model on a short leash.

  • Prompt chaining: split a task into ordered steps, each a separate call, with a gate between them. See prompt-chaining.
  • Routing: classify the input, then dispatch to a specialized prompt or model.
  • Parallelization: run independent subtasks concurrently and aggregate.

Workflows are cheaper, faster, and easier to evaluate than agents. Prefer them.

Use orchestrator-worker for dynamic decomposition

When subtasks are not known until the model reads the input, an orchestrator LLM decomposes the task and delegates to worker LLMs, then synthesizes the results. This is the pattern behind research and multi-file code edits. The orchestrator owns planning; workers own execution. See multi-agent.

Use planner-executor for long-horizon tasks

A planner produces an explicit step list; an executor runs each step and reports back; the planner replans when a step fails. The separation keeps the plan easy to inspect and recover. See planner-executor and agent-loop for the underlying loop.

Close the loop with evaluator-optimizer

Pair a generator with an evaluator that scores the output against criteria and feeds back concrete fixes, iterating until the score passes. This works when there are clear evaluation criteria and iteration measurably helps, such as writing with a rubric or code that must pass tests. Cap the iterations to bound cost.

Constrain every pattern with structured output and a stop condition

Whatever the pattern, force tool calls and final answers through a schema so the next stage can parse them, and give every loop a hard step or token budget so a stuck agent halts instead of spinning. See structured-output and the system-prompt rules in system-prompts.

Pitfalls

  • Building a multi-agent system where a single augmented LLM would do. Complexity rarely pays for itself below genuinely parallel, long-horizon work.
  • Unbounded loops with no step budget; they burn tokens and never converge.
  • Skipping evaluation. An architecture you cannot measure is one you cannot improve; see reliable-agents-in-production.

Sources

  • Anthropic, “Building Effective Agents” (2024): the workflow-versus-agent distinction and the augmented-LLM, prompt-chaining, routing, parallelization, orchestrator-worker, and evaluator-optimizer patterns.