LangGraph

1.0.x · active · verified Sat Feb 28

LangGraph is a low-level agent orchestration framework providing graph-based execution with durable state, built-in persistence, and human-in-the-loop patterns. As of v1.0 it is the foundational runtime for LangChain agents. Use LangChain for high-level agent abstractions, LangGraph for fine-grained control.

Warnings

Install

Imports

Quickstart

Minimal single-node StateGraph in LangGraph 1.0.

from langgraph.graph import StateGraph, END
from typing import TypedDict

class State(TypedDict):
    messages: list

def call_model(state: State):
    # your LLM call here
    return {"messages": state["messages"]}

graph = StateGraph(State)
graph.add_node("agent", call_model)
graph.set_entry_point("agent")
graph.add_edge("agent", END)

app = graph.compile()
result = app.invoke({"messages": [{"role": "user", "content": "hello"}]})

view raw JSON →