LangChain vs LangGraph: Which Framework Should You Master First?

Learn LangChain first. They are not competitors: LangChain is the agent and component layer, LangGraph is the stateful runtime it runs on. Start with LangChain’s create_agent, then drop to LangGraph when you need custom loops, durable state or human approval steps.
The “vs” in this search is obsolete. Since the v1.0 release on 22 October 2025, LangChain agents run on top of the LangGraph runtime. The official LangChain documentation now states the split directly: use LangChain’s create_agent for a highly customizable agent harness, and use LangGraph, described as the low-level orchestration framework, for advanced needs combining deterministic and agentic workflows (LangChain docs).
So the real question is not which one to choose. It is which layer to learn first, and when to drop down a level. Most tutorials written before late 2025 get this wrong, and following them will teach you deprecated APIs.
Quick Answers
Is LangGraph replacing LangChain? No. LangGraph is the runtime that LangChain agents execute on. Using LangChain’s create_agent means you are already using LangGraph underneath.
Which should I learn first? LangChain. Its create_agent is the documented standard entry point, and because it compiles to a LangGraph graph, nothing you learn is discarded when you move down a layer.
When do I actually need LangGraph directly? When you need control the standard agent loop does not give you: cycles you define yourself, routing based on intermediate state, durable execution that survives a crash, human approval gates, or multiple agents sharing state.
Is LangChain still worth learning in 2026? Yes, and it is far more coherent than its 0.x reputation suggests. The v1.0 release consolidated competing agent abstractions into one and committed to semantic versioning.
How does LlamaIndex fit in? It is a retrieval specialist rather than a competitor. The common production pattern is LlamaIndex for the knowledge layer and LangGraph for orchestration.
What about CrewAI? CrewAI reaches a working multi-agent prototype faster using a role-based metaphor. LangGraph is the stronger production choice when you need durable state, recovery and node-level observability.
Key Takeaways
- LangChain is the component and agent layer. LangGraph is the stateful graph runtime underneath it. They are layers, not rivals.
- Learn LangChain’s create_agent first. It is the documented standard entry point and it already runs on LangGraph, so nothing you learn is wasted.
- Drop to LangGraph’s StateGraph when you need explicit control: custom cycles, conditional routing, durable checkpoints, human approval gates, multi-agent handoffs.
- AgentExecutor, initialize_agent and create_react_agent are legacy. If a tutorial uses them, it predates v1.0. Legacy utilities moved to langchain-classic.
- Middleware is the new customization seam. Hooks around the agent loop replaced the older pattern of subclassing and ad hoc wrappers.
- LlamaIndex is not a competitor to either. It is a retrieval specialist most production teams run underneath LangGraph orchestration.
- CrewAI trades control for speed. Faster to a prototype, weaker on durable state and observability.
The v1.0 Reset: Why Most Tutorials Are Now Wrong
Before October 2025, LangChain had a genuine problem. There were multiple competing ways to build an agent: initialize_agent, AgentExecutor, create_react_agent from langgraph.prebuilt, plus several specialised agent types. Each had different APIs. The abstractions leaked, and breaking changes landed between minor versions.
LangChain 1.0 and LangGraph 1.0 shipped together and resolved this (LangChain blog). The changes that matter for how you learn:
- One agent abstraction. create_agent replaces the older constructs. Legacy chain and agent patterns moved to langchain-classic, keeping the core namespace focused on agents, models, messages and tools (LangChain v1 release notes).
- LangGraph became the official runtime. create_agent is built on LangGraph, so agents get durable execution, checkpointing and human-in-the-loop support without you writing graph code.
- Middleware replaced the hacks. Hooks such as before_model, after_model, wrap_tool_call and wrap_model_call are now the way you customise the agent loop. LangChain’s docs call middleware the defining feature of create_agent, covering dynamic prompts, conversation summarisation, selective tool access and guardrails.
- Structured output got cheaper. It is now generated inside the main loop rather than requiring an extra LLM call.
- Python 3.9 support dropped. v1.0 requires Python 3.10 or higher.
The practical filter: if a tutorial imports AgentExecutor or calls initialize_agent, it is teaching you a deprecated pattern.
Check the publication date. Anything before November 2025 needs verification against the official migration guide.
LangChain vs LangGraph: The Layer Model
Think of it the way you think about a web stack. LangChain is roughly the framework with sensible defaults. LangGraph is the runtime and execution engine underneath.
| Dimension | LangChain | LangGraph |
| Layer | Components, integrations, agent harness | Stateful graph execution runtime |
| Core primitive | create_agent, tools, models, messages | StateGraph, nodes, edges, checkpointers |
| Mental model | Configure an agent loop | Design a state machine |
| Control flow | Standard tool-calling loop plus middleware | Arbitrary cycles and conditional edges you define |
| State | Managed by the runtime underneath | Explicit typed state schema you own |
| Persistence | Inherited from the LangGraph runtime | Checkpointers: in-memory, SQLite, Postgres |
| Human-in-the-loop | Via middleware | Native interrupt() and breakpoints |
| Multi-agent | Supported, less explicit | Supervisor, swarm and hierarchical patterns |
| Customisation | Middleware hooks | Full graph topology |
| Lines of code | Fewer for the common case | More, in exchange for control |
| Learning curve | Moderate | Steeper, requires graph thinking |
| Observability | LangSmith | LangSmith with node-level traces |
The relationship in one line: create_agent compiles down to a LangGraph graph. You are always using LangGraph. The question is only whether you are writing it yourself.
What a LangChain agent looks like
The current documented pattern is deliberately compact (LangChain docs):
from langchain.agents import create_agent
def get_weather(city: str) -> str:
"""Get weather for a given city."""
return f"It's always sunny in {city}!"
agent = create_agent(
model="openai:gpt-5.5",
tools=[get_weather],
system_prompt="You are a helpful assistant",
)
result = agent.invoke(
{"messages": [{"role": "user", "content": "What's the weather in San Francisco?"}]}
)
Three arguments and an invoke. Under that is a full graph with a model node, a tool node and a conditional edge that loops until the model stops calling tools.
When you need to write the graph yourself
You drop to StateGraph when the standard loop stops fitting. Concrete triggers:
- The flow needs a cycle you define, such as generate, critique, revise, repeat until a quality bar is met.
- Routing depends on intermediate state, not just on whether the model called a tool.
- A workflow runs for hours or days and must survive a process crash.
- A human must approve a specific step before execution continues.
- Several specialised agents hand work between each other with shared state.
- You need to fork execution at a checkpoint and compare two paths.
The Decision Table
| Your situation | Use | Why |
| First LLM app, learning the ecosystem | LangChain | create_agent is the documented standard and hides graph complexity |
| RAG pipeline, document Q&A | LangChain, or LlamaIndex for retrieval | Linear flow, no cycles needed |
| Tool-calling assistant, standard loop | LangChain | The prebuilt loop is exactly this |
| Agent that retries failed tools with a modified approach | LangGraph | Requires custom cycle logic |
| Branching on intermediate results | LangGraph | Conditional edges |
| Workflow that resumes after a crash | LangGraph | Checkpointers |
| Human approval before a sensitive action | LangGraph, or LangChain middleware for simple cases | interrupt() is first-class |
| Multi-agent with shared state | LangGraph | Supervisor and handoff patterns |
| Retrieval quality is the actual product | LlamaIndex | Purpose-built retrieval abstractions |
| Multi-agent prototype needed this week | CrewAI | Role metaphor, fastest setup |
| One or two LLM calls behind a function | No framework | Provider SDK directly |
That last row matters more than it looks. Reaching for a framework when a single API call would do is one of the most common mistakes in this space, and reviewers notice it.
LangChain vs LlamaIndex: Different Problem, Not a Rival
The langchain vs llamaindex comparison confuses people because both can technically build a RAG pipeline. The distinction is what each treats as the centre of the system.
LangChain treats retrieval as one capability among many. The centre is the agent loop.
LlamaIndex treats retrieval as the system. Its core abstractions are indexes, retrievers, query engines and response synthesisers. Chunking strategies including sentence-window, hierarchical and auto-merging are native rather than assembled, and citation tracking is a default rather than something you wire up (LlamaIndex docs).
| LangChain / LangGraph | LlamaIndex | |
| Centre of gravity | Agent orchestration | Retrieval and indexing |
| Core abstraction | Agent, tools, graph | Index, retriever, query engine |
| RAG defaults | Configurable, more assembly | Opinionated and production-calibrated |
| Advanced chunking | Available, more manual | Native, broader set |
| Citation tracking | Manual wiring | Default |
| Agent maturity | Strong, LangGraph is the standard | Functional via Workflows, less battle-tested |
| Observability | LangSmith, first-party | LlamaTrace and third-party tools |
| Best when | Orchestration is the hard part | Retrieval quality is the hard part |
The common production pattern in 2026 is both. LlamaIndex handles the knowledge layer. LangGraph orchestrates. The framing that will serve you in an interview: if getting the right data is the hard part, start with LlamaIndex. If deciding what to do with it is the hard part, start with LangGrap
Guide to retrieval augmented generation covers the retrieval concepts that sit underneath both frameworks.
LangGraph vs CrewAI: Control Against Speed
This is the genuinely competitive comparison, because langgraph vs crewai is a real either-or for multi-agent work.
CrewAI models agents as a team. You define a Researcher, a Writer and a Reviewer, each with a role, goal and backstory, then let the framework handle delegation. The metaphor maps cleanly onto how non-engineers think about work, which makes it excellent for stakeholder demos (CrewAI docs).
LangGraph models agents as a state machine. Nodes, edges, typed state. Nothing happens that you did not specify.
| Dimension | LangGraph | CrewAI |
| Mental model | Nodes, edges, explicit state | Roles, tasks, crews |
| Setup speed | Slower, more scaffolding | Fast, minimal boilerplate |
| Control granularity | Every transition is yours | Delegation handled for you |
| Durable state | Native checkpointers | Not built in |
| Human-in-the-loop | First-class interrupt() | Via callbacks |
| Observability | LangSmith, node-level traces | Enterprise tier plus OpenTelemetry export |
| Debugging | State inspection at any node | Harder to trace delegation decisions |
| Best for | Production, regulated, long-running | Prototypes, demos, role-shaped workflows |
How to choose honestly. If your problem naturally decomposes into named human-like roles and you need something working this week, CrewAI is the faster path. If the workflow needs to survive failure, produce an audit trail or pause for approval, LangGraph’s setup cost pays for itself the first time something breaks at 2am.
Note also that CrewAI can use LangChain tools, so the two are not fully exclusive at the component level.
So Which Do You Master First?
Here is the sequence that avoids wasted effort. Each stage builds on the previous one.
Stage 1: Fundamentals before frameworks (2 to 3 weeks). Solid Python, async and typing, HTTP and API design, and how an LLM API actually works. Call a provider SDK directly, implement a tool-calling loop by hand once. This single exercise makes every framework abstraction legible instead of magical.
Stage 2: LangChain create_agent (2 to 3 weeks). Models, tools, messages, structured output, then middleware. Build three things: a tool-calling assistant, a RAG-backed Q&A agent, and an agent with a guardrail implemented as middleware. You are already using LangGraph at this point, you just are not writing it.
Stage 3: Retrieval depth (2 weeks). Chunking strategies, embeddings, hybrid search, reranking and evaluation. Do this with LlamaIndex or LangChain retrievers. Retrieval quality determines agent quality far more often than framework choice does. Ground it with natural language processing fundamentals.
Stage 4: LangGraph StateGraph (3 to 4 weeks). State schemas, nodes and conditional edges, checkpointers, interrupt(), subgraphs and multi-agent patterns. Take one Stage 2 project and rebuild it as an explicit graph with a human approval gate. The contrast teaches more than either version alone (LangGraph docs).
Stage 5: Evaluation, cost and observability (ongoing). LangSmith tracing, eval datasets, regression testing before deploys, token and latency budgets, permission scoping for tools. This layer is where most candidates are thin, which is exactly why it is where the hiring leverage sits.
Skip CrewAI until you need it. Once you understand LangGraph, CrewAI takes an afternoon. Learning it first teaches a role metaphor that does not transfer.
For the surrounding skill map, see AI Engineer roadmap and how to become an AI engineer.
What Interviewers Actually Test
Framework syntax is the least interesting thing you can demonstrate. The questions that separate candidates:
- “When would you not use LangGraph?” A strong answer names the overhead honestly. State validation, graph compilation and checkpoint writes cost something. For a linear RAG pipeline or a simple chatbot with conversation history, that complexity buys nothing and makes the system harder to debug.
- “How do you handle a tool call that fails intermittently?” This tests whether you think about retries with modified approaches, exponential backoff, idempotency so a retried action does not double-charge a customer, and a fallback path when retries are exhausted.
- “How do you stop an agent from looping forever?” Recursion limits, step budgets, token ceilings, cost caps per run, and a terminal condition that does not depend solely on the model deciding to stop.
- “How do you know a change did not break the agent?” Eval datasets and regression runs. If the answer is “I tested it manually,” that is a gap.
- “Why is your agent expensive?” Token accounting per node, context bloat across turns, redundant retrieval, and conversation summarisation to keep history bounded.
Notice that four out of five AI challenges are actually systems engineering problems in disguise. This is why mastering data structures and system design yields the highest return on investment for AI roles. Effective frameworks model agentic AI as distributed systems, moving far beyond basic prompt engineering
Common Mistakes That Cost Weeks
Learning from pre-v1.0 content. The single biggest time sink right now. Check dates, check imports.
Choosing LangGraph for a linear pipeline. Graph overhead with no cyclic benefit. You will write three times the code for the same behaviour.
Choosing LangChain for a workflow that needs durability. If your prototype needs human approval or persistent memory within the first month, migrate to an explicit graph before the technical debt compounds.
Treating the framework as the skill. Frameworks turn over fast. The transferable skills are context engineering, state design, evaluation and cost control. Those survive the next rewrite.
Skipping evaluation. Without evals you cannot tell whether a refactor improved or broke behaviour. Teams discover this the expensive way.
Building a framework demo instead of a system. A working agent that has never handled a failed API call, a rate limit or a malformed model response is a demo, not a portfolio piece.
Frequently Asked Questions
No. LangGraph is the runtime that LangChain agents run on. LangChain 1.0’s create_agent is built on LangGraph, so using LangChain means using LangGraph whether or not you write graph code.
LangChain first. create_agent is the documented standard entry point, and because it compiles to a LangGraph graph, nothing you learn is discarded when you move down a layer. Move to StateGraph when you need custom cycles, durable state, approval gates or multi-agent handoffs.
Yes, and it is more coherent than it was. The v1.0 release consolidated competing agent abstractions into one, adopted semantic versioning, and committed to no breaking changes before 2.0. Much of the framework’s poor reputation was earned in the 0.x era.
Yes. LangGraph is a standalone library and the docs are explicit that LangChain is not required. In practice most teams still import LangChain model wrappers and tool integrations inside their graph nodes because rewriting those is pointless work.
For retrieval-first applications, LlamaIndex generally gets you to good quality faster because its chunking, indexing and citation defaults are calibrated for production RAG. For agent systems where retrieval is one tool among several, LangChain with LangGraph is the stronger foundation. Many production stacks use both.
CrewAI reaches a working prototype faster with its role-based abstraction. LangGraph is the stronger production choice when you need durable state, checkpoint recovery, human approval gates and node-level observability. Choose by whether your constraint is speed to demo or reliability in production.
Framework familiarity helps you pass a screen, but it is rarely what gets you hired. Employers test whether you can design a reliable system: retries, idempotency, evaluation, cost control and safe tool permissions. Frameworks change. Those skills do not.
Expect roughly one to two weeks to be comfortable with state schemas, nodes, conditional edges and checkpointers if you already know LangChain and have solid Python. Reaching production competence, meaning you can debug a misbehaving agent from traces and control its cost, takes considerably longer.
The Bottom Line
The LangChain vs LangGraph framing is a leftover from before v1.0. They are layers of one stack: LangChain gives you the fast path to a working agent, LangGraph gives you the control surface when the standard loop stops fitting.
Master LangChain’s create_agent first, because it is the documented standard and it already sits on the runtime you will grow into. Add LangGraph the moment your workflow needs cycles you define, state that survives a crash, or a human in the loop. Add LlamaIndex when retrieval quality becomes the bottleneck. Reach for CrewAI when a stakeholder needs to see something by Friday.
And keep the real point in view: frameworks are the easy part. The scarce skill is building an agent that behaves predictably when the API times out, the model returns malformed JSON, and the bill arrives at the end of the month.
Build your systems engineering and AI foundation with the Certificate Programme in Generative AI or the Advanced Certification in AI Forward Deployed Engineering offered by IIT Delhi through Varsity.





