A LeadAgent is an agent that can delegate tasks to specialized sub-agents.
It automatically has a delegate_to_agent tool that allows it to spawn
sub-agents based on registered AgentDefinitions.
Super class
deputy::Agent -> LeadAgent
Methods
Inherited methods
deputy::Agent$add_hook()deputy::Agent$compact()deputy::Agent$cost()deputy::Agent$last_turn()deputy::Agent$load_mcp()deputy::Agent$load_session()deputy::Agent$load_skill()deputy::Agent$mcp_tools()deputy::Agent$provider()deputy::Agent$register_tool()deputy::Agent$register_tools()deputy::Agent$run()deputy::Agent$run_sync()deputy::Agent$save_session()deputy::Agent$skills()deputy::Agent$turns()
Method new()
Create a new LeadAgent.
Arguments
chatAn ellmer Chat object
sub_agentsList of
agent_definition()objectstoolsAdditional tools for the lead agent
system_promptSystem prompt for the lead agent
permissionsPermissions for the lead agent (also applied to sub-agents)
working_dirWorking directory
Method register_sub_agent()
Register a new sub-agent definition.
Arguments
definitionAn
agent_definition()object