Use a fixed chain when the steps are known up front; use an agent only when the next step must depend on what the last step returned.
Think of it like two ways to cook dinner. The first is a recipe card: chop, fry, simmer, plate. Same steps in the same order every night, so you know exactly how long it takes and what it costs. The second is a chef with no recipe who tastes the dish after each step and decides what to do next. The chef can handle a surprise ingredient the recipe never planned for, but they are slower, pricier, and harder to predict. A fixed chain is the recipe card. An agent is the tasting chef. If you already know every step before you start, use the recipe. Only hire the chef when you genuinely cannot know the next step until you see how the last one turned out.
Detailed answer & concept explanation~8 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
Lead with the control flow distinction, name the three guarantees a fixed DAG provides, explain why complexity is not the test, give two tasks where dynamic routing pays off, then close with the per-turn cost penalty and the start with a chain heuristic.
| Property | Fixed DAG chain | Agent loop |
|---|---|---|
| Who controls the next step | Developer, at design time | The model, at run time |
| Latency | Bounded, fixed step count | Grows with trajectory length |
| Cost per request | Predictable constant | A distribution, hard to budget |
| Reproducibility | Same input takes same path | Runs can diverge on identical input |
| Right when | Path is fully known up front | Path branches on intermediate results |
Real products, models, and research that use this idea.
- LangChain LCEL chains and LangGraph graphs without loop back edges are the canonical fixed-DAG shape used for predictable production features like classify then route then summarise.
- Most retrieval augmented generation features ship as a fixed chain: embed the query, retrieve, then generate, with no run time branching needed.
- Cursor and Cline run true agent loops for coding because the next edit genuinely depends on the last test result, which no static graph can encode.
- Perplexity's research mode uses an agent loop because each retrieved finding reshapes the next query, the defining case where dynamic control flow pays off.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow do you handle a task that is mostly fixed but has one branch point in the middle?
QWhat signals during development tell you a chain should be promoted to an agent?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Reaching for an agent because the task feels complex. Complexity is not the test. The test is whether the control flow is fixed at design time or must be decided at run time.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.