Multi-Agent AI Customer Support for an Algerian E-Commerce Brand
Mazyoud is an Algerian children's clothing brand. Most of its sales don't happen on a checkout page. They happen in Instagram DMs, under Facebook posts, and on WhatsApp. I built the system that now answers those messages and writes the orders.
The problem without automated customer support
Algerian e-commerce runs on conversation. A customer sees a post, sends "شحال؟" or "3andkom taille 4?", and then there's a back-and-forth about size, color, delivery and wilaya. Somewhere in the middle of that, a human writes the order down by hand.
At peak the brand was receiving over 4,000 messages a day across three channels, and the team answering them was small. During campaigns, reply times slipped into hours. Nights and weekends were dead. That last part is the expensive one: a customer who doesn't get an answer buys the same product from whichever page answered first.
They had already tried a keyword-matching bot. It broke immediately, because nobody writes "size" the same way twice.
The constraints
The language isn't one language. Customers write Darija in Arabic script, Darija in Latin letters, French, and standard Arabic, often inside the same sentence. "vous avez le 4 ans?" and "3andkom 4 snin?" and "عندكم 4 سنين" are the same question.
Payment is cash on delivery, so there's no payment step to confirm intent. The bot has to collect name, phone, wilaya, commune, product, size, color and quantity, clean enough that a human confirming by phone doesn't have to start over.
A lot of customers don't name the product at all. They screenshot the post and send the image.
And then cost, which quietly decides everything else. At 4,000 messages a day, calling a frontier model once per message costs more than the people you're trying to help.
The approach
I didn't build one big chatbot. A single prompt trying to sell, track orders, explain the exchange policy and handle complaints becomes unmaintainable within a week, because every fix to one behavior breaks another.
Instead: a cheap router in front, specialized agents behind it, and a hard rule that anything the system isn't confident about goes to a human.
The stack is n8n self-hosted in queue mode (3 workers) for orchestration, Chatwoot as the unified inbox and the place a human takes over, WooCommerce as the source of truth for catalog and orders, and Supabase for conversation state and message buffering.
The build
Chatwoot normalizes all three channels into one webhook shape, so nothing downstream cares whether a message came from a WhatsApp number or an Instagram handle.
The first real design decision was to not answer immediately. People don't send one message, they send five in ten seconds: "salam", "3andkom", "hadi", [photo], "bch7al". Answering each one separately produces a bot that replies to message one while the customer is typing message three. So incoming messages go into a Supabase buffer, the system waits for a short silence window, then processes the whole burst as a single turn. That fixed the interleaving and cut LLM calls at the same time.
The second was to not call the expensive model unless there's a reason to. A small model classifies each turn as an order, price question, tracking request, exchange, complaint, or noise. A large share of incoming traffic is "❤️", "🔥", tagged friends and one-word comments, and that traffic now costs nothing. Adding the IGNORE path did more for the running cost than any amount of prompt tuning.
From the classifier, each intent routes to an agent with a narrow toolset: catalog lookup, order creation in WooCommerce, order status, exchange policy. Narrow tools keep the prompts short enough to actually test.
Product screenshots go through a small vision model that maps the image back to a SKU. Using a frontier vision model here would have doubled the cost of the whole system for one feature.
Finally, an alert_moderator tool lets any agent stop, hand the conversation to a human in Chatwoot, and stay quiet until released. Complaints, anything about money already paid, and anything the model is unsure about go straight to a person.
What was actually hard
Dialect handling wasn't a model problem, it was an examples problem. The fix was mining real conversation logs and building a few-shot set out of how customers actually write, instead of how I imagined they'd write.
Multi-item orders took more iterations than anything else in the project. "نحب 2 تاع 4 ans و وحدة تاع 6, wahda rouge" in a single message, and the extraction has to be right, because a wrong order becomes a returned package.
Then there was a stretch of work that had nothing to do with AI and blocked everything anyway: Facebook's deprecated ACCOUNT_UPDATE message tag, a Chatwoot dependency pinned to Graph API v3.2, WhatsApp Cloud API System User tokens, and a Meta App Review submission for pages_messaging.
On cost, the four things that made it work were model tiering, the IGNORE path, debouncing, and the cheap vision model. Remove any one and the arithmetic stops favoring the system over the humans.
Results
- 4,000+ messages a day handled across Instagram, Facebook and WhatsApp
- 100% response rate, including nights and holidays
- 800+ orders per month captured autonomously, from first message to order created in WooCommerce
- The support team moved off repetitive questions and onto escalations and order confirmation
Built by Ilyes Haddad, AI automation for Algerian and MENA e-commerce. If you run a store on WhatsApp, Instagram or Facebook and messages are outgrowing your team: contact@ilyeshaddad.com