Skip to content
masterclass Buddy

AI Agents · Concept

Swarm

@langchain/langgraph-swarm builds swarm-style multi-agent workflows. Agents hand off control to specialized agents, while persisted state can retain the active agent and conversation across turns.

Last updated

Syntax

createSwarm({ agents, defaultActiveAgent })

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • createSwarm
  • createHandoffTool
  • addActiveAgentRouter
  • getHandoffDestinations
  • SwarmState
  • METADATA_KEY_HANDOFF_DESTINATION
  • MemorySaver
  • InMemoryStore

Source: @langchain/langgraph-swarm | LangGraph.js API Reference. Checked 2026-11-03.