Laravel AI adds ToolSearch to load agent tools on demand

Started by Coder22, Yesterday at 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 65 times)
Active members in this topic:
Coder22(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

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