LangGraph — used by Replit, Uber, LinkedIn, GitLab and more — is a low-level orchestration framework for building controllable agents. While langchain provides integrations and composable components to streamline LLM application development, the LangGraph library enables agent orchestration — offering customizable architectures, long-term memory, and human-in-the-loop to reliably handle complex tasks.
pip install -U langgraph
To learn more about how to use LangGraph, check out the docs. We show a simple example below of how to create a ReAct agent.
from langchain_anthropic import ChatAnthropic
from langgraph.prebuilt import create_react_agent
def search(query: str):
"""Call to surf the web."""
if "sf" in query.lower() or "san francisco" in query.lower():
return "It's 60 degrees and foggy."
return "It's 90 degrees and sunny."
model = ChatAnthropic(model=“claude-3-7-sonnet-latest”)
tools = [search]
agent = create_react_agent(model, tools)
agent.invoke(
{"messages": [{"role": "user", "content": "what is the weather in sf"}]}
)
LangGraph is built for developers who want to build powerful, adaptable AI agents. Developers choose LangGraph for:
- Reliability and controllability. Steer agent actions with moderation checks and human-in-the-loop approvals. LangGraph persists context for long-running workflows, keeping your agents on course.
- Low-level and extensible. Build custom agents with fully descriptive, low-level primitives – free from rigid abstractions that limit customization. Design scalable multi-agent systems, with each agent serving a specific role tailored to your use case.
- First-class streaming support. With token-by-token streaming and streaming of intermediate steps, LangGraph gives users clear visibility into agent reasoning and actions as they unfold in real time.
LangGraph is trusted in production and powering agents for companies like:
- Klarna: Customer support bot for 85 million active users
- Elastic: Security AI assistant for threat detection
- Uber: Automated unit test generation
- Replit: Code generation
- And many more (see list here)
While LangGraph can be used standalone, it also integrates seamlessly with any LangChain product, giving developers a full suite of tools for building agents. To improve your LLM application development, pair LangGraph with:
- LangSmith — Helpful for agent evals and observability. Debug poor-performing LLM app runs, evaluate agent trajectories, gain visibility in production, and improve performance over time.
- LangGraph Platform — Deploy and scale agents effortlessly with a purpose-built deployment platform for long running, stateful workflows. Discover, reuse, configure, and share agents across teams — and iterate quickly with visual prototyping in LangGraph Studio.
While LangGraph is our open-source agent orchestration framework, enterprises that need scalable agent deployment can benefit from LangGraph Platform.
LangGraph Platform can help engineering teams:
- Accelerate agent development: Quickly create agent UXs with configurable templates and LangGraph Studio for visualizing and debugging agent interactions.
- Deploy seamlessly: We handle the complexity of deploying your agent. LangGraph Platform includes robust APIs for memory, threads, and cron jobs plus auto-scaling task queues & servers.
- Centralize agent management & reusability: Discover, reuse, and manage agents across the organization. Business users can also modify agents without coding.
- LangChain Academy: Learn the basics of LangGraph in our free, structured course.
- Tutorials: Simple walkthroughs with guided examples on getting started with LangGraph.
- Templates: Pre-built reference apps for common agentic workflows (e.g. ReAct agent, memory, retrieval etc.) that can be cloned and adapted.
- How-to Guides: Quick, actionable code snippets for topics such as streaming, adding memory & persistence, and design patterns (e.g. branching, subgraphs, etc.).
- API Reference: Detailed reference on core classes, methods, how to use the graph and checkpointing APIs, and higher-level prebuilt components.
- Built with LangGraph: Hear how industry leaders use LangGraph to ship powerful, production-ready AI applications.
LangGraph is inspired by Pregel and Apache Beam. The public interface draws inspiration from NetworkX. LangGraph is built by LangChain Inc, the creators of LangChain, but can be used without LangChain.