MCPcopy
hub / github.com/langchain-ai/langgraph

github.com/langchain-ai/langgraph @1.2.7 sqlite

repository ↗ · DeepWiki ↗ · release 1.2.7 ↗
7,757 symbols 45,306 edges 455 files 2,836 documented · 37%
README

  <img alt="LangGraph Logo" src="https://github.com/langchain-ai/langgraph/raw/1.2.7/github/images/logo-dark.svg" width="50%">

Low-level orchestration framework for building stateful agents.

PyPI - License PyPI - Downloads Version Twitter / X

Trusted by companies shaping the future of agents – including Klarna, Replit, Elastic, and more – LangGraph is a low-level orchestration framework for building, managing, and deploying long-running, stateful agents.

pip install -U langgraph

[!TIP] If you're looking to quickly build agents, check out Deep Agents — a higher-level package built on LangGraph for agents that can plan, use subagents, and leverage file systems for complex tasks.

For an equivalent JS/TS library, check out LangGraph.js and the JS docs.

Why use LangGraph?

LangGraph provides low-level supporting infrastructure for any long-running, stateful workflow or agent:

  • Durable execution — Build agents that persist through failures and can run for extended periods, automatically resuming from exactly where they left off.
  • Human-in-the-loop — Seamlessly incorporate human oversight by inspecting and modifying agent state at any point during execution.
  • Comprehensive memory — Create truly stateful agents with both short-term working memory for ongoing reasoning and long-term persistent memory across sessions.
  • Debugging with LangSmith — Gain deep visibility into complex agent behavior with visualization tools that trace execution paths, capture state transitions, and provide detailed runtime metrics.
  • Production-ready deployment — Deploy sophisticated agent systems confidently with scalable infrastructure designed to handle the unique challenges of stateful, long-running workflows.

[!TIP] For developing, debugging, and deploying AI agents and LLM applications, see LangSmith.

LangGraph ecosystem

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:

  • Deep Agents – Build agents that can plan, use subagents, and leverage file systems for complex tasks.
  • LangChain – Provides integrations and composable components to streamline LLM application development.
  • 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.
  • LangSmith Deployment – 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 LangSmith Studio.

Documentation

Discussions: Visit the LangChain Forum to connect with the community and share all of your technical questions, ideas, and feedback.

Additional resources

  • Guides – Quick, actionable code snippets for topics such as streaming, adding memory & persistence, and design patterns (e.g. branching, subgraphs, etc.).
  • LangChain Academy – Learn the basics of LangGraph in our free, structured course.
  • Case studies – Hear how industry leaders use LangGraph to ship AI applications at scale.
  • Contributing Guide – Learn how to contribute to LangChain projects and find good first issues.
  • Code of Conduct – Our community guidelines and standards for participation.

Acknowledgements

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.

Core symbols most depended-on inside this repo

add_node
called by 1433
libs/langgraph/langgraph/graph/state.py
add_edge
called by 1394
libs/langgraph/langgraph/graph/state.py
compile
called by 974
libs/langgraph/langgraph/graph/state.py
get
called by 645
libs/langgraph/langgraph/channels/topic.py
get
called by 358
libs/sdk-py/langgraph_sdk/_async/runs.py
stream
called by 225
libs/langgraph/langgraph/pregel/main.py
get
called by 218
libs/checkpoint/langgraph/cache/base/__init__.py
join
called by 216
libs/sdk-py/langgraph_sdk/_async/runs.py

Shape

Function 4,024
Method 2,607
Class 1,100
Route 26

Languages

Python100%
TypeScript1%

Modules by API surface

libs/langgraph/tests/test_pregel.py411 symbols
libs/langgraph/tests/test_pregel_async.py341 symbols
libs/langgraph/tests/test_pregel_stream_events_v3.py265 symbols
libs/langgraph/tests/test_retry.py231 symbols
libs/sdk-py/langgraph_sdk/_async/stream.py121 symbols
libs/sdk-py/langgraph_sdk/_sync/stream.py110 symbols
libs/prebuilt/tests/test_react_agent.py103 symbols
libs/cli/tests/unit_tests/test_deploy_helpers.py98 symbols
libs/prebuilt/tests/test_tool_node.py95 symbols
libs/cli/tests/unit_tests/test_config.py93 symbols
libs/langgraph/tests/test_stream_events_v3.py88 symbols
libs/langgraph/tests/test_time_travel.py86 symbols

Dependencies from manifests, versioned

@eslint/eslintrc3.3.5 · 1×
@eslint/js10.0.1 · 1×
@js-monorepo-example/shared* · 1×
@langchain/core1.1.48 · 1×
@tsconfig/recommended1.0.13 · 1×
@types/jest30.0.0 · 1×
@typescript-eslint/eslint-plugin8.60.1 · 1×
@typescript-eslint/parser8.60.1 · 1×
dotenv17.4.2 · 1×
eslint10.4.1 · 1×
eslint-config-prettier10.1.8 · 1×

Datastores touched

postgresDatabase · 1 repos
dbnameDatabase · 1 repos
mydbDatabase · 1 repos

For agents

$ claude mcp add langgraph \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact