Process defines how agents work together - the order, flow, and coordination of tasks.
Quick Start
from praisonaiagents import Agent, AgentTeam
researcher = Agent(instructions="Research the topic")
writer = Agent(instructions="Write the content")
team = AgentTeam(
agents=[researcher, writer],
process="sequential" # Options: sequential, parallel, hierarchical
)
team.start()
Process Types
Sequential
Agents work one after another:
team = AgentTeam(
agents=[researcher, analyst, writer],
process="sequential"
)
Best for: Tasks with clear stages where each step depends on the previous one.
Parallel
Agents work at the same time:
team = AgentTeam(
agents=[agent1, agent2, agent3],
process="parallel"
)
Best for: Independent tasks that can run simultaneously.
Hierarchical
A manager coordinates workers:
manager = Agent(instructions="Coordinate the team")
worker1 = Agent(instructions="Handle research")
worker2 = Agent(instructions="Handle writing")
team = AgentTeam(
agents=[manager, worker1, worker2],
process="hierarchical"
)
Best for: Complex tasks requiring coordination and decision-making.
Complete Example
from praisonaiagents import Agent, AgentTeam
# Create specialized agents
researcher = Agent(
name="Researcher",
instructions="Research topics and gather facts",
web=True
)
analyst = Agent(
name="Analyst",
instructions="Analyze data and find insights"
)
writer = Agent(
name="Writer",
instructions="Write clear, engaging content"
)
# Sequential process - research → analyze → write
team = AgentTeam(
agents=[researcher, analyst, writer],
process="sequential",
verbose=True # See what's happening
)
result = team.start("Create a report on AI trends")
Choosing a Process
| Process | When to Use | Example |
|---|
| Sequential | Steps depend on each other | Research → Write → Edit |
| Parallel | Independent tasks | Analyze 3 different topics |
| Hierarchical | Need coordination | Manager assigns tasks |
Best Practices
Start Sequential
Easiest to understand and debug
Clear Roles
Each agent has one specific job
Enable Verbose
Use verbose=True to see progress
Test Individually
Test each agent before combining
Next: Knowledge Bases
Learn how to give agents access to documents and data.