Agent handoffs enable seamless task delegation between specialised agents, allowing you to build sophisticated multi-agent systems where each agent focuses on its area of expertise.
from praisonaiagents import Agent# Create specialised agentsbilling_agent = Agent( name="Billing", role="Billing specialist", goal="Handle billing inquiries and process payments", backstory="Expert in billing systems and payment processing")refund_agent = Agent( name="Refunds", role="Refund specialist", goal="Process refund requests", backstory="Specialist in refund policies and processing")# Create triage agent with handoffstriage_agent = Agent( name="Triage", role="Customer service triage", goal="Route customer inquiries to the right specialist", backstory="Expert at understanding customer needs", handoffs=[billing_agent, refund_agent])# The triage agent can now transfer to billing or refund agentsresponse = triage_agent.chat("I need a refund for my order")