Skip to content
Agent Orchestration
Skill

/langgraph-agent-patterns

Implement multi-agent coordination patterns (supervisor-subagent, router, orchestrator-worker, handoffs) for LangGraph applications. Use when users want to (1) implement multi-agent systems, (2) coordinate multiple specialized agents, (3) choose between coordination patterns,

From plugin
langchain-agent-skills
10610 skills

Claude Code

$ npx -y skills add soba-labs/langchain-agent-skills --skill langgraph-agent-patterns --agent claude-code

SKILL.md

langgraph-agent-patterns.SKILL.md
name: langgraph-agent-patterns
description: Implement multi-agent coordination patterns (supervisor-subagent, router, orchestrator-worker, handoffs) for LangGraph applications. Use when users want to (1) implement multi-agent systems, (2) coordinate multiple specialized agents, (3) choose between coordination patterns, (4) set up supervisor-subagent workflows, (5) implement router-based agent selection, (6) create parallel orchestrator-worker patterns, (7) implement agent handoffs, (8) design state schemas for multi-agent systems, or (9) debug multi-agent coordination issues.

LangGraph Agent Patterns

Implement and configure multi-agent coordination patterns for LangGraph applications.

Pattern Selection

Choose the right pattern based on your coordination needs:

| Pattern | Best For | When to Use | |---------|----------|-------------| | **Supervisor** | Complex workflows, dynamic routing | Agents need to collaborate, routing is context-dependent | | **Router** | Simple categorization, independent tasks | One-time routing, deterministic decisions | | **Orchestrator-Worker** | Parallel execution, high throughput | Independent subtasks, results need aggregation | | **Handoffs** | Sequential workflows, context preservation | Clear sequence, each agent builds on previous |

**Quick Decision:**

  • **Dynamic routing needed?** → Supervisor
  • **Tasks can run in parallel?** → Orchestrator-Worker
  • **Simple categorization?** → Router
  • **Linear sequence?** → Handoffs

For detailed comparison: See references/pattern-comparison.md

Pattern Implementation Guides

Supervisor-Subagent Pattern

**Overview:** Central coordinator delegates to specialized subagents based on context.

**Quick Start:**

# Generate supervisor graph boilerplate
uv run scripts/generate_supervisor_graph.py my-team \
  --subagents "researcher,writer,reviewer"

# TypeScript
uv run scripts/generate_supervisor_graph.py my-team \
  --subagents "researcher,writer,reviewer" \
  --typescript

**Key Components:** 1. **State with routing**: `next` field for routing decisions 2. **Supervisor node**: Makes routing decisions based on context 3. **Subagent nodes**: Specialized agents with distinct capabilities 4. **Conditional edges**: Route from supervisor to subagents

**Example Flow:**

User Request → Supervisor → Researcher → Supervisor → Writer → Supervisor → FINISH

**For complete implementation:** See references/supervisor-subagent.md

Router Pattern

**Overview:** One-time routing to specialized agents based on initial request.

**Key Components:** 1. **State with route**: Single routing decision field 2. **Router node**: Categorizes request (keyword, LLM, or semantic) 3. **Specialized agents**: Independent agents for each category 4. **Conditional routing**: Route to agent, then END

**Example Flow:**

User Request → Router → Sales Agent → END
                   ├→ Support Agent → END
                   └→ Billing Agent → END

**Routing Strategies:**

  • **Keyword-based**: Fast, simple string matching
  • **LLM-based**: Semantic understanding, flexible
  • **Embedding-based**: Similarity matching
  • **Model-based**: Fine-tuned classifier

**For complete implementation:** See references/router-pattern.md

Orchestrator-Worker Pattern

**Overview:** Decompose task into parallel subtasks, aggregate results.

**Key Components:** 1. **State with subtasks**: Task decomposition and results accumulation 2. **Orchestrator node**: Splits task into independent subtasks 3. **Worker nodes**: Process subtasks in parallel 4. **Aggregator node**: Synthesizes results 5. **Send fan-out**: Return `Send(...)` objects from conditional edges and use a list reducer (for example `Annotated[list[dict], operator.add]`) so worker outputs accumulate

**Example Flow:**

Task → Orchestrator → Worker 1 ┐
                  → Worker 2  ├→ Aggregator → Result
                  → Worker 3 ┘

**Best Practices:**

  • Ensure subtasks are independent
  • Handle worker failures gracefully
  • Limit concurrent workers for resource management
  • Use LLM for result synthesis

**For complete implementation:** See references/orchestrator-worker.md

Handoffs Pattern

**Overview:** Sequential agent handoffs with context preservation.

**Key Components:** 1. **State with context**: Shared context across handoffs 2. **Agent nodes**: Each agent hands off to next 3. **Handoff logic**: Explicit or conditional handoffs 4. **Context management**: Preserve and pass information

**Example Flow:**

Request → Researcher → Writer → Editor → FINISH
         (with context preservation)

**Handoff Strategies:**

  • **Explicit**: Agent declares next agent
  • **Conditional**: Based on completion criteria
  • **Circular**: Agents can hand back for revisions

**For complete implementation:** See references/handoffs.md

Examples

Runnable mini-projects (Python + JavaScript):

  • `assets/examples/supervisor-example/`
  • `assets/examples/router-example/`
  • `assets/examples/orchestrator-example/`
  • `assets/examples/handoff-example/`

State Design for Multi-Agent Patterns

Each pattern requires specific state schema design:

**Supervisor Pattern:**

class SupervisorState(TypedDict):
    messages: Annotated[list[BaseMessage], add_messages]
    next: Literal["agent1", "agent2", "FINISH"]
    current_agent: str

**Router Pattern:**

class RouterState(TypedDict):
    messages: list[BaseMessage]
    route: Literal["category1", "category2"]

**Orchestrator-Worker:**

import operator
class OrchestratorState(TypedDict):
    task: str
    subtasks: list[dict]
    results: Annotated[list[dict], operator.add]

**Handoffs:**

class HandoffState(TypedDict):
    messages: Annotated[list[BaseMessage], add_messages]
    next_agent: str
    context: dict

**For detailed state patterns:** See references/state-management-patterns.md

Validation and Visualization

Validate Graph Structure

# Validate
Read more
@soba-labs
Ships withlangchain-agent-skills

A comprehensive collection of agent-optimized skills for AI coding assistants working in the LangChain ecosystem.

Stars on GitHub

Momentum

stars in total
106
Star history of soba-labs/langchain-agent-skills on GitHub, a chart by star-history.com

Other skills on langchain-agent-skills.

More skills from other plugins.

1password

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

openclaw3d395k
@steipete@steipeteInstall Skill
jira-tickets

jira-tickets

Read and update Jira tickets through Orca's saved Jira connections. Use when a task comes from Jira or the user asks for Jira…

orca1d128k
@stablyai@stablyaiInstall Skill
agentmail

agentmail

Use your assigned AgentMail inbox to read email tasks, explicitly send or reply, and check delivery. Provided automatically by…

paperclip2d114k
@paperclipai@paperclipaiInstall Skill
adr-create

adr-create

Create a new Architecture Decision Record with sequential numbering and AgentDB registration

@ruvnet@ruvnetInstall Skill

Questions about langgraph-agent-patterns.

Which coding agents can use langgraph-agent-patterns?
langgraph-agent-patterns installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.