{"id":424095,"date":"2026-05-12T15:41:10","date_gmt":"2026-05-12T15:41:10","guid":{"rendered":"https:\/\/www.newsbeep.com\/nz\/424095\/"},"modified":"2026-05-12T15:41:10","modified_gmt":"2026-05-12T15:41:10","slug":"laravels-ai-sdk-adds-sub-agents","status":"publish","type":"post","link":"https:\/\/www.newsbeep.com\/nz\/424095\/","title":{"rendered":"Laravel&#8217;s AI SDK adds sub-agents"},"content":{"rendered":"<p>Laravel&#8217;s AI SDK now lets you hand off agents as tools to other agents, turning the SDK into a proper orchestration layer.<\/p>\n<p>Real apps rarely live in one prompt. A general support agent needs different instructions, tools, and often a different model when answering a refund question vs. a billing one. Sub-agents make that delegation a first-class concept instead of a router you hand-roll.<\/p>\n<p><a id=\"content-how-it-works\" href=\"#content-how-it-works\" class=\"not-prose mr-1 text-gray-600 font-normal heading-permalink\" aria-hidden=\"true\" title=\"Permalink\">#<\/a>How it works<\/p>\n<p>Return an agent from another agent&#8217;s tools() method. The parent delegates a specific task and uses the sub-agent&#8217;s response while answering the original prompt.<\/p>\n<p>public function tools(): iterable<\/p>\n<p>{<\/p>\n<p>    return [<\/p>\n<p>        new RefundsAgent,<\/p>\n<p>    ];<\/p>\n<p>}<\/p>\n<p>Each sub-agent carries its own:<\/p>\n<p>Instructions and system prompt<br \/>\nTools (a RefundsAgent gets LookupOrder; the parent doesn&#8217;t need it)<br \/>\nProvider and model \u2014 pin a sub-agent to Anthropic with #[Provider(Lab::Anthropic)] while the parent runs on OpenAI<br \/>\nConfiguration like temperature, max steps, or timeout<\/p>\n<p>Finer control: Implement CanActAsTool on the sub-agent to define the name() and description() the parent sees. Skip it and Laravel falls back to the class basename and a generic description.<\/p>\n<p>One catch: Each sub-agent invocation runs in isolation \u2014 it does not receive the parent&#8217;s conversation history. The parent has to pass a clear, self-contained task description.<\/p>\n<p>Read the <a href=\"https:\/\/laravel.com\/docs\/13.x\/ai-sdk#sub-agents\" rel=\"nofollow noopener\" target=\"_blank\">sub-agents docs<\/a> for the full API.<\/p>\n","protected":false},"excerpt":{"rendered":"Laravel&#8217;s AI SDK now lets you hand off agents as tools to other agents, turning the SDK into&hellip;\n","protected":false},"author":2,"featured_media":424096,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[365,363,364,111,139,69,145],"class_list":["post-424095","post","type-post","status-publish","format-standard","has-post-thumbnail","category-artificial-intelligence","tag-ai","tag-artificial-intelligence","tag-artificialintelligence","tag-new-zealand","tag-newzealand","tag-nz","tag-technology"],"_links":{"self":[{"href":"https:\/\/www.newsbeep.com\/nz\/wp-json\/wp\/v2\/posts\/424095","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.newsbeep.com\/nz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.newsbeep.com\/nz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/nz\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/nz\/wp-json\/wp\/v2\/comments?post=424095"}],"version-history":[{"count":0,"href":"https:\/\/www.newsbeep.com\/nz\/wp-json\/wp\/v2\/posts\/424095\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/nz\/wp-json\/wp\/v2\/media\/424096"}],"wp:attachment":[{"href":"https:\/\/www.newsbeep.com\/nz\/wp-json\/wp\/v2\/media?parent=424095"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.newsbeep.com\/nz\/wp-json\/wp\/v2\/categories?post=424095"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.newsbeep.com\/nz\/wp-json\/wp\/v2\/tags?post=424095"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}