0PricingLogin
Claude Architect · Lesson

Fixed Pipelines vs Adaptive Decomposition

Prompt chaining for known steps; adaptive for open-ended.

Two Ways to Break Down Work

When a task is too big for a single prompt, you decompose it. There are two fundamental strategies, and choosing the right one is a core architecture skill.

  • Fixed pipeline (prompt chaining): you hard-code a known sequence of steps. Step 1 feeds Step 2 feeds Step 3.
  • Adaptive decomposition: the model decides what to do next based on what it discovers, looping until the goal is met.

The rule of thumb: fixed pipelines for known sequential steps; adaptive for open-ended investigations. This lesson makes that decision precise.

Fixed Pipeline = Prompt Chaining

A fixed pipeline is just prompt chaining: you orchestrate a deterministic sequence in your own code. You know the steps in advance, so you wire them up explicitly. Each call does one focused job, and its output becomes the next call's input.

Because you control the order, the flow is predictable, debuggable, and cheap to reason about. There is no model-driven branching about what to do next — only the work inside each step.

# Fixed pipeline: extract -> classify -> summarize
from anthropic import Anthropic
client = Anthropic()

def step(system, user):
    r = client.messages.create(
        model="claude-sonnet-4-5",
        max_tokens=1024,
        system=system,
        messages=[{"role": "user", "content": user}],
    )
    return r.content[0].text

entities = step("Extract entities as JSON.", document)
category = step("Classify this record.", entities)
summary  = step("Write a one-line summary.", category)

All lessons in this course

  1. Fixed Pipelines vs Adaptive Decomposition
  2. Multi-Pass Decomposition
  3. Session Management
  4. Stale Context & Starting Fresh
← Back to Claude Architect