2.2 Architectural Pattern Selection: Augmented LLM, Workflows & Agents
Key Takeaways
Start with the simplest architecture that satisfies accuracy, latency, and control constraints, escalating complexity only when golden-set evaluation proves a gap
Prefer predefined workflows when process steps are predictable and dynamic control is unnecessary; model outputs within a workflow remain probabilistic.
Use prompt chaining with programmatic checks between predictable stages; tests should catch invalid intermediate outputs before they propagate.
Reserve open-ended autonomous agent loops for problems where step count and tool sequence cannot be known in advance, protected by strict step and cost caps
Skills package reusable procedural instructions and optional resources, loaded as needed; they do not replace application authorization or safety controls.
Architectural Pattern Selection: Augmented LLM, Workflows & Agents
A foundational principle of Anthropic's production guidance is simplicity first: begin with the least complex pattern that satisfies quality, latency, and governance SLAs. Adding extra LLM hops or open-ended agent loops increases token spend, can increase p95 latency, and introduces nondeterministic failure paths. Increase complexity only when evidence from representative evaluations shows it is needed.
Foundational Pattern Comparison
Anthropic describes the augmented LLM as a building block, several workflow patterns (including orchestrator-workers, discussed in the next section), and dynamic agents. The cost and latency in this table are qualitative; they depend on the model, input, output, tool time, and concurrency.
| Pattern | Control Flow | Latency & Token Cost | Best Enterprise Fit | Primary Failure Mode |
|---|---|---|---|---|
| Single-Call / Augmented LLM | One generation call with supplied context, or bounded tool use | Often lowest overhead | Policy Q&A, single-pass extraction, bounded lookup | Overloaded instructions in one prompt |
| Prompt Chaining | Fixed sequential stages with programmatic gates | Sequential calls add latency and tokens | Multi-stage extract, validate, summarize, format | Error propagation without strict stage gates |
| Routing | Classifier dispatches input to specialized handlers | Low-moderate (fast router + target) | Multi-intent triage, model tiering, risk escalation | Misclassification on boundary inputs |
| Parallelization | Concurrent subtasks (sectioning) or consensus (voting) | Ideal critical path is slowest branch plus overhead; total tokens add | Multi-document checks, multiple independent checks | Cost spike if branches duplicate large context |
| Evaluator-Optimizer | Generator plus separate Critic loop up to cap | Higher with each revision round | Iterative code/SQL/prose refinement with clear rubric | Unbounded loops or vague critic criteria |
| Autonomous Agent Loop | Dynamic model-driven planning and tool iteration | Variable; cap time and spend | Bounded research with unpredictable steps | Runaway loops, wrong tools, drift |
Detailed Pattern Walkthroughs and Scenarios
1. Single-Call / Augmented LLM
The building block of modern Claude systems is a single model invocation enhanced with retrieval (RAG), bounded tools, and short-term memory. For example, an internal IT helpdesk assistant can fetch approved runbook excerpts and authorized device status before passing both to one model call. If Claude itself proposes a client tool call, the application executes it and returns the result for a subsequent model request. If measured one-pass performance already meets the quality and latency targets, extra stages may add needless overhead.
2. Prompt Chaining
Prompt Chaining decomposes a fixed, predictable pipeline into sequential steps separated by programmatic gates (schema checks, regex assertions, citation verification, or unit tests). Consider an enterprise RFP compliance pipeline: extract mandatory clauses → programmatic JSON & span validation → map gaps against product specs → format customer response. Each step gets a focused prompt, reducing the instruction dilution that occurs when a single prompt tries to extract, verify, reason, and format simultaneously.
3. Routing
Routing inspects incoming requests via a lightweight classifier (deterministic rules or a fast Haiku-tier call) and directs each input to a specialized prompt, model tier, or human queue. In a global SaaS support center receiving 20,000 tickets daily:
- Password/billing status lookups (55%) route to fast, low-cost retrieval plus a lightweight model (~$0.002/ticket).
- Complex API troubleshooting (35%) routes to a higher-reasoning Claude model with engineering runbook tools.
- Legal threats or security disclosures (10%) route immediately to human specialists.
These illustrative traffic shares total 100%. Routing can reduce blended cost and improve precision, but test classifier errors, fallback behavior, and downstream quality.
4. Parallelization (Sectioning and Voting)
Parallelization takes two distinct forms:
- Sectioning: Splits independent work across concurrent Claude calls so wall-clock latency approaches the slowest branch plus coordination overhead rather than the sum. In a hypothetical benchmark, auditing a 120-page vendor Master Services Agreement across 6 independent compliance domains (privacy, indemnity, SLA credits, termination, IP, security) might complete in about 6 seconds concurrently versus about 35 seconds sequentially, while giving each check an uncluttered prompt.
- Voting: Runs 3 to 5 independent evaluations—often with varied perspectives or rubrics—on checks where additional perspectives may help catch a costly false negative, such as screening outbound marketing copy for regulatory violations or auditing PII redaction before dataset publication. Shared model errors can be correlated, so agreement is not proof of correctness; independent validation and required human approval still apply.
5. Evaluator-Optimizer Loop
In an Evaluator-Optimizer loop, one Claude call generates a candidate artifact and a separate Critic call scores it against an explicit rubric, returning targeted feedback until quality passes or a hard iteration cap (for example, 2 to 3 rounds) is reached. This can work well when an external deterministic signal informs the critic—for example, generating an analytical report, checking calculations against known reference data, and feeding syntax or performance findings back to optimize the query. Never deploy this loop without objective rubric criteria and a bounded loop counter; vague instructions like "make it better" cause oscillating edits and wasted tokens.
6. Open-Ended Autonomous Agent Loop
An autonomous agent loop lets Claude dynamically choose tools, inspect environment results, and plan subsequent steps at runtime. Use this only when the sequence and number of steps cannot be predetermined—such as preparing an internal research brief where later information requests depend on earlier results. Production agent loops require strict guardrails: an application- or runtime-enforced step limit (for example, 15 iterations), sandboxed read-only or stage-only tools, loop-detection circuit breakers for repeated failing tool calls, and explicit token budgets.
Skills-based packaging
A Skill is a modular package of task instructions, metadata, and optional reference files or scripts. A team that repeatedly produces vendor risk-review memos can maintain one reviewed Skill with the rubric, response template and decision guidance rather than copying those instructions into every prompt. The Skill description supports discovery; detailed instructions and reference materials load as needed. Reuse reduces duplication, but does not make model behavior deterministic. Version and review the package, trust only approved resources, constrain its tools, and keep approval and access policy outside the Skill. Check surface-specific feature and data-handling availability: Skills on the API use a code execution environment and have their own retention and eligibility constraints.
Worked Trade-Off: Choosing Between RAG, Workflows, and Agents
Suppose an engineering team must build a policy-and-runbook assistant for 2,000 cloud engineers. First benchmark a Single-Call Augmented LLM with hybrid BM25 + vector RAG (top 8 chunks, reranked) against a 300-question golden test set. If retrieval recall is 95% and single-turn grounded accuracy hits 94% at 1.9 seconds P95, stop there. If multi-part compliance questions drop to 76% because retrieval misses cross-referenced clauses, upgrade to a two-step Prompt Chain (decompose sub-queries → retrieve and verify citations → synthesize) rather than an autonomous 10-turn agent. Consider a bounded agent only when a measured need remains for dynamic, multi-step research after simpler workflows have been evaluated.
Exam Trap: Architects often reach for an autonomous agent loop for a repeatable document workflow (ingest → extract → validate → summarize) simply because "agent" sounds modern. Because the steps are already known at design time, a predefined Prompt Chain can make control flow and cost easier to reason about, though its sequential calls can add latency. Compare it against a single augmented call before deployment.
Official references
A healthcare payer needs to process incoming provider appeals through four fixed stages: extract diagnosis codes from PDFs, verify codes against a deterministic ICD-10 lookup table, summarize clinical justification, and generate a structured reviewer packet. Which architecture best fits this workload?
An open-ended autonomous agent loop that dynamically discovers which tools to invoke at each turn
Prompt Chaining with programmatic validation gates between fixed sequential stages
An Evaluator-Optimizer loop running up to 10 rounds per appeal
A single unaugmented LLM call containing all four instructions and the full ICD-10 manual
A legal operations team must evaluate 100-page vendor contracts across eight independent compliance categories (data privacy, IP ownership, SLA remedies, termination, etc.) within a strict 10-second P95 latency SLA. Which pattern is the strongest candidate to benchmark against the SLA?
Sequential Prompt Chaining running all eight compliance checks one after another
An open-ended autonomous agent scanning the contract interactively
Parallelization using sectioning so eight focused Claude calls evaluate independent categories concurrently
Routing each contract to a smaller model to read all eight categories in one compressed turn
When does an Evaluator-Optimizer loop justify its extra token and latency overhead over a single-pass generation call?
Whenever a team lacks evaluation metrics and wants the critic to subjectively improve tone indefinitely
When input queries are simple FAQ lookups that already score 98% on first pass
When latency must remain strictly under 1.5 seconds per request
When clear, objective rubric criteria or deterministic dry-run signals exist, iterative edits measurably raise pass rates, and iterations are strictly capped
A customer support platform handles 50,000 daily messages split across simple order-status questions, complex warranty disputes requiring multi-policy reasoning, and urgent account-takeover reports. Which pattern minimizes cost while protecting high-risk accuracy?
Routing incoming tickets by intent and risk to specialized prompts, model tiers, or immediate human security queues
Running every ticket through the largest reasoning model in a 5-step autonomous loop
Using Evaluator-Optimizer consensus voting on every order-status inquiry
Combining all three workflows into a single universal system prompt without classification
Sections you finish are checked off in the contents.