▶️ Watch the video tutorial (10 minutes)
A customer writes 'I was charged twice for my order and nobody is responding to my emails, this is unacceptable.' What happens next? Someone on your team reads it, decides it's a billing issue, marks it high priority, and routes it. Now multiply that by a few hundred tickets a day. Laravel 13's AI SDK can do this automatically.
In the last episode we got our support agent talking to customers. The problem is it responds in free text. You can read it, but you can't route it, set a priority from it, or track sentiment across thousands of tickets programmatically. You need structured data.
In this episode we build a second agent called TicketClassifier that takes a customer message and returns a JSON object with four fields: category, priority, sentiment, and a summary. Every field is locked to specific allowed values, so "billing" is always "billing" and "angry" is always "angry." You get clean data you can store, filter, and act on.
I walk through the schema, test it with different messages to make sure the classification is actually correct, and wire up a controller that validates input, classifies the ticket, and returns a response. The whole flow runs end to end in Tinker by the end of the video.
Next episode we're giving our agent custom tools so it can look up real orders in the database and pull customer history. The agent stops guessing and starts working with actual application data.