cd /news/ai-agents/langgraph-vs-langchain-what-is-the-d… · home › topics › ai-agents › article
[ARTICLE · art-146476] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=· neutral

LangGraph vs LangChain: What Is the Difference?

A developer comparison explains that LangChain provides high-level components and a ready-made agent loop, while LangGraph is the low-level orchestration runtime for stateful, controllable workflows, with LangChain's agent running on LangGraph underneath. The writeup contrasts a simple tool-calling assistant with a claims workflow that uses typed state, conditional routing, checkpointers and an interrupt() call to pause for human approval on claims over ₹50,000. It recommends learning LangChain first, then LangGraph, and promotes the TechSimPlus Vector 2.0 cohort taught by Prateek Mishra.

by read2 min views5 publishedOct 7, 2026

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.

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 for human approval on large amounts.

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):
    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)   # s 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

── more in #ai-agents 4 stories · sorted by recency
── more on @langchain 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/langgraph-vs-langcha…] indexed:0 read:2min 2026-10-07 · —