Watch and track your favorite playlist.
Curated by: Laravel News (16 videos)
Stop Your AI Agent from Guessing - Ship AI with Laravel EP3 Episode 3 of Ship AI with Laravel, a series on Laravel News where we build a full AI platform using Laravel 13 and the Laravel AI SDK. In Episode 1 we built a support agent. In Episode 2 we added structured output for ticket classification. The agent can talk and classify, but when a customer asks "where's my order?" it makes something up. It has no access to our database. In this episode we fix that with tools. We scaffold two PHP tool classes: an OrderLookup tool that takes an order ID and returns the status, total, and customer info, and a CustomerHistory tool that takes an email and returns the last five orders. We build the Order model, migration, and relationships to power them, then register both tools on the support agent and update the instructions so the agent knows when to use them. I seed the database, test both tools, and the agent starts returning real data instead of guessing. I also add a MaxSteps limit to control how many tool calls the agent can make per prompt so you don't burn through your API budget. ⭐ GitHub: https://github.com/harris21/ship-ai-with-laravel 👉 Full series playlist: https://www.youtube.com/playlist?list=PLsmlCYEtWNI_plnKPPO13XjfDJoMIfhLN 👉 Timestamps 00:00 Why Chatbots Guess 00:45 Tools Connect to Data 01:30 Scaffold Order Lookup Tool 02:14 Define Tool Schema 03:10 Create Order Model 04:49 Implement Order Lookup Handle 05:53 Build Customer History Tool 08:09 Attach Tools to Agent 09:25 Seed Data and Test 09:45 Demo Order Lookup 10:37 Demo Email History 11:27 Limit Tool Calls 11:59 Wrap Up and Next Steps ➫ Business Inquiries: hello@laravel-news.com ---------------------------------------------------------------------- JOIN OUR WEEKLY LARAVEL NEWSLETTER 👉 https://laravel-news.com/newsletter ----------------------------------------------------------------------