import { Agent, AgentTeam } from 'praisonai';const researcher = new Agent({ name: 'Researcher', instructions: 'Research the topic thoroughly'});const writer = new Agent({ name: 'Writer', instructions: 'Write based on research findings'});const team = new AgentTeam({ agents: [researcher, writer]});const results = await team.start();
import { Agent, AgentTeam } from 'praisonai';const agent1 = new Agent({ instructions: 'Analyze data' });const agent2 = new Agent({ instructions: 'Summarize analysis' });// Simple array syntaxconst team = new AgentTeam([agent1, agent2]);const results = await team.start();
Copy
const team = new AgentTeam({ agents: [researcher, analyst, writer], process: 'sequential'});// Research → Analysis → Writingconst results = await team.start();
Copy
const team = new AgentTeam({ agents: [sentimentAgent, summaryAgent, keywordsAgent], process: 'parallel', tasks: [ 'Analyze sentiment: "Great product!"', 'Summarize: "Great product!"', 'Extract keywords: "Great product!"' ]});// All run simultaneouslyconst [sentiment, summary, keywords] = await team.start();
Copy
const team = new AgentTeam({ agents: [agent1, agent2], tasks: [ 'Research the latest AI developments', 'Write a blog post based on the research' ]});const results = await team.start();
All old names work as silent aliases with no deprecation warnings.
Copy
// All of these are equivalentimport { AgentTeam, Agents, PraisonAIAgents } from 'praisonai';const team1 = new AgentTeam([agent1, agent2]);const team2 = new Agents([agent1, agent2]);const team3 = new PraisonAIAgents([agent1, agent2]);// They are the same classconsole.log(AgentTeam === Agents); // trueconsole.log(AgentTeam === PraisonAIAgents); // true