AI / LangGraph LangChain Interview questions
What are the differences between LangGraph and LangChain Agents?
LangChain Agents (via AgentExecutor) and LangGraph both implement agent behaviour, but they differ significantly in how much control you have over the execution flow:
| Dimension | LangChain AgentExecutor | LangGraph |
|---|---|---|
| Execution flow | Black-box loop; you can't see or modify the flow between steps | Explicit graph; every edge and node is defined by you |
| Cycles / loops | Implicit loop managed by AgentExecutor | Explicit cycles via conditional edges |
| Human-in-the-loop | Hard to add; requires custom callback hacks | First-class feature via interrupt_before/after |
| State management | Limited to memory object passed to executor | Full typed state dict with custom reducers |
| Persistence | Not built-in; requires custom implementation | Built-in checkpointers (MemorySaver, SqliteSaver, PostgresSaver) |
| Multi-agent | No native support | First-class: agents as nodes with handoffs |
| Complexity | Simple, quick to prototype | More setup, but much more control |
In practice: use AgentExecutor for quick prototypes and simple single-agent tasks. Switch to LangGraph when you need reliable production agents with human oversight, complex multi-step state, persistent memory, or multi-agent coordination.
More Related questions...