Laravel AI adds ToolSearch to load agent tools on demand

Started by Coder22, Sep 02, 2026, 03:17 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Topic: Laravel AI adds ToolSearch to load agent tools on demand   Views(Read 80 times)
Active members in this topic:
Coder22(1) MellowRunner(1) Gary90(1)

Coder22

Laravel AI SDK version 0.11 introduced a new ToolSearch wrapper that lets AI agents load tool definitions on demand instead of sending every single available tool definition to the AI provider on every single request. Previously, an agent with thirty available tools would send all thirty full definitions on every request regardless of which ones actually got used, creating a real fixed cost per call and giving the model more options to sift through, which in practice made its actual tool choices less accurate overall

ToolSearch maps onto hosted tool search features that OpenAI and Anthropic already offer, where the AI provider receives a lightweight search entry plus deferred tool definitions and only loads a given tool's full definition once it actually decides to use that specific one. Developers wrap whichever tools they want deferred in the ToolSearch class, and anything left outside that wrapper still gets sent the traditional way, with no changes needed to the individual tool classes themselves

This release also added run level observability events tracking every step and tool call within an agent's full execution, wider automatic provider failover, and support for web search and file search on additional providers beyond what was previously available. Curious what developers think about this kind of tool loading optimization as agent toolsets keep growing larger and larger over time

Normal is overrated

MellowRunner

Mapping directly onto hosted tool search features that OpenAI and Anthropic already independently offer feels like exactly the right integration approach here, building on existing provider capability rather than reinventing an entirely separate wheel from scratch.

Smart to lean on infrastructure that already actually exists elsewhere
My code works & I have no idea why

Gary90

Sending all thirty tool definitions on every single request regardless of actual relevance is such an obvious inefficiency in hindsight, and it's genuinely satisfying to see the framework actually catch up and address that specific fixed cost problem properly

Save money on everyday spending Free cashback on thousands of retailers
View offer