Get expert guidance in a few days with a Laravel code review

Ship AI with Laravel: Stop Your AI Agent from Guessing

Published on by

▶️ Watch the video tutorial (12 minutes)

Our support agent can talk to customers and classify tickets. But ask it "where's my order?" and it makes something up. A confident, detailed, completely fabricated answer. It has no connection to our database.

In this episode we fix that by giving the agent tools. Two of them. An OrderLookup tool that takes an order ID and returns the status, total, and customer info from our database. And a CustomerHistory tool that takes an email and pulls the last five orders. We build the Order model, migration, and relationships to power them, register both tools on the agent, and update the instructions so it knows when to reach for each one.

After seeding some test data, I ask the agent about order 1042 and it comes back with real data. I ask for a customer's history by email and it pulls their actual orders. No more guessing.

I also add a MaxSteps limit to control how many tool calls the agent can make per prompt. Without it, the agent could chain tool calls and burn through your API budget on a single question.

Next episode we're adding conversation memory so the agent remembers what you talked about. Right now every prompt is a blank slate. That changes.

⭐ GitHub: https://github.com/harris21/ship-ai-with-laravel

▶️ Watch Episode 3 now →

Harris Raftopoulos photo

Senior Software Engineer • Staff & Educator @ Laravel News • Co-organizer @ Laravel Greece Meetup

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
SerpApi

The Web Search API for Your LLM and AI Applications

Visit SerpApi
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
MongoDB logo

MongoDB

Enhance your PHP applications with the powerful integration of MongoDB and Laravel, empowering developers to build applications with ease and efficiency. Support transactional, search, analytics and mobile use cases while using the familiar Eloquent APIs. Discover how MongoDB's flexible, modern database can transform your Laravel applications.

MongoDB

The latest

View all →
Laravel Cloud Adds Path Blocking to Prevent Bots From Waking Hibernated Apps image

Laravel Cloud Adds Path Blocking to Prevent Bots From Waking Hibernated Apps

Read article
Making Laravel MongoDB Operations Idempotent: Safe Retries for Financial Transactions image

Making Laravel MongoDB Operations Idempotent: Safe Retries for Financial Transactions

Read article
FormRequest Strict Mode and Queue Job Inspection in Laravel 13.4.0 image

FormRequest Strict Mode and Queue Job Inspection in Laravel 13.4.0

Read article
Pretty PHP Info: A Modern Replacement for `phpinfo()` image

Pretty PHP Info: A Modern Replacement for `phpinfo()`

Read article
Laracon US 2026 Announced image

Laracon US 2026 Announced

Read article
Laravel QuickBooks MCP Server: Connect QuickBooks Online to AI Clients image

Laravel QuickBooks MCP Server: Connect QuickBooks Online to AI Clients

Read article