Ship AI with Laravel: Building Your First Agent with Laravel 13's AI SDK

Published on by

▶️ Watch the video tutorial (10 minutes)

Laravel 13 ships with an official AI SDK. Agents, tools, embeddings, vector stores, streaming. First-party, built into the framework.

I used it to build SupportAI, a customer support platform where the agent looks up real orders from the database, searches a knowledge base with RAG, classifies tickets by category and sentiment, streams responses through a Livewire chat UI, pulls live data from the web, and blocks prompt injections with a local LLM before they ever reach OpenAI. You can watch the full demo here if you want to see the finished product.

This is Ship AI with Laravel, a new series on Laravel News where we build the whole thing from scratch across 11 episodes. The stack is Laravel 13, Laravel AI SDK, Tailwind CSS v4, Livewire v4, Alpine.js, and PostgreSQL with pgvector.

In this first episode we go from a fresh Laravel 13 app to a working support agent in about 10 minutes. You'll see how to install the SDK, scaffold your first agent, configure its behavior, write instructions that actually make it sound like a real support rep, and get a response you can inspect for token usage, provider, and model. I also swap from OpenAI to Anthropic mid-request to show that your agent code stays the same regardless of which provider handles it.

Next episode we're building a ticket classifier. You throw a message like "I was charged twice and nobody is answering my emails" at it and get back structured data: billing category, high priority, angry sentiment, one-line summary. No human in the loop.

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

▶️ Watch Episode 1 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
Tinkerwell

Enjoy coding and debugging in an editor designed for fast feedback and quick iterations. It's like a shell for your application – but with multi-line editing, code completion, and more.

Visit Tinkerwell
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Lucky Media logo

Lucky Media

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

Lucky Media
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
Shift logo

Shift

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

Shift
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
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
Tinkerwell logo

Tinkerwell

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

Tinkerwell
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $9500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises
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

The latest

View all →
Passwordless Sign-In with Fortify Two-Factor Support in Laravel image

Passwordless Sign-In with Fortify Two-Factor Support in Laravel

Read article
Intercept: Middleware Guardrails for Laravel AI Agents image

Intercept: Middleware Guardrails for Laravel AI Agents

Read article
AI Review for Laravel Upgrades image

AI Review for Laravel Upgrades

Read article
HTTP Query Method Support in Laravel 13.19 image

HTTP Query Method Support in Laravel 13.19

Read article
Ship AI with Laravel: I Tricked My Own AI Into Leaking Everything image

Ship AI with Laravel: I Tricked My Own AI Into Leaking Everything

Read article
Laravel MPP: Charge AI Agents for API Access with 402 Payment Required image

Laravel MPP: Charge AI Agents for API Access with 402 Payment Required

Read article