Skip to content
WhichAgent

LangChain vs LangGraph

By · Updated Oct 22, 2026 · Sources linked throughout

At a glance

LangChainLangGraph
Form factorLibraryLibrary
PricingFreeFree tier, paid from $39/mo
Plans—LangSmith Developer: $0/mo · LangSmith Plus: $39/mo · LangSmith Enterprise: contact sales
Free tierThe LangChain library is free and MIT-licensed. The optional LangSmith cloud (tracing, evals, deployment) has a free Developer plan with 1 seat and 5k base traces/month.The LangGraph library is free and MIT-licensed. Managed hosting is via LangSmith Deployment (formerly LangGraph Platform); the free LangSmith Developer plan does not include deployments, Plus includes one small serverless deployment.
LanguagesPython, TypeScriptPython, TypeScript
ModelsOpenAI, Anthropic, Google, AWS Bedrock, Azure OpenAI, Mistral, Groq, DeepSeek, xAI, OpenRouter, Local models via Ollama, Many more via partner and community integration packagesModel-agnostic (any LLM callable from Python/JS), OpenAI, Anthropic, Google, Local models via Ollama, All providers available through LangChain integrations
Bring your own API keyYesYes
Local modelsYesYes
Open sourceYes (MIT)Yes (MIT)
MCP supportYesYes
PlatformsmacOS, Windows, LinuxmacOS, Windows, Linux
GitHub stars148,26443,714
Last commitOct 22, 2026Oct 21, 2026
StatusActiveActive

Verified Oct 22, 2026 (LangChain) and Oct 22, 2026 (LangGraph) from official sources. GitHub figures refresh daily.

They’re layers, not rivals

The most common misunderstanding about these two is that you have to pick one. LangChain’s own docs describe the relationship directly: “LangChain’s agents are built on top of LangGraph.” That gives them LangGraph’s durable execution, human-in-the-loop support and persistence.

The official guidance on which to use:

  • Deep Agents: start here for a “batteries-included” agent with automatic context compression, a virtual filesystem and subagent spawning.
  • LangChain (create_agent): use for “a highly customizable harness, easily tailored to your use case and data”.
  • LangGraph: use, in its own words, as “our low-level orchestration framework, for advanced needs combining deterministic and agentic workflows”.
  • LangSmith: use to trace, debug and evaluate agents built with any of the three.

So the real question is how much control you need. Each step down gives you more control and asks you to write more code.

What the code looks like

LangChain. A complete agent with one custom tool, from the LangChain overview:

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?"}]}
)

LangGraph. The build step of a tool-calling agent, from the LangGraph quickstart. The state, the llm_call and tool_node functions and the should_continue router are defined earlier in that guide:

from langgraph.graph import StateGraph, START, END

agent_builder = StateGraph(MessagesState)

agent_builder.add_node("llm_call", llm_call)
agent_builder.add_node("tool_node", tool_node)

agent_builder.add_edge(START, "llm_call")
agent_builder.add_conditional_edges("llm_call", should_continue, ["tool_node", END])
agent_builder.add_edge("tool_node", "llm_call")

agent = agent_builder.compile()

Both build roughly the same tool-calling loop:

  • With LangChain you configure it: model, tools, prompt, and middleware if you need to change behavior.
  • With LangGraph you write it: the state, each step, and the routing between steps. That’s more code, but you can insert anything, such as a deterministic validation step, a human approval, a branch to a different model, or a subgraph.

Side by side

LangChain LangGraph
What it is Agent framework: abstractions and integrations for models, tools and agent loops Low-level orchestration framework and runtime for stateful agents
Main entry point create_agent StateGraph (Graph API) or @entrypoint/@task (Functional API)
You define Model, tools, prompt, middleware State, nodes, edges, conditional routing
Persistence, human-in-the-loop, durable execution Inherited from LangGraph Built in
Integrations Very large ecosystem of model, vector store and tool packages Use LangChain’s, or any SDK directly
Depends on the other Yes: agents run on LangGraph No: LangChain is optional
Languages Python, TypeScript Python, TypeScript
MCP Via langchain-mcp-adapters Via langchain-mcp-adapters
License MIT MIT

Where LangSmith fits

LangSmith is the commercial platform from the same company. It works with agents built on LangChain, LangGraph or Deep Agents:

  • Observability and evals: tracing, debugging and evaluation.
  • Deployment: LangSmith Deployment, formerly called LangGraph Platform, hosts long-running, stateful agents.
  • Plans: Developer is free (1 seat, 5k base traces/month, no deployments). Plus is $39 per seat per month and includes one small serverless deployment. Enterprise is custom. (pricing, checked October 22, 2026)

Neither library requires LangSmith; it’s optional.

Who should pick which

Start with LangChain if:

  • you’re new to agents, which is what LangGraph’s own docs recommend
  • a model plus tools plus a system prompt covers your use case
  • you want to swap model providers behind one interface

Use LangGraph directly if:

  • your workflow mixes fixed steps with agent decisions, such as validate, then call the model, then branch
  • you need custom state, loops or subgraphs that don’t fit create_agent
  • you want to control exactly where persistence and human approval happen

Use Deep Agents if: you want planning, subagents and a virtual filesystem without building them yourself.

Use both (the common case): build agents with LangChain, and drop to LangGraph for the parts of the system that need explicit orchestration. Since one runs on the other, they fit together without glue code.

Hands-on test

We haven’t benchmarked these libraries against each other. Since one runs on the other, a speed contest wouldn’t mean much. This comparison is based on the official LangChain and LangGraph documentation, linked on the LangChain and LangGraph pages.

Frequently asked questions

Is LangGraph part of LangChain?

They're separate open-source libraries from the same company, LangChain, Inc. LangChain is the agent framework (abstractions and integrations for models, tools and agent loops). LangGraph is the low-level orchestration framework and runtime underneath. LangChain's agents are built on top of LangGraph.

Do I need LangChain to use LangGraph?

No. LangGraph's docs use LangChain components for models and tools, but say you don't need LangChain to use LangGraph. You can call any model SDK from a LangGraph node.

Should I learn LangChain or LangGraph first?

LangChain, if you're new to agents. LangGraph's own docs recommend LangChain if you're just getting started or want a higher-level abstraction, and suggest getting familiar with models and tools before using LangGraph.

What's the difference between LangChain, LangGraph and LangSmith?

LangChain builds agents (create_agent plus integrations). LangGraph orchestrates them at a lower level (state, graphs, durable execution, human-in-the-loop). LangSmith is the paid-optional platform for tracing, evaluating and deploying agents built with either. It has a free Developer plan and a Plus plan at $39 per seat per month.

What is Deep Agents?

Deep Agents is LangChain's batteries-included agent harness: planning, subagents, a virtual filesystem and automatic context compression, built on LangChain agents and LangGraph. LangChain's docs suggest starting there if you want those features out of the box.

Do LangChain agents support persistence and human-in-the-loop?

Yes. Because LangChain's agents are built on LangGraph, they inherit LangGraph's durable execution, human-in-the-loop support and persistence.

Are both available in TypeScript?

Yes. LangChain and LangGraph both have official Python and JavaScript/TypeScript libraries.

Is LangGraph replacing LangChain?

No. They're layers of the same stack. LangChain's create_agent is the recommended way to build a customizable agent, and LangGraph is what it runs on. You use LangGraph directly when you need more control than create_agent gives you.

Keep reading

Related comparisons