This package is currently under active development and has no public API yet. The functionality described here represents planned features.
Overview
The @deepagents/orchestrator package will provide high-level patterns and utilities for orchestrating complex multi-agent workflows. It will build on top of @deepagents/agent to offer pre-configured agent architectures for common use cases.
Current Status
The package is published on npm but currently contains only internal implementations with no public exports. The API is being actively developed.
Installation
npm install @deepagents/orchestrator
Dependencies:
@deepagents/agent
@deepagents/context
@deepagents/retrieval
@deepagents/toolbox
@ai-sdk/openai
@ai-sdk/groq
Using Multi-Agent Patterns Today
While @deepagents/orchestrator is under development, you can build orchestration patterns using @deepagents/agent directly:
Coordinator Pattern
Create a coordinator agent that delegates to specialists:
import { agent , instructions , swarm } from '@deepagents/agent' ;
import { openai } from '@ai-sdk/openai' ;
const researcher = agent ({
name: 'researcher' ,
model: openai ( 'gpt-4o' ),
prompt: 'You research topics and provide detailed information.' ,
handoffDescription: 'Handles research and fact-finding tasks' ,
});
const analyst = agent ({
name: 'analyst' ,
model: openai ( 'gpt-4o' ),
prompt: 'You analyze data and provide insights.' ,
handoffDescription: 'Handles data analysis tasks' ,
});
const writer = agent ({
name: 'writer' ,
model: openai ( 'gpt-4o' ),
prompt: 'You write clear, engaging content.' ,
handoffDescription: 'Handles writing and content creation' ,
});
const coordinator = agent ({
name: 'coordinator' ,
model: openai ( 'gpt-4o' ),
prompt: instructions ({
purpose: [ 'Coordinate research, analysis, and writing tasks' ],
routine: [
'Analyze the request' ,
'Use transfer_to_researcher for fact-finding' ,
'Use transfer_to_analyst for data analysis' ,
'Use transfer_to_writer for content creation' ,
],
}),
handoffs: [ researcher , analyst , writer ],
});
// Execute coordinated workflow
const stream = swarm ( coordinator , 'Create a market analysis report' , {});
Sequential Pipeline
Process tasks through multiple agents sequentially:
import { agent , execute } from '@deepagents/agent' ;
import { openai } from '@ai-sdk/openai' ;
async function pipeline ( input : string , context : any ) {
// Stage 1: Data collection
const collector = agent ({
name: 'collector' ,
model: openai ( 'gpt-4o' ),
prompt: 'Extract key data points from the input.' ,
});
const stage1 = await execute ( collector , input , context );
const data = await stage1 . text ;
// Stage 2: Analysis
const analyzer = agent ({
name: 'analyzer' ,
model: openai ( 'gpt-4o' ),
prompt: 'Analyze the data and identify patterns.' ,
});
const stage2 = await execute ( analyzer , data , context );
const analysis = await stage2 . text ;
// Stage 3: Report generation
const reporter = agent ({
name: 'reporter' ,
model: openai ( 'gpt-4o' ),
prompt: 'Generate a comprehensive report.' ,
});
const stage3 = await execute ( reporter , analysis , context );
return await stage3 . text ;
}
const result = await pipeline ( 'Raw input data' , {});
Parallel Execution
Run multiple agents concurrently and aggregate results:
import { agent , execute } from '@deepagents/agent' ;
import { openai } from '@ai-sdk/openai' ;
async function parallelAnalysis ( topic : string ) {
const agents = [
agent ({
name: 'technical' ,
model: openai ( 'gpt-4o' ),
prompt: 'Analyze technical aspects.' ,
}),
agent ({
name: 'business' ,
model: openai ( 'gpt-4o' ),
prompt: 'Analyze business implications.' ,
}),
agent ({
name: 'competitive' ,
model: openai ( 'gpt-4o' ),
prompt: 'Analyze competitive landscape.' ,
}),
];
// Run all analyses in parallel
const results = await Promise . all (
agents . map ( agent =>
execute ( agent , topic , {}). then ( r => r . text )
)
);
// Aggregate results
const synthesizer = agent ({
name: 'synthesizer' ,
model: openai ( 'gpt-4o' ),
prompt: 'Synthesize multiple analyses into a cohesive report.' ,
});
const combined = results . join ( ' \n\n --- \n\n ' );
const final = await execute ( synthesizer , combined , {});
return await final . text ;
}
const report = await parallelAnalysis ( 'AI agent frameworks' );
Planned Features
The @deepagents/orchestrator package will eventually provide:
Workflow patterns Pre-built orchestration patterns for common use cases
State management Persistent workflow state and checkpointing
Error handling Retry mechanisms, fallbacks, and circuit breakers
Monitoring Built-in metrics and event tracking
Internal Implementations
The package currently contains internal implementations for:
DeepPlan - Planning and execution framework
DeepResearch - Research coordination agents
DeepWiki - Wiki generation workflows
ArXiv integration - Academic paper search and analysis
These are not yet exposed as public APIs.
Contributing
If you’re interested in contributing to the orchestrator package or have use cases you’d like to see supported, please open an issue on GitHub.
Package Info
@deepagents/agent Core agent framework with handoffs
@deepagents/context Context management and persistence
@deepagents/toolbox Pre-built tools for agents