Skip to main content
Build a team of agents that work together - each specializing in one task for better results.

What We’ll Build

A content creation team with 3 agents:

Researcher

Finds information

Writer

Creates content

Editor

Polishes the result

Step-by-Step Guide

1

Create the Agents

from praisonaiagents import Agent, AgentTeam

# Agent 1: Researcher
researcher = Agent(
    name="Researcher",
    instructions="Research topics thoroughly and provide key facts",
    web=True  # Can search the web
)

# Agent 2: Writer
writer = Agent(
    name="Writer",
    instructions="Write engaging content based on research"
)

# Agent 3: Editor
editor = Agent(
    name="Editor",
    instructions="Polish content for clarity and grammar"
)
2

Create the Team

# Combine agents into a team
team = AgentTeam(
    agents=[researcher, writer, editor],
    process="sequential"  # One after another
)
3

Run the Team

result = team.start("Create a blog post about the benefits of exercise")
print(result)

Complete Example

from praisonaiagents import Agent, AgentTeam

# Create specialized agents
researcher = Agent(
    name="Researcher",
    instructions="""You research topics thoroughly.
    - Find key facts and statistics
    - Identify main points
    - Organize information clearly""",
    web=True
)

writer = Agent(
    name="Writer",
    instructions="""You write engaging content.
    - Use research provided
    - Write clear, readable text
    - Include introduction and conclusion"""
)

editor = Agent(
    name="Editor",
    instructions="""You polish and improve content.
    - Fix grammar and spelling
    - Improve clarity and flow
    - Ensure consistent tone"""
)

# Create the team
team = AgentTeam(
    agents=[researcher, writer, editor],
    process="sequential"
)

# Run the team
result = team.start("Create a blog post about renewable energy")
print(result)

How It Works

StepAgentWhat Happens
1ResearcherGathers information on the topic
2WriterCreates content from research
3EditorPolishes the final result

Different Team Patterns

Parallel Team

All agents work at the same time:
team = AgentTeam(
    agents=[analyst1, analyst2, analyst3],
    process="parallel"
)

Hierarchical Team

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 Practices

Each agent should have one specific job
Keep agent instructions focused and clear
Don’t overcomplicate - add more only when needed
Make sure each agent works alone before combining

Next: Building Conversational Agents

Learn how to create agents that remember conversations.