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.

Hierarchical workflows automatically handle common failure modes with built-in retry mechanisms and intelligent error recovery.

Quick Start

1

Create Hierarchical Workflow

from praisonaiagents import Agent, Task, AgentTeam

# Create agents
researcher = Agent(
    name="Researcher",
    role="Research Analyst", 
    instructions="Conduct thorough research on topics"
)

writer = Agent(
    name="Writer",
    role="Content Writer",
    instructions="Write engaging content based on research"
)

# Create tasks
research_task = Task(
    description="Research AI trends",
    agent=researcher
)

write_task = Task(
    description="Write article about AI trends", 
    agent=writer
)

# Create team with hierarchical process (enables error recovery)
team = AgentTeam(
    agents=[researcher, writer],
    tasks=[research_task, write_task],
    process="hierarchical",
    manager_llm="gpt-4o"
)
2

Start Workflow

# Error recovery happens automatically
result = team.start()

# If manager has parse errors or selects invalid IDs,
# the system retries transparently
print(result)

How It Works


Configuration Options

SettingValueDescription
MAX_MANAGER_RETRIES3Maximum parse error retries
MAX_INVALID_SELECTIONS3Maximum invalid ID re-prompts
Backoff timing2s, 4s, 8sExponential backoff delays
These constants are not user-configurable today; they are SDK defaults designed for optimal reliability. Future versions may expose configuration options.

Error Recovery Types

Parse Failures

When: Manager LLM returns invalid JSON Recovery: Retry with exponential backoff Max: 3 attempts before abort

Invalid Task IDs

When: Manager selects non-existent task Recovery: Re-prompt with valid ID list Max: 3 attempts before abort

Loop File Errors

When: Cannot read loop input file Recovery: Mark task as failed with error Visibility: Error shown in TaskOutput

Process Types

Understanding hierarchical processes

Hooks

Custom error handling with hooks