▶️ 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.