What is LangChain, and how does it relate to LangGraph?
An open-source framework for building AI agents: create_agent runs a model that calls tools in a loop, with integrations for most model providers. It runs on LangGraph, the lower-level runtime from the same company.
intermediate · Also called LangGraph, create_agent
LangChain is now an agent framework built around one function, create_agent, which takes a model, a list of toolsTool UseGiving a model a list of things it can ask to have done, such as search the web or read a file. The model asks; the program around it does the work and hands back the result. and a system prompt, and runs the model in a loop: call a tool, read the result, decide the next step, until the task is done.
What LangChain gives you
- One way to call many models. A model is a string such as
anthropic:claude-sonnet-5oropenai:gpt-5.5, so switching provider is one line. - The agent loop, already written and tested.
- Middleware that changes the loop without rewriting it: pause before a risky tool for a person's approval, summarise a long history, retry a failed call, cap the number of steps.
Where LangGraph fits
LangGraph, from the same company, is the layer underneath. In LangGraph you draw the steps yourself as a graph: nodes are Python functions, edges say what runs next, and the state they share is saved after every step. That saved state is what lets a run pause for a person's approvalHuman in the LoopA person approves, corrects or stops an AI system at set points, such as before an agent sends, pays or deletes something., resume after a crash or pick up a conversation days later.
Since LangChain 1.0, every create_agent agent is a LangGraph graph. So a LangChain agent gets saving and pausing without your drawing anything. You go down to LangGraph when part of the path should be fixed rather than chosen by the model: a check that always runs, a branch by ticket type, parallel steps you join. That is the workflowAgentic WorkflowA fixed sequence of model calls and tools that your code controls, such as classify, then look up, then draft. An agent decides its own next steps; a workflow follows the path you wrote. side of building with models, while create_agent is the AgentAgentA model that uses tools in a loop, deciding each next step from what the last one returned, until the task is done. side.
A third layer, Deep Agents, sits on top of both and adds planning, subagents and a file system for long tasks.
When not to use it
If you call one provider and need a simple loop, that provider's own SDK is less to learn. LangChain earns its place when you want to switch models, reuse its middleware, or grow into LangGraph's control. LangChain vs LangGraph shows the code for each layer and a picker for where to start.
Sources