# LangGraph vs LangChain: What Is the Difference?

> Source: <https://dev.to/techsimplus_learnings/langgraph-vs-langchain-what-is-the-difference-4pbf>
> Published: 2026-10-07 01:25:00+00:00

Short answer: **LangChain** gives you high-level building blocks and a ready-made agent. **LangGraph** is the low-level orchestration runtime for stateful, controllable workflows. LangChain's agent runs on LangGraph under the hood.

Let's see the difference in code.

``` python
from langchain.agents import create_agent
from langchain.tools import tool

@tool
def get_policy_limit(policy_id: str) -> str:
    """Return the claim limit for a policy."""
    return "Limit for " + policy_id + " is ₹5,00,000"

agent = create_agent(
    model="openai:gpt-4.1-mini",
    tools=[get_policy_limit],
    system_prompt="You are a helpful insurance assistant.",
)

result = agent.invoke(
    {"messages": [{"role": "user", "content": "What is the limit on policy P-1029?"}]}
)
print(result["messages"][-1].content)
```

The model decides which tools to call and when to stop. Perfect for assistants and simple tool use.

Now a claims workflow: classify the claim, route it, and pause for human approval on large amounts.

``` python
from typing import TypedDict
from langgraph.graph import StateGraph, START, END
from langgraph.checkpoint.memory import InMemorySaver
from langgraph.types import interrupt, Command

class ClaimState(TypedDict):
    claim_text: str
    amount: float
    approved: bool

def assess(state: ClaimState):
    # call an LLM or a decision model here to extract the amount
    return {"amount": 75000.0}

def route(state: ClaimState) -> str:
    return "human_review" if state["amount"] > 50000 else "auto_approve"

def human_review(state: ClaimState):
    decision = interrupt({"question": "Approve this claim?", "amount": state["amount"]})
    return {"approved": decision == "yes"}

def auto_approve(state: ClaimState):
    return {"approved": True}

builder = StateGraph(ClaimState)
builder.add_node("assess", assess)
builder.add_node("human_review", human_review)
builder.add_node("auto_approve", auto_approve)
builder.add_edge(START, "assess")
builder.add_conditional_edges("assess", route, ["human_review", "auto_approve"])
builder.add_edge("human_review", END)
builder.add_edge("auto_approve", END)

graph = builder.compile(checkpointer=InMemorySaver())
config = {"configurable": {"thread_id": "claim-42"}}

graph.invoke({"claim_text": "Hospital bill..."}, config)   # pauses at human_review
graph.invoke(Command(resume="yes"), config)                 # resumes after approval
```

In production, swap `InMemorySaver` for a Postgres checkpointer so the workflow survives restarts.

|  | LangChain | LangGraph | 
|---|---|---|
| Level | High-level components and agent | Low-level orchestration runtime | 
| Control flow | Model decides (agent loop) | You define nodes, edges, branches, loops | 
| State | Messages | Any typed state you design | 
| Durability | Via LangGraph underneath | Built-in checkpointers | 
| Human-in-the-loop | Via middleware | `interrupt()` anywhere in the graph | 
| Best for | Assistants, RAG chains, simple tool use | Business workflows, multi-agent systems, long-running jobs | 

LangChain first: models, prompts, structured output, tools. Then LangGraph, because every serious agentic system you build will need state and control.

That is exactly the order in **Vector 2.0**, the live Gen-AI developer cohort by **TechSimPlus** and **Prateek Mishra**: Sprint 1 covers LangChain, Sprint 3 covers LangGraph with ClaimSense, and Sprint 4 adds multi-agent systems with MCP and A2A. 

Check the Complete Content: [vector.techsimplus.com](https://vector.techsimplus.com/?utm_source=devto&utm_medium=blog&utm_campaign=vector2_langgraph)
