Ship AI with Laravel: Building Your First Agent with Laravel 13's AI SDK
Published on by Harris Raftopoulos
▶️ 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.