LangChain vs LangGraph: Which One to Use
LangChain is a library of model, tool and integration components for building LLM apps. LangGraph is a lower-level runtime for stateful, long-running agents, and LangChain’s own README sends you there when you need more control over orchestration. We build POLYROB, an MIT-licensed agent you install with one command, and its autonomous runs stop at 150 steps and $2.00 by default (docs/[email protected]), so we know which parts of an agent you would otherwise write yourself.
This page compares the two on what their own READMEs say, then shows where a ready-made agent fits when neither library is quite what you need. Facts about LangChain and LangGraph were read from their GitHub READMEs on 2026-11-14.
What is the difference between LangChain and LangGraph?
The short version: LangChain gives you the parts, LangGraph gives you the control flow.
| Question | LangChain | LangGraph |
|---|---|---|
| How does its README describe it? | “The agent engineering platform”, a framework for building agents and LLM-powered applications | “Low-level orchestration framework for building stateful agents” |
| What does it give you? | A standard interface for models, embeddings and vector stores, plus integrations with model providers and tools | Durable execution, human-in-the-loop, short-term and long-term memory, deployment support |
| When does it point you elsewhere? | For “more advanced customization or agent orchestration” it points to LangGraph | It says it can be used standalone and also works with any LangChain product |
| Quickstart | uv add langchain, then init_chat_model("openai:gpt-5.5") | pip install -U langgraph |
| License badge | MIT | MIT |
Sources: LangChain README and LangGraph README, both fetched 2026-11-14.
Both projects also point to Deep Agents, a higher-level package for agents that plan, use subagents and work with a file system. Each README describes it as built on its own project, so you will meet that name in both places.
What does LangChain do?
LangChain’s README says it helps you “chain together interoperable components and third-party integrations” so an LLM application is quicker to build. Its quickstart is three lines: import init_chat_model, pick a model by a provider:model string, call invoke.
The pitch in the README rests on six points: data augmentation from many sources, swapping models without rewriting the app, quick prototyping with a component-based design, monitoring and evaluation through LangSmith, a large ecosystem of integrations, and abstraction layers from high-level chains down to low-level components.
Pick LangChain when the job is an application with a model call in the middle: a retrieval pipeline, a summarizer, a tool-using assistant that runs when a user asks and stops when it answers.
What does LangGraph do?
LangGraph’s README lists five reasons to use it, and four of them are about keeping an agent alive and supervised:
- Durable execution: agents that survive failures and resume from where they stopped.
- Human-in-the-loop: inspect and change agent state at any point in a run.
- Memory: short-term working memory for the current reasoning and long-term memory across sessions.
- Debugging with LangSmith: traces of execution paths and state changes.
- Deployment: infrastructure for stateful, long-running workflows.
Pick LangGraph when you need to own the control flow. If the agent has to pause for approval, resume after a crash, or take different branches depending on state, you want the lower-level runtime, and you will write that graph yourself.
Is LangGraph made by LangChain?
Yes. Both repositories sit in the same GitHub organization, langchain-ai, and each README lists the other as part of one ecosystem next to Deep Agents and LangSmith. LangGraph’s README adds that it can be used standalone.
Do I need to learn LangChain before LangGraph?
No. LangGraph’s README says it “can be used standalone”, so a LangGraph agent does not have to import LangChain. In practice the two are often used together because LangChain supplies the model and tool integrations, but the dependency is a choice, not a requirement.
Is LangGraph still relevant?
On 2026-11-14 the LangChain README still sends readers to LangGraph for agent orchestration, and the LangGraph README describes durable execution and human-in-the-loop as its core features. The project is current in the places where its own maintainers point readers. We did not measure usage and do not compare popularity.
Which should you choose?
Use this as a rule of thumb, built from the two READMEs:
- You are building an LLM feature inside an app and want swappable models and integrations: LangChain.
- You are building an agent that must pause, resume, branch and keep state: LangGraph.
- You want both: LangGraph for the control flow, LangChain for the model and tool components.
- You want an agent you can talk to today, not a library to program: neither, read on.
When is neither of them the right answer?
Both are libraries. You write Python that defines the agent, then you decide where it runs, how it is reached, what it remembers between sessions and who is allowed to talk to it. That is the right trade when the agent is a component of your product.
If you want the agent itself, the work is different. POLYROB is an open-source, self-hosted agent that you install, talk to in a terminal, a web console or a chat app, and give goals. You configure it rather than program its control flow. A few of the things the LangGraph README lists as features are built into it:
- Goals and jobs survive a restart. A fresh install starts with an empty goal board and no jobs, and stays that way until you add work (
docs/guide/[email protected]). - Memory is local. Recall uses SQLite full-text search (FTS5) by default (
modules/memory/[email protected]). Our guide to AI agent memory covers how recall works. - Autonomous runs have two stops: a step cap of 150 (
AUTONOMOUS_MAX_STEPS) and a spend cap of $2.00 per run (AUTONOMOUS_RUN_BUDGET_USD), both by default and both changeable (docs/[email protected]). The spend check fails open if the cost probe errors, so treat the cap as a guard, not a guarantee. - Sub-agents get a narrowed toolset.
SUBAGENT_LEAST_PRIVILEGEis on by default, so a delegated child runs with a dedicated, smaller controller (agents/task/agent/[email protected],docs/[email protected]). - It reaches your chats. Telegram, WhatsApp, email, Discord, Slack, Signal, Feishu and DingTalk each have a surface directory in the repository (
surfaces/@v1.7.9). - It is an MCP client, so tools from MCP servers become available to the agent without glue code (
tools/mcp/[email protected]). See how the MCP client works.
Installing it is one command, covered on the install page:
curl -fsSL https://polyrob.dev/install.sh | bash
The README at v1.7.9 also shows how to download the script and read it before you run it ([email protected]). The longer story of running one yourself is in our guide to a self-hosted AI agent.
Where does POLYROB fall short of LangChain and LangGraph?
We would rather say it here than have you find it later.
- It is not a library for custom graphs. If your product needs a specific branching workflow written in code, LangGraph gives you that control and POLYROB does not.
- Its extension ecosystem is small. LangChain’s README stresses a large set of integrations; POLYROB has seven first-party packs, and a third-party pack loads only when you name it (
docs/[email protected]). - It is a young project with a small community, so you will find fewer tutorials, examples and answered questions.
- The optional serverless sandbox packs (Modal, Daytona, Vercel Sandbox, Singularity) have been tested against fakes so far, not at scale (
docs/[email protected]). The default code execution path is covered in our guide to the AI agent sandbox. - It runs on Linux, macOS and WSL2 only (
[email protected]).
What should you do next?
If you are choosing between the two libraries, write down whether your agent has to pause, resume and branch. If it does, start with LangGraph. If it is a model call with some tools around it, start with LangChain and add LangGraph when the flow gets complicated. Our comparison of nine LangChain alternatives covers CrewAI, LlamaIndex, Haystack, DSPy and Mastra as well. If you are leaving LangGraph itself, read our comparison of LangGraph alternatives.
If what you wanted all along was an agent that already works, read the overview of an open-source AI agent, then run the install command above and give it a first goal. You can add a library later, since POLYROB speaks MCP and exposes an API for your own code to call.
FAQ: LangChain, LangGraph and POLYROB
Can I use LangGraph without LangChain?
Yes. The LangGraph README says it can be used standalone.
Which one is better for production agents?
The LangGraph README lists durable execution, human oversight and deployment support as its focus, so it is the one built around long-running, stateful production workflows. LangChain’s README points to LangGraph for orchestration.
Is POLYROB a replacement for either?
No. They are libraries for writing an agent. POLYROB is an agent you run. You could call a POLYROB agent from code that uses either library, because POLYROB exposes a REST API and an A2A surface (docs/[email protected]).
POLYROB is an open-source AI agent you run and own. Install it or read the docs.