// Research worker
const researchWorker = new WorkerAgent({
name: 'Research Assistant',
description: 'Expert in information gathering and analysis',
provider: {
type: 'gemini',
apiKey: process.env.GEMINI_API_KEY!,
model: 'gemini-pro',
temperature: 0.3,
},
systemPrompt: `You are a research expert. Gather and synthesize information from multiple sources.
Always cite your sources and provide balanced analysis.`,
tools: [
{
name: 'web_search',
description: 'Search the web for information',
parameters: z.object({
query: z.string(),
limit: z.number().min(1).max(20).default(10),
}),
},
{
name: 'analyze_sources',
description: 'Analyze credibility and relevance of sources',
parameters: z.object({
sources: z.array(z.string()),
}),
},
],
});
// Content writer
const writerWorker = new WorkerAgent({
name: 'Content Writer',
description: 'Professional writer specializing in technical content',
provider: {
type: 'anthropic',
apiKey: process.env.ANTHROPIC_API_KEY!,
model: 'claude-3-haiku-20240307',
temperature: 0.7,
},
systemPrompt: `You are a professional technical writer. Create clear, engaging content.
Use appropriate technical language and provide examples where helpful.`,
tools: [
{
name: 'write_article',
description: 'Write an article on a technical topic',
parameters: z.object({
topic: z.string(),
audience: z.enum(['beginner', 'intermediate', 'expert']).default('intermediate'),
outline: z.array(z.string()).optional(),
}),
},
{
name: 'edit_content',
description: 'Edit and improve technical content',
parameters: z.object({
content: z.string(),
improvements: z.array(z.string()),
}),
},
],
});