LangGraph.js API Reference
    Preparing search index...

    Type Alias CreateSwarmParams<AnnotationRootT, AgentAnnotationRootT>

    type CreateSwarmParams<
        AnnotationRootT extends AnnotationRoot<any> = typeof SwarmState,
        AgentAnnotationRootT extends
            AnnotationRoot<any> = typeof MessagesAnnotation,
    > = {
        agents: CompiledStateGraph<
            AgentAnnotationRootT["State"],
            AgentAnnotationRootT["Update"],
            string,
            AgentAnnotationRootT["spec"],
            AgentAnnotationRootT["spec"],
        >[];
        defaultActiveAgent: string;
        stateSchema?: AnnotationRootT;
    }

    Type Parameters

    • AnnotationRootT extends AnnotationRoot<any> = typeof SwarmState
    • AgentAnnotationRootT extends AnnotationRoot<any> = typeof MessagesAnnotation
    Index

    Properties

    agents: CompiledStateGraph<
        AgentAnnotationRootT["State"],
        AgentAnnotationRootT["Update"],
        string,
        AgentAnnotationRootT["spec"],
        AgentAnnotationRootT["spec"],
    >[]

    List of agents to add to the swarm

    defaultActiveAgent: string

    Name of the agent to route to by default (if no agents are currently active)

    stateSchema?: AnnotationRootT

    State schema to use for the multi-agent graph