Hisham Alhussain
← All posts

Lessons from shipping AI agents to small businesses

· 3 min read

Most of my career has been on big, enterprise-scale projects. But lately I've been building AI agents for small businesses: front-desk assistants that handle WhatsApp messages for places like clinics and law firms. I've learned more about building reliable agents from these projects than I expected.

The stakes feel different. When a small business owner trusts your agent with their customers, every mistake is personal for them. There's no big team to catch problems. It's just them and their phone.

WhatsApp is where the customers are

In Saudi Arabia and the Gulf, WhatsApp isn't just a messaging app. It's how people contact businesses. They expect a reply fast, in their dialect, at 11pm on a weekend. A lot of small businesses can't keep up with that, so they lose leads.

That's the problem these agents solve: answer common questions, book and reschedule appointments, send reminders, follow up with people who didn't book, and hand off to a real person when needed.

Lesson 1: Some things must never be left to the model

Booking rules are the perfect example. The agent should never book a slot that's already taken, outside business hours, or for a service that isn't offered. You can write that in the prompt, but prompts are suggestions.

So I enforce those rules in code. The model can suggest a booking, but code checks it against the real calendar before anything is confirmed. If the check fails, the agent gets a clear error and tries again. The customer never sees a double-booking.

Lesson 2: Reminders have to fire exactly once

Sending a reminder twice is annoying. Not sending it at all means a no-show. Neither is acceptable. I ended up building the scheduler on top of the database with careful locking, so each reminder goes out exactly once, even if the server restarts mid-run. Boring engineering, but it's the kind of thing that makes or breaks trust.

Lesson 3: The handoff is a feature, not a failure

At first I thought a good agent should handle everything. Wrong. A good agent knows when to step aside: when the customer is upset, when the question is outside its scope, when something sensitive comes up. Making that handoff smooth, with the staff member getting the full context, matters more than squeezing out a few more automated conversations.

Lesson 4: Evals keep you honest

Every change, whether a prompt tweak or a model update, runs through an eval suite before it ships: booking scenarios, tricky dialect messages, edge cases, attempts to break the rules. If anything fails, it doesn't go out. With small clients, I can't afford to "test in production."

Lesson 5: Cost matters more than you think

For a small business, the agent has to be cheap to run. With smart model choices and caching, I've gotten the cost down to a fraction of a cent per conversation. That's what makes it viable for a small clinic, not just a big company.

The best part

What I love about these projects is the feedback loop. A clinic owner tells me they stopped losing late-night bookings, or a receptionist says they finally have time for the patients in front of them. That's a lot more satisfying than a dashboard metric.

If you want to see how I built it, the code for a sanitized version is up on my GitHub.