---
name: "langgraph-stateful-agent-graphs"
description: "Build complex cyclical, stateful multi-agent workflows with LangGraph state graphs."
metadata:
  author: "LangChain"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "create langgraph stategraph"
  - "add conditional edges langgraph"
  - "persist langgraph state checkpointer"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# LangGraph Stateful Multi-Agent Graphs

Orchestrates multi-agent systems using LangGraph: StateGraph, TypedDict schemas, conditional edges, cycle loops, checkpoint persistence (SqliteSaver, PostgresSaver), and node state reducers.

## When to Invoke
Invoke this skill whenever you need to:
- create langgraph stategraph
- add conditional edges langgraph
- persist langgraph state checkpointer

## Execution SOP & Rules
1. Define clear state schemas using TypedDict with Annotated reducers (e.g. operator.add for messages).
2. Add nodes using graph.add_node(name, fn) and define standard entry and end edges.
3. Use graph.add_conditional_edges() to dynamically route based on state values or tool calls.
4. Compile graphs with checkpointer: app = workflow.compile(checkpointer=checkpointer).

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
