Guide · Open source
How to use LangGraph: install it and build a stateful agent
Updated · written with AI from the project's own documentation and checked against our catalogue data
LangGraph is a low-level Python framework for building workflows and AI agents that keep track of their state over time. It suits multi-step tasks that run for a long stretch, pause for human review, or need to resume after an interruption. This guide explains what it does, how to install it, and when a higher-level option is a better fit.
Quick start
- 1Install Python. LangGraph is a Python library, so make sure Python is installed on your machine before you continue.
- 2Install LangGraph. Run pip install -U langgraph in your terminal to install or upgrade the package.
- 3Read the quickstart. Open the official LangGraph Quickstart to see how to build your first graph.
- 4Decide on a higher-level package. If you want a quicker start on a ready-made agent, check Deep Agents, which the README describes as built on LangGraph.
- 5Use the docs for specific features. Consult the guides for streaming, memory and persistence, and design patterns such as branching and subgraphs.
What LangGraph is and what it is for
LangGraph describes itself as a low-level orchestration framework for building, managing, and deploying long-running, stateful agents. Its core job is supporting workflows where the state has to survive across steps, failures, and waits.
The README lists five main capabilities: durable execution (agents that persist through failures and resume where they left off), human-in-the-loop (inspecting and modifying agent state during a run), memory (short-term working memory and long-term memory across sessions), debugging with LangSmith, and production deployment.
Install LangGraph with pip
LangGraph is a Python library, so you need Python installed first. Install it with the package manager pip using the command from the README. The -U flag upgrades the package if it is already installed.
pip install -U langgraphChoose LangGraph or a higher-level package
LangGraph is the lower-level base. The README points readers who want to build agents quickly to Deep Agents, a higher-level package built on LangGraph for agents that can plan, use subagents, and work with file systems.
If you write JavaScript or TypeScript, the README points you to the separate LangGraph.js project instead of this Python library.
- Pick LangGraph if you want fine-grained control over agent state and execution flow.
- Pick Deep Agents if you want a quicker start on a ready-made agent pattern.
- Pick LangGraph.js if your project is JavaScript or TypeScript.
Start with the official quickstart and docs
The README links to a LangGraph Quickstart and to comprehensive documentation with conceptual overviews and guides. Guides cover topics such as streaming, adding memory and persistence, and design patterns like branching and subgraphs.
The API reference is at reference.langchain.com/python/langgraph. For quick questions, the README points to Chat LangChain and to the LangChain Forum. LangChain Academy offers a free, structured introductory course.
- Quickstart: https://docs.langchain.com/oss/python/langgraph/quickstart
- Documentation: https://docs.langchain.com/oss/python/langgraph/overview
- API reference: https://reference.langchain.com/python/langgraph
Know what LangGraph does not do for you
LangGraph is a library you write code against. It does not provide a ready-made agent out of the box, and non-programmers will need to write Python to use it.
The README says LangGraph integrates with LangChain products, but it also states it can be used without LangChain.
What people use it for
- Building a multi-step AI agent that must resume after a crash or a long wait.
- Adding a human review step where someone inspects or edits the agent's state partway through a run.
- Creating a workflow with fine-grained control over how an agent moves between steps.
- Keeping short-term working memory during a task and long-term memory across sessions.
Frequently asked questions
Is LangGraph free to use?
LangGraph is released under the MIT licence, according to the project's licence badge and the README. The MIT licence is a permissive open-source licence; check the repository's licence file for the full terms.
What do I need to run LangGraph?
The only prerequisite listed is Python, and LangGraph is installed with pip install -U langgraph. You also need to be comfortable writing Python code, because the library is used from code.
Do I need LangChain to use LangGraph?
No. The README says LangGraph is built by LangChain Inc and can be used without LangChain, although it also integrates with LangChain products.
Is LangGraph good for beginners?
The README suggests beginners who want a ready-made agent use Deep Agents instead, since it is a higher-level package built on LangGraph. LangGraph itself is a low-level tool and suits developers comfortable with Python.
Can I use LangGraph with JavaScript or TypeScript?
LangGraph is a Python library. The README points JavaScript and TypeScript teams to the separate LangGraph.js project.
How does LangGraph compare with CrewAI, AutoGen, LlamaIndex Workflows or Haystack?
These are comparable agent and workflow projects. This page does not benchmark them, so compare them on the features you need, such as state handling, human review and the level of control you want.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
LangGraph suits Python developers who need stateful agents that survive failures, long waits, and human review, and who want low-level control. Choose a higher-level package such as Deep Agents if you want a quicker start, or LangGraph.js if your team works in JavaScript or TypeScript.
Install options & downloads