{"id":80943,"date":"2026-08-11T19:27:53","date_gmt":"2026-08-11T13:57:53","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=80943"},"modified":"2026-09-01T15:53:49","modified_gmt":"2026-09-01T10:23:49","slug":"langchain-vs-langgraph-when-to-use-which","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/langchain-vs-langgraph-when-to-use-which\/","title":{"rendered":"LangChain vs LangGraph: What\u2019s the Difference and When to Use Each"},"content":{"rendered":"<p><strong>This guide explains what LangChain and LangGraph each do, how they fit together, and how to choose between them. It also covers Deep Agents \u2014 an agent harness for long autonomous tasks \u2014 so the full picture is clear before making a choice.<\/strong><\/p>\n<div style=\"margin: 24px 0; padding: 16px 20px; border-left: 4px solid #059669; border-radius: 0 8px 8px 0; background: #ecfdf5;\">\n<p><strong style=\"margin-bottom: 8px; color: #065f46; font-size: 1rem;\">TL;DR \u2014 The rule of thumb that decides everything<\/strong><\/p>\n<p style=\"margin: 0 0 10px;\"><strong>As a rule of thumb: if the standard agent loop is enough, start with LangChain. If your application needs explicit control over workflow state and orchestration, use LangGraph.<\/strong><\/p>\n<ul style=\"margin: 8px 0 0; padding-left: 24px;\">\n<li><strong>LangChain<\/strong> \u2014 the agent framework: start here for chatbots, tool-calling agents, and RAG with <code>create_agent<\/code>. Middleware can influence execution, including human interrupts and approval flows.<\/li>\n<li><strong>LangGraph<\/strong> \u2014 a low-level orchestration and runtime layer for explicit workflow control: use when the application must own routing, persistence, and interrupts.<\/li>\n<li><strong>Deep Agents<\/strong> \u2014 an agent harness for long autonomous tasks with files and subagents. Most conventional chatbots and support agents do not need it.<\/li>\n<li>They are different abstraction levels in the same ecosystem, not necessarily tools you must use together. <code>create_agent<\/code> already runs on LangGraph under the hood.<\/li>\n<\/ul>\n<\/div>\n<h2>LangChain vs LangGraph vs Deep Agents at a Glance<\/h2>\n<hr \/>\n<p>Both <strong>LangChain<\/strong> and <strong>LangGraph<\/strong> come from the same team and power many AI apps \u2014 chatbots, document Q&amp;A, and agents that call external APIs. Think of them like automatic and manual gearboxes: same engine, different control. <strong>LangChain<\/strong> is the agent framework; <strong>LangGraph<\/strong> is the low-level orchestration\/runtime layer when the application must own every step, branch, and pause.<\/p>\n<p>In the <a href=\"https:\/\/docs.langchain.com\/oss\/python\/concepts\/products\">current Python stack<\/a>, <code>create_agent<\/code> already runs on LangGraph. The choice is how much control flow your code must define \u2014 not which ecosystem to pick. <strong>Deep Agents<\/strong> is an agent harness for long autonomous tasks \u2014 planning, filesystem tools, subagents, and context management \u2014 covered below.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2026\/08\/layer_flow_langgraph.png\" alt=\"LangChain, LangGraph, and Deep Agents architecture\" width=\"833\" height=\"344\" \/><\/p>\n<div style=\"margin: 26px 0; text-align: center;\">\n<p style=\"margin-top: 12px; padding-top: 12px; border-top: 1px solid #e5e7eb; color: #475569; font-size: 0.88rem; text-align: left;\"><strong style=\"color: #6d28d9;\">Deep Agents<\/strong> \u2014 Agent harness: a ready-made setup for complex, multi-step work (research, coding, long reports). Not a separate framework; it is built with LangChain and runs on LangGraph.<\/p>\n<p style=\"margin-top: 12px; padding-top: 12px; border-top: 1px solid #e5e7eb; color: #475569; font-size: 0.88rem; text-align: left;\"><strong style=\"color: #1d4ed8;\">LangChain<\/strong> \u2014 Application framework: the usual starting point for tool-calling agents, RAG, and middleware.<\/p>\n<p style=\"margin-top: 12px; padding-top: 12px; border-top: 1px solid #e5e7eb; color: #475569; font-size: 0.88rem; text-align: left;\"><strong style=\"color: #047857;\">LangGraph<\/strong> \u2014 Low-level orchestration\/runtime: explicit nodes, edges, routing, persistence, and interrupts \u2014 used directly or as the execution layer behind LangChain agents.<\/p>\n<\/div>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2026\/08\/decision_flow.png\" alt=\"LangChain LangGraph Deep Agents decision flow\" width=\"844\" height=\"525\" \/><\/p>\n<h2>What Is LangChain? Start Here for Most Apps<\/h2>\n<hr \/>\n<div style=\"margin: 16px 0 22px; padding: 12px 16px; border-left: 4px solid #2563eb; border-radius: 0 8px 8px 0; background: #f8fafc;\">\n<p><strong style=\"color: #1e3a8a; margin-bottom: 6px;\">Choose this layer if:<\/strong><\/p>\n<ul style=\"margin: 0; padding-left: 24px;\">\n<li>The model should call tools, read the results, and keep going until it can answer.<\/li>\n<li>You want chatbots, <strong>tool-calling<\/strong> agents, or <strong>RAG<\/strong> (retrieval-augmented generation \u2014 search your documents, then answer from them).<\/li>\n<li>You do not need to draw every step in the workflow yourself.<\/li>\n<\/ul>\n<\/div>\n<p>LangChain is the agent framework \u2014 models, tools, retrieval, middleware, structured output, and more. LangChain provides abstractions for building RAG; RAG itself does not require LangChain. <code>create_agent<\/code> is its high-level agent abstraction with a built-in model-and-tool loop, extendable via middleware, structured output, custom state, streaming, and other runtime behaviors. Need a human to approve a refund? Add <a href=\"https:\/\/docs.langchain.com\/oss\/python\/langchain\/human-in-the-loop\">human-in-the-loop middleware<\/a> \u2014 or call <code>interrupt()<\/code> directly. For straightforward approval flows, you don&#8217;t need to manually construct a LangGraph workflow. Interrupt and resume rely on persisted graph execution state \u2014 that is why a <strong>checkpointer<\/strong> and stable <code>thread_id<\/code> are required.<\/p>\n<h3>Execution flow<\/h3>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2026\/08\/execution_flow_langchain.png\" alt=\"LangChain agent execution flow\" width=\"842\" height=\"156\" \/><\/p>\n<h3>Example: customer refund with human approval<\/h3>\n<p>When the model proposes a sensitive refund tool, middleware pauses for a reviewer \u2014 no need to manually construct a LangGraph workflow.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2026\/08\/langchain_workflow_ex.png\" alt=\"LangChain refund workflow with human approval\" width=\"807\" height=\"511\" \/><\/p>\n<p style=\"color: #64748b; font-size: 0.88rem;\">On interrupt, inspect the pending tool call, then resume with <code>Command(resume=...)<\/code> using the same <code>thread_id<\/code>. See the <a href=\"https:\/\/docs.langchain.com\/oss\/python\/langchain\/human-in-the-loop\">human-in-the-loop docs<\/a> for approve \/ edit \/ reject patterns. Use a durable checkpointer (for example Postgres) in production.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2026\/08\/langchain_code_ex.png\" alt=\"LangChain human-in-the-loop code example\" width=\"668\" height=\"582\" \/><\/p>\n<h2>What Is LangGraph? Use It When Your Code Owns the Route<\/h2>\n<hr \/>\n<div style=\"margin: 16px 0 22px; padding: 12px 16px; border-left: 4px solid #059669; border-radius: 0 8px 8px 0; background: #f8fafc;\">\n<p><strong style=\"color: #065f46; margin-bottom: 6px;\">Choose this layer if:<\/strong><\/p>\n<ul style=\"margin: 0; padding-left: 24px;\">\n<li>Your application \u2014 not just the model \u2014 must decide which step runs next (application-defined routing and stages).<\/li>\n<li>You need branching, loops, or multi-step workflows with explicit control.<\/li>\n<li>You need persistence, interrupts, or stateful execution across steps.<\/li>\n<\/ul>\n<\/div>\n<p>LangGraph is a low-level orchestration\/runtime framework where application state flows through <strong>nodes<\/strong> (model calls, tools, or rules) and <strong>edges<\/strong>, giving developers explicit control over execution, routing, persistence, and interrupts. LangGraph does not mean every decision must be hard-coded \u2014 a node can still call an LLM. Your application explicitly controls workflow structure and state transitions, whether routing is deterministic or model-driven inside nodes.<\/p>\n<p>Reach for LangGraph when control flow is part of the product: missing-document loops, parallel policy checks, risk-based routing, or stage-specific human review. Use a durable <a href=\"https:\/\/docs.langchain.com\/oss\/python\/langgraph\/persistence\">checkpointer<\/a> (such as PostgreSQL) in production.<\/p>\n<h3>Execution flow<\/h3>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2026\/08\/graph_flow.png\" alt=\"LangGraph workflow execution flow\" width=\"809\" height=\"437\" \/><\/p>\n<h3>Syntax at a glance<\/h3>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2026\/08\/langgraph_code_ex.png\" alt=\"LangGraph workflow code example\" width=\"708\" height=\"510\" \/><\/p>\n<p style=\"color: #64748b; font-size: 0.88rem;\">Each node returns a partial state update. Your routing function decides the next step \u2014 that is the core LangGraph idea.<\/p>\n<h3>Example: insurance claim orchestration<\/h3>\n<p>An insurance claim is not just a chat. Documents may be requested in a loop, checks can run in parallel, and high-risk claims must pause for a human \u2014 LangGraph makes each transition explicit and testable.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2026\/08\/langgraph_flow_ex.png\" alt=\"LangGraph insurance claim orchestration workflow\" width=\"760\" height=\"560\" \/><\/p>\n<h2>Same Problem: LangChain vs LangGraph<\/h2>\n<hr \/>\n<p>Same requirement: customer asks for refund \u2192 check eligibility \u2192 approve refund \u2192 notify customer.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2026\/08\/diagram1.png\" alt=\"LangChain refund workflow \u2014 model-driven tool selection\" width=\"711\" height=\"336\" \/><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2026\/08\/diagram2.png\" alt=\"LangGraph refund workflow \u2014 application-defined stages\" width=\"714\" height=\"339\" \/><\/p>\n<p>LangChain lets the model drive tool selection; LangGraph makes eligibility, risk routing, human review, and notification explicit, testable stages.<\/p>\n<h2>The Real Difference: Abstraction vs Orchestration<\/h2>\n<hr \/>\n<p>The split is abstraction level, not capability. <strong>LangChain<\/strong> is the higher-level agent framework \u2014 the model picks tools until it can answer, configured through prompts, tools, and middleware. <strong>LangGraph<\/strong> is a low-level orchestration\/runtime framework \u2014 your code defines nodes, edges, and routing while the application owns structure, persistence, and interrupts.<\/p>\n<p>Many teams embed <code>create_agent<\/code> as one node inside a larger LangGraph workflow when only part of the system needs a free-form tool loop.<\/p>\n<h2>When NOT to Use LangGraph<\/h2>\n<hr \/>\n<p>Don&#8217;t reach for LangGraph just because:<\/p>\n<ul>\n<li>You have an LLM.<\/li>\n<li>You have multiple tools.<\/li>\n<li>You have RAG.<\/li>\n<li>You need a chatbot.<\/li>\n<li>You need a simple retry.<\/li>\n<li>You need basic human approval.<\/li>\n<\/ul>\n<p>Use LangGraph when orchestration itself has become part of your application&#8217;s business logic.<\/p>\n<h2>Where Deep Agents Fits<\/h2>\n<hr \/>\n<p><strong>Deep Agents<\/strong> is an agent harness built on LangGraph, providing higher-level capabilities such as planning, filesystem tools, subagents, and context management. The pattern is: plan \u2192 delegate to parallel subagents \u2192 collect evidence \u2192 synthesise output. Most conventional chatbots and support agents do not need it; stick with <code>create_agent<\/code> until the task looks like handing a multi-hour project to a colleague. See the <a href=\"https:\/\/docs.langchain.com\/oss\/python\/deepagents\/overview\">Deep Agents overview<\/a> when you get there.<\/p>\n<h2>Can You Combine Them?<\/h2>\n<hr \/>\n<p>You can place a LangChain agent inside a larger LangGraph workflow \u2014 for example, a billing specialist node inside a case-management graph that routes between fraud review and finance approval.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2026\/08\/mixed_approach_flow.png\" alt=\"LangChain agent inside LangGraph workflow\" width=\"640\" height=\"211\" \/><\/p>\n<h2>Decision Table<\/h2>\n<hr \/>\n<table style=\"border-collapse: collapse; width: 100%; margin: 24px 0;\" border=\"1\" cellspacing=\"0\" cellpadding=\"12\">\n<thead>\n<tr style=\"background-color: #f2f2f2;\">\n<th style=\"width: 31.6379%;\">Requirement<\/th>\n<th style=\"width: 32.3276%;\">Start with<\/th>\n<th style=\"width: 35.9483%;\">Reason<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"width: 31.6379%;\">Chatbot or support agent<br \/>\nthat calls tools<\/td>\n<td style=\"width: 32.3276%;\">LangChain <code>create_agent<\/code><\/td>\n<td style=\"width: 35.9483%;\">The standard model-and-tool<br \/>\nloop is built in.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 31.6379%;\">Approval before a refund<br \/>\nor other sensitive action<\/td>\n<td style=\"width: 32.3276%;\">LangChain middleware +<br \/>\ncheckpointer<\/td>\n<td style=\"width: 35.9483%;\">Pause specific tools without<br \/>\nmanually constructing a<br \/>\nLangGraph workflow.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 31.6379%;\">Standard RAG with<br \/>\nLangChain abstractions<\/td>\n<td style=\"width: 32.3276%;\">LangChain<\/td>\n<td style=\"width: 35.9483%;\">Retrieval helpers keep code<br \/>\nsmall; RAG alone does not<br \/>\nrequire LangChain.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 31.6379%;\">Business stages, branches,<br \/>\nor parallel steps you must<br \/>\nown<\/td>\n<td style=\"width: 32.3276%;\">LangGraph<\/td>\n<td style=\"width: 35.9483%;\">Orchestration topology<br \/>\nbecomes explicit<br \/>\napplication logic.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 31.6379%;\">Complex retrieval<br \/>\norchestration \u2014 custom<br \/>\nretry or routing rules<\/td>\n<td style=\"width: 32.3276%;\">LangGraph<\/td>\n<td style=\"width: 35.9483%;\">When retrieval itself becomes<br \/>\n<span style=\"font-size: inherit;\">a <\/span><span style=\"font-size: inherit;\">multi-stage workflow with<\/span><br \/>\nexplicit routing, retries, or<br \/>\nconditional branches.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 31.6379%;\">Long research or coding<br \/>\njob with files and<br \/>\nsubagents<\/td>\n<td style=\"width: 32.3276%;\">Deep Agents<\/td>\n<td style=\"width: 35.9483%;\">A ready-made harness for<br \/>\nautonomous multi-step work.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Conclusion: Where to Start<\/h2>\n<hr \/>\n<p>For most apps, start with <code>create_agent<\/code> and middleware. Move to LangGraph when orchestration becomes application logic. Consider Deep Agents only for long autonomous work with planning, files, and subagents \u2014 these are different paths, not mandatory steps.<\/p>\n<p>Next steps: follow the <a href=\"https:\/\/docs.langchain.com\/oss\/python\/langchain\/overview\">LangChain quickstart<\/a>, then skim the <a href=\"https:\/\/docs.langchain.com\/oss\/python\/langgraph\/overview\">LangGraph overview<\/a> when requirements grow. Use the highest abstraction level that still gives you the control you need.<\/p>\n<h2>Sources<\/h2>\n<hr \/>\n<ul>\n<li><a href=\"https:\/\/docs.langchain.com\/oss\/python\/concepts\/products\" target=\"_blank\" rel=\"noopener noreferrer\">LangChain product architecture<\/a><\/li>\n<li><a href=\"https:\/\/docs.langchain.com\/oss\/python\/langchain\/agents\" target=\"_blank\" rel=\"noopener noreferrer\">LangChain agents<\/a><\/li>\n<li><a href=\"https:\/\/docs.langchain.com\/oss\/python\/langchain\/human-in-the-loop\" target=\"_blank\" rel=\"noopener noreferrer\">Human-in-the-loop middleware<\/a><\/li>\n<li><a href=\"https:\/\/docs.langchain.com\/oss\/python\/langgraph\/graph-api\" target=\"_blank\" rel=\"noopener noreferrer\">LangGraph Graph API<\/a><\/li>\n<li><a href=\"https:\/\/docs.langchain.com\/oss\/python\/langgraph\/persistence\" target=\"_blank\" rel=\"noopener noreferrer\">LangGraph persistence<\/a><\/li>\n<li><a href=\"https:\/\/docs.langchain.com\/oss\/python\/langgraph\/checkpointers\" target=\"_blank\" rel=\"noopener noreferrer\">LangGraph checkpointers<\/a><\/li>\n<li><a href=\"https:\/\/docs.langchain.com\/oss\/python\/langgraph\/stores\" target=\"_blank\" rel=\"noopener noreferrer\">LangGraph stores<\/a><\/li>\n<li><a href=\"https:\/\/docs.langchain.com\/oss\/python\/langgraph\/interrupts\" target=\"_blank\" rel=\"noopener noreferrer\">LangGraph interrupts<\/a><\/li>\n<li><a href=\"https:\/\/docs.langchain.com\/oss\/python\/deepagents\/overview\" target=\"_blank\" rel=\"noopener noreferrer\">Deep Agents overview<\/a><\/li>\n<\/ul>\n<p style=\"color: #64748b; font-size: 0.9rem; margin-top: 44px; padding-top: 18px; border-top: 1px solid #e5e7eb;\">Examples intentionally omit provider credentials and some production error handling. Examples were verified against <code>langchain==1.3.15<\/code>, <code>langgraph==1.2.11<\/code>, <code>deepagents==0.7.7<\/code>, and <code>langchain-google-genai==4.3.4<\/code> (August 2026). Pin compatible versions and run with your configured provider before deployment.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This guide explains what LangChain and LangGraph each do, how they fit together, and how to choose between them. It also covers Deep Agents \u2014 an agent harness for long autonomous tasks \u2014 so the full picture is clear before making a choice. TL;DR \u2014 The rule of thumb that decides everything As a rule [&hellip;]<\/p>\n","protected":false},"author":2317,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":21},"categories":[5876],"tags":[8774,6263,7764,6408],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/80943"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/2317"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=80943"}],"version-history":[{"count":14,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/80943\/revisions"}],"predecessor-version":[{"id":82007,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/80943\/revisions\/82007"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=80943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=80943"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=80943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}