LangGraph
Build stateful, multi-actor agent workflows as directed graphs — cycles, branching, human-in-the-loop, and persistent state built in.
LangGraph
LangGraph extends LangChain with a graph-based runtime for building stateful agent and multi-actor workflows. Unlike linear chains, LangGraph supports cycles, conditional branching, parallel execution, and durable persistence — making it the go-to framework for production agentic systems.
Key features
- Stateful graphs — each node reads and writes to a shared typed state object
- Cycles — agents can loop, retry, and re-plan — not just run top-to-bottom
- Human-in-the-loop — pause execution at any node and resume after human review
- Persistence — checkpoint state to SQLite, Postgres, or Redis for fault tolerance
- Multi-agent — route messages between specialized sub-graphs (supervisor, swarm patterns)
- LangGraph Platform — hosted deployment with streaming, webhooks, and a Studio debugger
Quick start
npx ai-supply add langgraph-stateful-agent-workflows
# Or install directly
pip install langgraph langchain-anthropic
from typing import TypedDict
from langgraph.graph import StateGraph, END
from langchain_anthropic import ChatAnthropic
class State(TypedDict):
messages: list
llm = ChatAnthropic(model="claude-opus-4-5")
def call_model(state: State):
response = llm.invoke(state["messages"])
return {"messages": state["messages"] + [response]}
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!"}]})
print(result["messages"][-1].content)
Curated mirror of the open-source LangGraph project (MIT). Install upstream from the repository.
Compromise signals — malicious or tampered code (leaked secrets, backdoors, a dropped executable) — reduce the score, and known dependency CVEs carry a bounded penalty (they warrant review but never QUARANTINE — update the dependency to clear). Other dangerous-by-capability traits are risk surface, expected for some capabilities. Every finding is mapped to its OWASP control below.
Findings mapped to the OWASP Top 10 for LLM Applications (2025) and the OWASP Machine Learning Security Top 10. Expand any flagged control for the exact findings — compromise reduces the score; expected/risk-surface do not, except a known CVE, which carries a small bounded penalty (high/critical → Review).
The same gate an agent runs before installing (POST /api/v1/trust/langgraph-stateful-agent-workflows/check). Click a policy:
Consume LangGraph programmatically. Authenticate with an API key or session — see Authorize an agent.
# Agents: CHECK BEFORE YOU INSTALL (no auth) — score, grade, level, capability manifest
curl https://ai-supply.store/api/v1/trust/langgraph-stateful-agent-workflows
# Gate against your org policy (returns { pass, violations })
curl -X POST https://ai-supply.store/api/v1/trust/langgraph-stateful-agent-workflows/check \
-H "Content-Type: application/json" \
-d '{"minGrade":"B","denyPermissions":["shell"],"denyUnknownEgress":true}'
# CLI
npx ai-supply add langgraph-stateful-agent-workflows
# REST (install → download)
curl -X POST https://ai-supply.store/api/v1/listings/langgraph-stateful-agent-workflows/install \
-H "Authorization: Bearer $AIM_KEY"
# MCP tool
install_listing({ "slug": "langgraph-stateful-agent-workflows" })OpenAPI spec →Curated mirror — latest upstream source. See the repository for tagged releases.