DEV Community

Ssekyanzi Jackson
Ssekyanzi Jackson

Posted on

I built a keyless web search package for Laravel AI agents (no API keys, no per-query cost)

Laravel's AI SDK made building agents genuinely pleasant, but the moment my agent needed the web I hit the same wall everyone hits: provider-native search only exists on some providers (my production model has none), and every hosted search API is another key, another quota, another line on the bill.

So I wrapped a local keyless search engine into three ordinary Laravel AI tools and published it:

github.com/ssekyanzijackson/laravel-agent-web-search

composer require ssekyanzijackson/laravel-agent-web-search
php artisan web-search:install

use AgentWebSearch\Tools\{WebSearchTool, WebFetchTool, ResearchTool};

public function tools(): array
{
    return [new WebSearchTool, new WebFetchTool, new ResearchTool];
}
Enter fullscreen mode Exit fullscreen mode

What you get:

  • web_search for current facts and local sources, web_fetch to read a page as clean markdown (PDFs and bot-walled pages included), and research which searches and reads the top sources back as cited extracts.
  • Works on any provider the SDK supports, including providers with no native search.
  • Measured defaults, not guesses: a 3 second search deadline (engines answer in 1 to 2 seconds; blocked ones were eating the rest), batched page reads at about 1.7 seconds for two pages, and instant repeats through caching.
  • No key, no quota, no per-query cost. If you want paid coverage later you can point the engine at Tavily, Brave, Exa or Serper with automatic fallback, without touching your code.
  • No engine installed? The tools say so honestly and the agent carries on with its other tools.

Honest caveats, because a launch post without them is marketing: the engine is a separate AGPL install (nothing of it is bundled), it is a young project, engine reach depends on your host's network (run donsetch doctor to see which engines your server can reach), and on a tiny VPS heavy parallel research leans on CPU.

MIT, tested with a stub engine plus a live probe, CI on PHP 8.3 and 8.4. I would love feedback from anyone running agents in production. Especially: what would you want the read layer to do better?

Top comments (0)