Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.praison.ai/llms.txt

Use this file to discover all available pages before exploring further.

Orchestrator Pattern

Like a project manager who assigns work to team members.

How It Works


Key Difference

AspectAgentFlowOrchestrator
Who decides?YouAI Manager
FlowFixed stepsDynamic
Token usageLowerHigher
Best forPredictable tasksComplex, unclear tasks

Code

from praisonaiagents import Agent, Task, AgentTeam

# Workers
researcher = Agent(name="Researcher", instructions="Research topics")
analyst = Agent(name="Analyst", instructions="Analyze data")
writer = Agent(name="Writer", instructions="Write content")

# The task
task = Task(
    description="Create a comprehensive report on AI trends",
    expected_output="A detailed report"
)

# Hierarchical team - manager decides who does what
team = AgentTeam(
    agents=[researcher, analyst, writer],
    tasks=[task],
    process="hierarchical",
    manager_llm="gpt-4o"
)

result = team.start()

Manager Decision Flow


When to Use

Use OrchestratorUse AgentFlow
Complex, unclear tasksSimple, clear steps
Don’t know order upfrontKnow exact order
Need flexibilityNeed predictability
Higher budget OKCost-sensitive

Sequential

Fixed step-by-step

Routing

Send to specialists