Skip to main content

Building stateful, multi-actor applications with LLMs

Project description

LangGraph Logo

Version Downloads Open Issues Docs

[!NOTE] Looking for the JS version? See the JS repo and the JS docs.

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.

# This code depends on pip install langchain[anthropic]
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."

agent = create_react_agent("anthropic:claude-3-7-sonnet-latest", tools=[search])
agent.invoke(
    {"messages": [{"role": "user", "content": "what is the weather in sf"}]}
)

[!TIP] Check out this guide that walks through implementing common patterns (workflows and agents) in LangGraph.

Why use LangGraph?

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)

LangGraph’s 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:

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

Pairing with LangGraph Platform

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.

Additional resources

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

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.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langgraph-0.3.31.tar.gz (120.4 kB view details)

Uploaded Source

Built Distribution

langgraph-0.3.31-py3-none-any.whl (145.2 kB view details)

Uploaded Python 3

File details

Details for the file langgraph-0.3.31.tar.gz.

File metadata

  • Download URL: langgraph-0.3.31.tar.gz
  • Upload date:
  • Size: 120.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for langgraph-0.3.31.tar.gz
Algorithm Hash digest
SHA256 c76bbc8f26604929d6c2520d937b5602d5bb1dde2c0580398d015f7f6841f14c
MD5 01c4dbaa834e2b1680e14c435952ccd2
BLAKE2b-256 b549f6814bc1b016fd8f403856e986a4a0b35fd9cc34671f2abf649753643194

See more details on using hashes here.

File details

Details for the file langgraph-0.3.31-py3-none-any.whl.

File metadata

  • Download URL: langgraph-0.3.31-py3-none-any.whl
  • Upload date:
  • Size: 145.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for langgraph-0.3.31-py3-none-any.whl
Algorithm Hash digest
SHA256 f42a6850d03696f2a54d3c833db39aa201cfda78217846a5b8936ad95fe41e6c
MD5 b3a005ebe96f54b18634fcd88dbcb606
BLAKE2b-256 530fc4802c26da60b84af1ee4a1d3013378da2354220aa2d0e766d07c5db1de2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page