{"slug": "langgraph-vs-langchain-what-is-the-difference", "title": "LangGraph vs LangChain: What Is the Difference?", "summary": "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.", "body_md": "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.\n\nLet's see the difference in code.\n\n``` python\nfrom langchain.agents import create_agent\nfrom langchain.tools import tool\n\n@tool\ndef get_policy_limit(policy_id: str) -> str:\n    \"\"\"Return the claim limit for a policy.\"\"\"\n    return \"Limit for \" + policy_id + \" is ₹5,00,000\"\n\nagent = create_agent(\n    model=\"openai:gpt-4.1-mini\",\n    tools=[get_policy_limit],\n    system_prompt=\"You are a helpful insurance assistant.\",\n)\n\nresult = agent.invoke(\n    {\"messages\": [{\"role\": \"user\", \"content\": \"What is the limit on policy P-1029?\"}]}\n)\nprint(result[\"messages\"][-1].content)\n```\n\nThe model decides which tools to call and when to stop. Perfect for assistants and simple tool use.\n\nNow a claims workflow: classify the claim, route it, and pause for human approval on large amounts.\n\n``` python\nfrom typing import TypedDict\nfrom langgraph.graph import StateGraph, START, END\nfrom langgraph.checkpoint.memory import InMemorySaver\nfrom langgraph.types import interrupt, Command\n\nclass ClaimState(TypedDict):\n    claim_text: str\n    amount: float\n    approved: bool\n\ndef assess(state: ClaimState):\n    # call an LLM or a decision model here to extract the amount\n    return {\"amount\": 75000.0}\n\ndef route(state: ClaimState) -> str:\n    return \"human_review\" if state[\"amount\"] > 50000 else \"auto_approve\"\n\ndef human_review(state: ClaimState):\n    decision = interrupt({\"question\": \"Approve this claim?\", \"amount\": state[\"amount\"]})\n    return {\"approved\": decision == \"yes\"}\n\ndef auto_approve(state: ClaimState):\n    return {\"approved\": True}\n\nbuilder = StateGraph(ClaimState)\nbuilder.add_node(\"assess\", assess)\nbuilder.add_node(\"human_review\", human_review)\nbuilder.add_node(\"auto_approve\", auto_approve)\nbuilder.add_edge(START, \"assess\")\nbuilder.add_conditional_edges(\"assess\", route, [\"human_review\", \"auto_approve\"])\nbuilder.add_edge(\"human_review\", END)\nbuilder.add_edge(\"auto_approve\", END)\n\ngraph = builder.compile(checkpointer=InMemorySaver())\nconfig = {\"configurable\": {\"thread_id\": \"claim-42\"}}\n\ngraph.invoke({\"claim_text\": \"Hospital bill...\"}, config)   # pauses at human_review\ngraph.invoke(Command(resume=\"yes\"), config)                 # resumes after approval\n```\n\nIn production, swap `InMemorySaver` for a Postgres checkpointer so the workflow survives restarts.\n\n|  | LangChain | LangGraph | \n|---|---|---|\n| Level | High-level components and agent | Low-level orchestration runtime | \n| Control flow | Model decides (agent loop) | You define nodes, edges, branches, loops | \n| State | Messages | Any typed state you design | \n| Durability | Via LangGraph underneath | Built-in checkpointers | \n| Human-in-the-loop | Via middleware | `interrupt()` anywhere in the graph | \n| Best for | Assistants, RAG chains, simple tool use | Business workflows, multi-agent systems, long-running jobs | \n\nLangChain first: models, prompts, structured output, tools. Then LangGraph, because every serious agentic system you build will need state and control.\n\nThat 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. \n\nCheck the Complete Content: [vector.techsimplus.com](https://vector.techsimplus.com/?utm_source=devto&utm_medium=blog&utm_campaign=vector2_langgraph)", "url": "https://wpnews.pro/news/langgraph-vs-langchain-what-is-the-difference", "canonical_source": "https://dev.to/techsimplus_learnings/langgraph-vs-langchain-what-is-the-difference-4pbf", "published_at": "2026-10-07 01:25:00+00:00", "updated_at": "2026-10-07 01:47:52.650223+00:00", "lang": "en", "topics": ["ai-agents", "large-language-models", "developer-tools", "ai-tools"], "entities": ["LangChain", "LangGraph", "TechSimPlus", "Prateek Mishra", "Vector 2.0", "MCP", "A2A", "OpenAI"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/langgraph-vs-langchain-what-is-the-difference", "markdown": "https://wpnews.pro/news/langgraph-vs-langchain-what-is-the-difference.md", "text": "https://wpnews.pro/news/langgraph-vs-langchain-what-is-the-difference.txt", "jsonld": "https://wpnews.pro/news/langgraph-vs-langchain-what-is-the-difference.jsonld"}}