Laravel & AI

Watch and track your favorite playlist.

Curated by: Laravel News (16 videos)


Currently Playing: Give Your AI Agent Live Web Search - Ship AI with Laravel EP8

Our agent can look up orders, search the knowledge base, and hold real conversations. But ask it "is FedEx having delays right now?" and it has nothing. Our knowledge base doesn't cover things that change by the minute. In this episode we give the agent access to the live web. The SDK ships with two provider tools for this: WebSearch to find information online and WebFetch to read a specific page. The AI provider handles the actual searching and fetching, so we just configure which domains to allow and how many results to return. I add WebSearch to the support agent, cap it at five results per search, and lock the allow list down to shipping carriers — FedEx, UPS, and USPS. That allow list matters. Without it the agent could browse anywhere on the internet and hand whatever it finds back to your customer. I also update the instructions so the agent is transparent about where its answer came from, our official policies versus something it found online. Then I test it. I ask about an order that shipped via FedEx with no tracking updates, and the agent checks both the order and FedEx's status. I ask how long USPS Priority Mail takes, and it pulls the current answer instead of guessing from training data. I also show how to bias results by location if your customers are in a specific region. Quick note: WebFetch is currently supported on Anthropic and Gemini. Since we're using OpenAI in this series, we stick with WebSearch, which covers the use case. ⭐ GitHub: https://github.com/harris21/ship-ai-with-laravel 👉 Full series playlist: https://www.youtube.com/playlist?list=PLsmlCYEtWNI_plnKPPO13XjfDJoMIfhLN 👉 Timestamps 00:00 Introduction and the Problem with Real-Time Questions 00:20 Web Search and Web Fetch in the Laravel AI SDK 00:42 What the Knowledge Base Can't Answer 01:05 How the Provider Handles Searching and Fetching 01:28 Adding Web Search to the Support Agent 01:44 Configuring Max Results and Allowed Domains 02:14 How web_search Works and Locking Down Domains 02:40 Updating the Agent Instructions 03:07 Testing the FedEx Delay Query 03:34 Reviewing the Agent's Response 04:00 Testing a Generic USPS Search 04:26 Biasing Results by Location 04:41 The Importance of the Allow List 05:04 Five Tools, Full Coverage 05:15 What's Next: Production Infrastructure ---------------------------------------------------------------------- ➫ Business Inquiries: hello@laravel-news.com ---------------------------------------------------------------------- JOIN OUR WEEKLY LARAVEL NEWSLETTER 👉 https://laravel-news.com/newsletter ----------------------------------------------------------------------


Tracks in this Playlist