When is using an agent architecture an engineering mistake, even when LLMs are involved?
Describe the conditions under which choosing an agent architecture is an engineering over-complication, even for an LLM-powered task. What alternative is appropriate and why?
An agent is the wrong tool when the execution path is fixed at design time. A chain is cheaper, faster, and predictable when nothing needs dynamic routing.
Imagine you need to make tea the same way every morning: boil water, add a bag, pour, steep, remove. You do not hire a chef who decides each step fresh, asks what to do next, and might wander off to grind beans. You just follow the recipe. An agent is the chef: smart, flexible, and great when the next move genuinely depends on what you find. But for a fixed recipe, that flexibility is wasted. Worse, the chef pauses to think before every action, so the tea takes longer and costs more, and some mornings the chef gets confused and makes ten cups. A chain is the recipe card. When you already know the steps and their order, the recipe wins on speed, cost, and the simple comfort that tomorrow's tea looks exactly like today's.
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.
State the condition (a fixed execution path) in one line, name the chain as the alternative, list the predictability, cost, and debuggability wins, give a concrete ingestion or retrieval example, mention the conditional-branch middle ground, and close with the deciding question about result-dependent next steps.
Real products, models, and research that use this idea.
- Document ingestion pipelines in LangChain LCEL run extract, chunk, embed, and store as a fixed graph with no loop, because the order never changes.
- Basic retrieval augmented generation over a knowledge base is a two-step chain of retrieve then generate, which production stacks like LlamaIndex express without any agent.
- Teams using LangGraph reserve cyclic loop-back edges for genuinely dynamic tasks and keep linear flows as straight-line graphs to preserve a predictable cost and latency profile.
- A support-ticket triage that classifies then fills a fixed template is a conditional chain, not an agent, even though it calls a model like Claude Opus 4.7 at each node.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhere exactly is the line between a conditional chain and a true agent?
QHow would you justify migrating an existing agent back to a chain?
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 uses an LLM. Agency is justified by a dynamic execution path, not by the mere presence of a model in the system.
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.