langgraph
Skill172 starsChanged 4 months agoMITView on GitHub
Build multi-agent AI systems with LangGraph — the low-level orchestration framework for stateful, graph-based agent workflows. Covers supervisor, swarm, and hierarchical multi-agent patterns; subgraph composition; state management (checkpointers/stores); persistence; evals; and production debugging. Reach for this when designing agent architectures that need cycles, conditional branching, parallel execution, or human-in-the-loop patterns. Do not use this skill for unrelated requests; route to the nearest named specialist.
- Installs packages
10 other projects use a version of this.
Adopted by
Most recently taken up by
- xfstudio/skillstheir own version, first seen Oct 13, 2026
- langchain-ai/docstheir own version, first seen Oct 13, 2026
- kid-sid/claude-spellbooktheir own version, first seen Oct 9, 2026
- Ghosteken/agent-harnesstheir own version, first seen Oct 1, 2026
- smit-faldu/cloudedashtheir own version, first seen Jun 24, 2026
- pauloribeiro16/my-skillstheir own version, first seen May 28, 2026
Used with
Projects with it also use gcp-cloud-run, mcp-builder and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
xfstudioSkillgcp-cloud-run
Specialized skill for building production-ready serverless applications on GCP. Covers Cloud Run services (containerized), Cloud Run Functions (event-driven), cold start optimization, and event-driven architecture with Pub/Sub.
Also in 3 projects that use this
MicrosoftSkillmcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
Also in 3 projects that use this
SentrySkillskill-creator
Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.
Also in 3 projects that use this
Other versions10 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 10
- langchain-ai/docs★ 445same name
- kid-sid/claude-spellbook★ 190same name
- Fandry96/k3-agentic-skills★ 27same name
- xfstudio/skills★ 9same name
- ai4brands-design/claude-skills★ 2same name
- bcastelino/agent-skills-kit★ 2same name
- Ghosteken/agent-harness★ 2same name
- jcsaaddupuy/badrobots★ 1same name
- pauloribeiro16/my-skills★ 1same name
- smit-faldu/cloudedash★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository192 other files it gives its agents.
- agent-production-operations/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- forward-deployed-engineering/AGENTS.mdAGENTS.md
- production-excellence/AGENTS.mdAGENTS.md
- product-lifecycle/AGENTS.mdAGENTS.md
- tailscale/AGENTS.mdAGENTS.md
- workflow-architect/AGENTS.mdAGENTS.md
- llms.txtllms.txt
- actuarial-risk-modelingSkill
- adr-authoringSkill
- agent-councilSkill
- agent-evals-and-observabilitySkill
- agent-production-operationsSkill
- agent-skillsSkill
- ai-governanceSkill
- ai-operating-economicsSkill
- amazon-memoSkill
- analog-occultismSkill
- anydocSkill
- api-design-and-evolutionSkill
- artifact-pyramidsSkill
- ascii-city-engineSkill
- autogenSkill
- backend-engineeringSkill
- binary-analysisSkill
- bmadSkill
- brand-designerSkill
- c4-diagrammingSkill
- camera-hackingSkill
- capacity-and-cost-engineeringSkill
- chief-of-staff-methodologySkill
- cli-builderSkill
- cncf-landscapeSkill
- code-reviewSkill
- color-managementSkill
- community-guidesSkill
- conditional-customer-successSkill
- confluence-cliSkill
- constrained-optimizationSkill
- crewaiSkill
- crmSkill
- crowdsecSkill
- cryptpadSkill
- cyberpunkSkill
- daily-life-discoverySkill
- data-architectSkill
- data-cleaningSkill
- data-engineeringSkill
- data-scientistSkill
- de-spinSkill
- digital-twinSkill
- docker-composeSkill
- documentsSkill
- dsm5Skill
- dspySkill
- electronicsSkill
- emailSkill
- enterprise-architectureSkill
- epubSkill
- esp32-developmentSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 31
Create your first LangGraph agent in under 10 lines:
- Distinctive: line 49
Use the Pattern Selection Guide below to choose supervisor, swarm, or hierarchical architecture — each pattern links to its recommended …
- Distinctive: line 51
Use the Choosing Your Starting Point table below to pick scaffold, template, or reference based on your task
“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
LangGraph
LangGraph is LangChain's low-level orchestration framework for building stateful, long-running, multi-agent AI workflows using directed graph architectures (inspired by Pregel/Beam and NetworkX). It models agents as nodes in a graph, with edges controlling flow — enabling cycles, conditional branching, parallel execution, human-in-the-loop, and subgraph composition that linear chains cannot express.
This skill covers all major patterns for building and deploying LangGraph systems: core graph architecture, the three canonical multi-agent patterns (supervisor, swarm, hierarchical), persistence and state management, production debugging, and evaluation methodology.
Before you begin: Install dependencies:
pip install langgraph langchain langchain-openai langsmith
Quick Start
Create your first LangGraph agent in under 10 lines:
from langgraph.graph import StateGraph, MessagesState, START, END
def hello_agent(state: MessagesState):
return {"messages": [{"role": "ai", "content": "Hello, world!"}]}
graph = StateGraph(MessagesState)
graph.add_node("agent", hello_agent)
graph.add_edge(START, "agent")
graph.add_edge("agent", END)
graph = graph.compile()
graph.invoke({"messages": [{"role": "user", "content": "hi!"}]})Next steps:
- Use the Pattern Selection Guide below to choose supervisor, swarm, or hierarchical architecture — each pattern links to its recommended template
- Load the corresponding reference file for the deep pattern walkthrough
- Use the Choosing Your Starting Point table below to pick scaffold, template, or reference based on your task
- For a complete runnable example matching your pattern, use the linked template in assets/templates/
Design Principles — These Govern Every Graph Decision
- State is the source of truth — all inter-node communication happens through state, not through side channels or global variables.
- Nodes are pure-ish — a node receives state, does work, returns updates. It should not depend on state that isn't passed to it.
- Reducers prevent conflicts — any state key written by multiple nodes in parallel MUST have a reducer.
- Start simple — a single agent with good prompts beats a multi-agent system with bad routing. Add agents only when a single prompt or toolset becomes unwieldy.
- Use
Send()for dynamic fan-out — when you don't know how many workers you'll need at compile time, spawn them dynamically from the orchestrator node.- Subgraph state isolation — subgraphs with different state schemas need a wrapper function to transform state at the boundary. Shared-schema subgraphs can be added directly as nodes.
When to Reach For This
| Context | What to load |
| Building a new LangGraph workflow from scratch | references/architecture.md — core concepts first |
| Designing a multi-agent routing system | references/multi-agent-supervisor.md or references/multi-agent-swarm.md — compare patterns |
| Composing nested agent teams | references/multi-agent-hierarchical.md — subgraph composition |
| Adding persistence, interrupts, or long-term memory | references/persistence.md — checkpointers and stores |
| Deploying to production or debugging failures | references/production.md — deployment, observability, failure modes |
| Setting up eval pipelines for routing accuracy | references/evals.md — evaluation methodology |
| Diagnosing a specific failure (loop, context loss, crash) | references/troubleshooting.md — known failure modes |
| Placing a typed System One judgment in a graph | references/architecture.md; decision contract and calibration in System One, workflow authority and whole-task evidence in harness-engineering |
Pattern Selection Guide
| Your constraint | Prefer | Why | |
| Routing accuracy > latency | Supervisor | Centralized routing node, focused prompt: ~94% accuracy | assets/templates/supervisor-graph.py |
| Latency is primary constraint | Swarm | Direct agent-to-agent handoffs, ~40% fewer LLM calls | assets/templates/swarm-graph.py |
| Clear domain boundaries | Swarm | Agents rarely misroute, handoffs are crisp | assets/templates/swarm-graph.py |
| Ambiguous domain boundaries | Supervisor | Overlapping concerns resolved by dedicated router | assets/templates/supervisor-graph.py |
| < 3 distinct domains | Skip multi-agent | A specialized single agent is simpler | references/architecture.md |
| Multi-domain requests common | Swarm | Latency savings compound across handoffs | assets/templates/swarm-graph.py |
| Need centralized audit trail | Supervisor | Every routing decision visible in traces | assets/templates/supervisor-graph.py |
| Nested team structures | Hierarchical | Subgraphs as nodes, each team self-contained | assets/templates/subgraph-agent.py |
Choosing Your Starting Point
| Your goal | Start with | Why |
| Build a project from scratch, need generated code | scripts/lg-supervisor-scaffold.py or scripts/lg-swarm-scaffold.py | Scaffolds generate complete project structure (state.py, agents.py, graph.py) with placeholders to fill in |
| Understand a complete, working example | assets/templates/ matching your chosen pattern | Templates are self-contained runnable files with all patterns wired — best for learning by reading |
| Deep dive into a pattern's internals | Corresponding reference in references/ | References explain tradeoffs, failure modes, and design rationale — best for customization |
| Debug or optimize an existing system | references/production.md or references/troubleshooting.md | Production reference covers deployment + observability; troubleshooting reference covers symptom→fix tables |
Core Primitives
LangGraph uses two APIs:
| API | When to use | Pattern |
Graph API (StateGraph) | Full control over graph structure, conditional edges, subgraphs | add_node() + add_edge()/add_conditional_edges() |
Functional API (@task + @entrypoint) | Simpler linear workflows, less boilerplate | Decorator-based, Pythonic |
Both APIs produce the same compiled graph — choose based on how much control you need.
Key Gotchas
- Subgraph persistence defaults to per-invocation — each subgraph call starts fresh. Set
checkpointer=Truefor per-thread memory,checkpointer=Falsefor fully stateless. - Per-thread subgraphs cannot run in parallel — same-namespace checkpoint conflicts. Use
ToolCallLimitMiddlewareor disable parallel tool calls. - The supervisor bottleneck — every interaction requires a routing LLM call, even for obvious intents. Add a fast-path classifier (keyword matching or small model) for unambiguous requests.
- Swarm ping-pong — no natural recursion guard. Track
handoff_countin state and hard-limit at 3, then escalate to human or fallback agent. - Lost messages on handoff —
Command.updatemust include paired messages from the specialist's tool-calling loop, or the next agent sees malformed history. - State access from parent to subgraph — subgraphs manage their own checkpoint namespace. Use Store for cross-graph-boundary data.
- Checkpoint bloat — long conversations accumulate checkpoints. Prune periodically or set retention policies on DB-backed checkpointers.
- No auto-load-on-install — skills aren't auto-discovered at session start by name mention. The agent must explicitly call
skill_view(name='langgraph')to load this skill.
Reference Files
| File | Load when |
references/architecture.md | You need to understand LangGraph core concepts: graph structure, nodes, edges, state, the two APIs, and basic agent loop construction. Read this first if you're new to LangGraph. |
references/multi-agent-supervisor.md | You're designing a supervisor-based multi-agent system with a central routing node. Contains architecture, structured output routing, specialist wrappers, and full code examples. |
references/multi-agent-swarm.md | You're designing a swarm-based multi-agent system with direct agent-to-agent handoffs. Contains handoff tool patterns, Command-based routing, and comparative metrics vs supervisor. |
references/multi-agent-hierarchical.md | You're composing nested agent teams using subgraphs. Covers subgraph wiring (shared vs different state schemas), persistence modes, namespace isolation, and hierarchical team structures. |
references/persistence.md | You're adding checkpointer-based short-term memory or store-based long-term memory. Covers per-invocation vs per-thread vs stateless modes, checkpoint backends, and cross-thread memory patterns. |
references/production.md | You're deploying a LangGraph system to production. Covers Agent Server deployment, LangSmith observability, streaming patterns, and common production failure modes with fixes. |
references/evals.md | You're setting up evaluation pipelines for multi-agent systems. Covers routing accuracy, resolution coverage, LangSmith eval datasets, and LLM-as-judge evaluators. |
references/troubleshooting.md | You're debugging a specific LangGraph failure. Covers routing loops, context loss, checkpointer conflicts, token waste, and state inspection techniques. |
assets/templates/supervisor-graph.py | Runnable supervisor example with billing, tech support, and account specialists — fast-path classifier, structured output routing, audit trail, and recursion guard. |
assets/templates/swarm-graph.py | Runnable swarm example with triage agent plus 3 specialists — direct agent-to-agent handoffs via Command, recursion guard, and full traceability. |
assets/templates/subgraph-agent.py | Runnable subgraph composition examples — all 3 wiring patterns (different state schemas, shared state keys, per-thread with namespace isolation). |
Scripts
| Script | What it does |
scripts/lg-supervisor-scaffold.py | Generates a complete supervisor pattern project with state schema, routing agent, specialist nodes, and graph assembly |
scripts/lg-swarm-scaffold.py | Generates a complete swarm pattern project with handoff tools, triage agent, specialist agents, and conditional routing |
scripts/lg-eval-generator.py | Generates evaluation datasets and runs LangSmith evaluators for routing accuracy and resolution coverage |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

