Skip to main content
AgentTeam orchestrates multiple agents to work together on complex tasks.

Quick Start

1

Create Team

use praisonai::{Agent, AgentTeam, Process};

let team = AgentTeam::new()
    .agent(Agent::simple("Research topics thoroughly")?)
    .agent(Agent::simple("Write engaging content")?)
    .agent(Agent::simple("Edit for clarity")?)
    .process(Process::Sequential)
    .build();
2

Run Team

let result = team.start("Write about AI in healthcare").await?;
println!("{}", result);

Process Types

ProcessDescriptionUse Case
SequentialOne after anotherPipeline (research → write → edit)
ParallelAll at onceIndependent analysis
HierarchicalManager delegatesComplex coordination

Examples

Sequential Pipeline

use praisonai::{Agent, AgentTeam, Process};

let researcher = Agent::new()
    .name("researcher")
    .instructions("Find accurate information on topics")
    .build()?;

let writer = Agent::new()
    .name("writer")
    .instructions("Write clear, engaging articles")
    .build()?;

let editor = Agent::new()
    .name("editor")
    .instructions("Edit for grammar and clarity")
    .build()?;

let team = AgentTeam::new()
    .agent(researcher)
    .agent(writer)
    .agent(editor)
    .process(Process::Sequential)
    .build();

let article = team.start("Write about quantum computing").await?;

Parallel Analysis

use praisonai::{Agent, AgentTeam, Process};

let team = AgentTeam::new()
    .agent(Agent::simple("Analyze from technical perspective")?)
    .agent(Agent::simple("Analyze from business perspective")?)
    .agent(Agent::simple("Analyze from user perspective")?)
    .process(Process::Parallel)
    .build();

let analysis = team.start("Evaluate this product idea").await?;

Builder Methods

MethodTypeDescription
.agent(agent)AgentAdd an agent
.process(p)ProcessSet execution order
.verbose(bool)boolEnable logging
.build()-Create the team

Context Passing

In sequential mode, each agent receives the previous agent’s output:

Best Practices

Give each agent a focused role for better results.
Sequential agents should have complementary instructions.
Only use parallel when agents don’t depend on each other.