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.