,

LangChain vs LangGraph: What’s the Difference and Which Should You Use?

LangChain vs LangGraph comparison

Short answer: LangChain and LangGraph aren’t rivals. They’re layers of the same stack. LangChain gives you a ready-made agent (create_agent) that you customize with tools and middleware. LangGraph is the lower-level runtime underneath it, where you design the steps, branches, state and checkpoints yourself. Start with LangChain for a standard tool-calling agent. Move to LangGraph when you need custom workflows, long-running jobs or human approval steps. Both are free and open source under the MIT license.

Last checked: October 2026

LangChain vs LangGraph at a glance

LangChainLangGraph
What it isHigh-level framework with a prebuilt agentLow-level orchestration framework and runtime
Main building blockcreate_agent plus middlewareStateGraph: nodes, edges and shared state
Best forTool-calling agents, chatbots, RAG appsMulti-step workflows, multi-agent systems, long-running agents
ControlLess code, sensible defaultsFull control over every step and branch
Persistence and resumeThrough LangGraph underneathBuilt in (checkpoints, durable execution)
Human in the loopHumanInTheLoop middlewarePause, inspect and edit state at any step
Learning curveEasierSteeper
Current version (Python)1.4 (September 2026)1.2 (September 2026)
LanguagesPython and JavaScript/TypeScriptPython and JavaScript/TypeScript
License and priceMIT, freeMIT, free
GitHub starsAbout 147,000About 38,000

Sources: LangChain docs, LangGraph docs and PyPI. See our full LangGraph review.

How LangChain and LangGraph fit together

Since the 1.0 releases in October 2025, the stack has three layers, and each one is built on the one below:

  1. Deep Agents: a “batteries included” agent with planning, a virtual file system, subagents and automatic summarization.
  2. LangChain: create_agent, a simple agent loop you shape with tools and middleware.
  3. LangGraph: the runtime that handles state, persistence, streaming and human-in-the-loop.

So when you build a LangChain agent, you’re already running on LangGraph. You don’t need LangChain to use LangGraph, though. You can build a graph with any model or plain Python functions.

What the code looks like

A LangChain agent is a few lines. You pass a model, tools and optional middleware:

from langchain.agents import create_agent

agent = create_agent(
    model="your-model",
    tools=[get_weather],
    system_prompt="You are a helpful assistant",
)
agent.invoke({"messages": [{"role": "user", "content": "Weather in SF?"}]})

In LangGraph, you draw the flow yourself. Each node is a step, and edges decide what runs next:

from langgraph.graph import StateGraph, MessagesState, START, END

graph = StateGraph(MessagesState)
graph.add_node("call_model", call_model)
graph.add_edge(START, "call_model")
graph.add_edge("call_model", END)
app = graph.compile()  # add checkpointer=... to save state and resume
app.invoke({"messages": [{"role": "user", "content": "hi!"}]})

More code, but you decide exactly when to loop, branch, call another agent or stop for a human to approve.

When to use LangChain

  • You want a working agent fast.
  • Your agent mostly calls tools in a loop and answers.
  • You need common add-ons like summarizing long chats, retrying tools, falling back to another model or redacting personal data. LangChain ships these as built-in middleware.
  • You’re building a chatbot or a retrieval (RAG) app.

When to use LangGraph

  • Your workflow mixes fixed steps with AI decisions, like “extract, then check, then route to a person if confidence is low.”
  • You need several agents that hand work to each other.
  • Jobs run for minutes or hours and must survive crashes and pick up where they left off.
  • A person must approve or edit something midway.
  • You need fine control over memory and state.

LangChain’s own docs give the same advice: use create_agent for customizable agents and LangGraph for advanced needs that combine fixed and agentic steps.

Who uses LangGraph

LangChain’s case studies name Klarna, LinkedIn, Uber, Replit, Elastic and AppFolio. Klarna reports 80% faster resolution times with its LangGraph-based assistant.

Costs: the frameworks are free, the extras are not

Both libraries are free. You pay for your model API and, if you want them, LangChain’s paid tools:

ProductWhat it doesPrice
LangSmith DeveloperTracing, debugging and evals for 1 userFree, up to 5,000 traces a month
LangSmith PlusSame, for teams$39 per seat a month, up to 10,000 traces
LangSmith DeploymentHosting for agents (formerly LangGraph Platform)Usage-based compute
LangSmith StudioVisual debugger for graphs (formerly LangGraph Studio)Part of LangSmith

Prices from LangChain’s pricing page.

LangGraph alternatives

If neither fits, compare CrewAI for role-based agent teams, LlamaIndex for data-heavy apps, OpenAI Agents SDK, Claude Agent SDK, Google ADK, Microsoft Agent Framework and Mastra in our list of the best AI agent frameworks. Building coding agents instead? Read Codex vs Claude Code.

FAQ

What is the difference between LangChain and LangGraph?

LangChain is a high-level framework with a prebuilt agent you customize with tools and middleware. LangGraph is the lower-level runtime underneath, where you define each step, branch and piece of state yourself for complex or long-running workflows.

Should I learn LangChain or LangGraph first?

Start with LangChain. Its create_agent gets a working agent running in a few lines, and it runs on LangGraph, so you can move down to LangGraph when you need more control.

Is LangGraph replacing LangChain?

No. Since version 1.0, LangChain agents are built on top of LangGraph. They are two layers of one stack, maintained by the same company.

Can I use LangGraph without LangChain?

Yes. LangGraph works on its own with any model or plain Python and JavaScript functions.

Are LangChain and LangGraph free?

Yes. Both are open source under the MIT license. LangSmith, the tracing and deployment platform, has a free Developer plan and a Plus plan at $39 per seat a month.

What languages do LangChain and LangGraph support?

Both support Python and JavaScript/TypeScript.