# 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.

- Page: https://tecyfy.com/concepts/langchain
- Subject: AI agents (https://tecyfy.com/concepts)
- Level: 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 [tools](https://tecyfy.com/concepts/tool-use) 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-5` or `openai: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 approval](https://tecyfy.com/concepts/human-in-the-loop), 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 [workflow](https://tecyfy.com/concepts/agentic-workflow) side of building with models, while `create_agent` is the [Agent](https://tecyfy.com/concepts/agent) 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](/blog/langchain-vs-langgraph) shows the code for each layer and a picker for where to start.

## Related

- [Agent](https://tecyfy.com/concepts/agent): A model that uses tools in a loop, deciding each next step from what the last one returned, until the task is done.
- [Agentic Workflow](https://tecyfy.com/concepts/agentic-workflow): A 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.
- [Tool Use](https://tecyfy.com/concepts/tool-use): Giving 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.
- [Human in the Loop](https://tecyfy.com/concepts/human-in-the-loop): A person approves, corrects or stops an AI system at set points, such as before an agent sends, pays or deletes something.
- [Orchestration](https://tecyfy.com/concepts/orchestration): Running the steps of data pipelines in the right order and at the right time, retrying failures and alerting someone when a step breaks.

## Sources

- [Runtimes, frameworks, and harnesses](https://docs.langchain.com/oss/python/concepts/products)
- [Agents](https://docs.langchain.com/oss/python/langchain/agents)
- [LangGraph overview](https://docs.langchain.com/oss/python/langgraph/overview)
