Standalone open-source multi-agent orchestration with LangGraph executors and pluggable adapters.
auto-agents gives you a reusable runtime for:
- meta-planning (
MetaPlanner) - dependency-aware parallel agent execution (
MultiAgentOrchestrator+LangGraphAgentExecutor) - swappable persistence (
ThreadStore) - swappable event streaming (
AgentEventBus) - swappable tools/model/prompt providers
No host-app imports, no framework lock-in.
npm install auto-agents @langchain/langgraph @langchain/core zod
# optional default Anthropic integrations
npm install @langchain/anthropicCreate quickstart.mjs:
import{AIMessage}from'@langchain/core/messages';import{InMemoryAgentEventBus,InMemoryThreadStore,MultiAgentOrchestrator,StaticMetaPlanner,}from'auto-agents';constthreadStore=newInMemoryThreadStore();consteventBus=newInMemoryAgentEventBus();constmodelProvider={asyncgetModel(){return{asyncinvoke(){returnnewAIMessage({content: 'COMPLETE: local runtime success'});},};},};consttoolProvider={asyncgetTools(){return[];},};constpromptProvider={asyncgetSystemPrompt(ctx){return`You are ${ctx.agent.name}. Finish your assigned task.`;},};constorchestrator=newMultiAgentOrchestrator({
threadStore,
eventBus,metaPlanner: newStaticMetaPlanner(),
modelProvider,
toolProvider,
promptProvider,});constresult=awaitorchestrator.run({request: 'Draft a launch checklist for an internal tool migration.',});console.log('thread:',result.threadId);console.log('success:',result.success);console.log('output:',result.output);console.log('events:',result.events.length);Run it:
node quickstart.mjsUse StaticMetaPlanner, which creates a local team (analyst -> implementer -> manager) and runs with dependency ordering by default.
You can replace planner and wiring incrementally:
import{JsonSchemaMetaPlanner,MultiAgentOrchestrator,InMemoryThreadStore,InMemoryAgentEventBus,}from'auto-agents';constplanner=newJsonSchemaMetaPlanner(yourModel);constorchestrator=newMultiAgentOrchestrator({threadStore: newInMemoryThreadStore(),eventBus: newInMemoryAgentEventBus(),metaPlanner: planner,
modelProvider,
toolProvider,
promptProvider,});constthreadStore={createThread: asyncinput=>({id: input.id??crypto.randomUUID(),status: 'initializing',request: input.request,createdAt: newDate().toISOString(),updatedAt: newDate().toISOString(),}),getThread: asyncthreadId=>null,updateThreadStatus: async(threadId,status)=>{},saveTeamPlan: async(threadId,plan)=>{},getTeamPlan: asyncthreadId=>null,upsertAgentStatus: asyncstatus=>{},getAgentStatus: async(threadId,agentId)=>null,saveAgentOutput: asyncoutput=>{},getAgentOutputs: asyncthreadId=>newMap(),};consteventBus={append: asyncevent=>{},list: asyncthreadId=>[],};constmetaPlanner={plan: async({ threadId, request })=>({estimatedComplexity: 'simple',workflow: 'single agent then manager',agents: [{id: 'manager',name: 'manager',role: 'final answer',kind: 'chat',dependencies: [],toolNames: [],tasks: ['Answer user request'],},],}),};- package code has no host app imports (
@/, app routes, app aliases) - all infra connections pass through ports (
ThreadStore,AgentEventBus,MetaPlanner) - swap tests run same orchestrator with different adapters
- boundary checks run in CI before publish
ANTHROPIC_API_KEY is required: set env var before using model-backed planner helpers.- agent stuck in dependencies: ensure dependency IDs match
AgentSpec.idexactly. - no tools called: verify tool names in
AgentSpec.toolNamesand registration intoolProvider. - empty output: ensure model responses include content and completion strategy can terminate.
MIT