When should you use a fixed DAG pipeline instead of a dynamic agent loop?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
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.
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.
What an interviewer would ask next. Try answering before peeking at the approach.
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.