Zenaique

Pick the library that exposes the agent loop as an explicit graph

MCQ·Easy·4.0 · 0·~1 min·Asked atC3 AiDeloitteStability Ai
Attempt it
TL;DR

LangGraph models the agent loop as a typed StateGraph with nodes, edges, conditional edges, and shared state. Control flow that you can see in code, not hidden inside a while loop.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Picture four tools claiming to show you how a robot decides what to do next. One says 'trust me, it works' and hides the decision inside a black box. Another draws you a real map: here are the places the robot can go, here are the arrows between them, here is the rulebook it follows. The map-drawer is what we want. The other tools are useful for different jobs, one for piping water (composition), one for taking photos after the robot finishes (observability), but neither is the map.

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

The four options in this MCQ sit at different layers of the LangChain ecosystem and the question is testing whether the candidate knows which one owns explicit graph-based control flow. The correct answer is LangGraph; the distractors each represent an adjacent concern (legacy orchestration, stateless composition, observability) that a candidate might confuse for control flow if they have not built recent agent code.

This section walks the four layers, explains why LangGraph is the right answer for 'explicit graph', and traces the historical arc that put LangGraph in the production default position in 2026.

What AgentExecutor actually does

AgentExecutor is the agent runtime that shipped with the original LangChain agents API. Under the hood it is a Python while-loop. The body of the loop: call the configured LLM with the current message history and the available tool definitions; if the LLM returns a tool call, run the tool and append the result to history; if the LLM returns a final answer or signals stop, exit and return. The whole orchestration runs inside one Python process's memory.

The user-facing API is intentionally hidden. You call agent_executor.invoke({'input': 'do something'}) and get back a result dict. There is no graph to inspect, no nodes to point at, no edges between steps. The loop is real and well-tested, but it is encapsulated. That encapsulation was the design. Early LangChain wanted 'one line to build an agent' as its pitch.

The cost of that encapsulation became apparent over 2023: agents were hard to debug because the loop was opaque, hard to extend because subclassing the executor was the only escape, hard to persist because there was no state primitive, hard to do human in the loop because the loop had no pause mechanism. The MCQ option 0 (AgentExecutor runs the loop visibly as a list of nodes and edges) inverts the actual design. It claims as a feature exactly what AgentExecutor was built to hide.

Why LangGraph is the explicit-graph answer
Why LCEL is composition, not control flow
Why LangSmith is observability, not orchestration
The historical arc
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.
ToolLayerWhat it doesUse when
AgentExecutorLegacy agent runtimeWhile loop dispatching LLM and toolsMaintaining old code; new code should not
LangGraphControl flowExplicit StateGraph with nodes, edges, stateMulti-step agents, HITL, durable workflows
LCELCompositionStateless directed acyclic pipes via the pipe operatorPrompt to model to parser chains, transformations
LangSmithObservabilityTracing, evaluation, prompt versioningDebugging, testing, monitoring any of the above

Real products, models, and research that use this idea.

  • LangChain's official agent tutorials migrated from AgentExecutor to LangGraph in 2024
  • Production teams deploying long-running research agents on Claude Opus 4.7 use LangGraph for the checkpointer
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QWhy does LangGraph supersede AgentExecutor instead of replacing LCEL?
A

LangGraph and AgentExecutor solve the same problem (agent loop orchestration) at different abstraction levels. Graph versus hidden loop. LangGraph and LCEL solve different problems. Control flow versus stateless composition. LangGraph nodes wrap LCEL Runnables; they are complementary, not competing.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Picking LCEL because it 'composes things'. LCEL builds directed acyclic pipes, not loops with shared state.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • The role of LangGraph as the explicit-graph control-flow library

  • Why AgentExecutor's loop is hidden rather than visible

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
Design a sensible migration…
Short answer·Hard