Why I Built AutReply: AI Inbox for WhatsApp &amp; Instagram | Mohamed Said       [Skip to content](#main)  [ ![](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png) Mohamed SaidLaravel Backend Engineer ](https://msaied.com) - [Home](https://msaied.com)
- [Projects](https://msaied.com/projects)
- [Articles](https://msaied.com/articles)
- [Certificates](https://msaied.com/certificates)
- [About](https://msaied.com#about)

           [  Contact](https://msaied.com#contact) Menu 

Menu
----

Close 

 - [HomeStart here](https://msaied.com)
- [ProjectsCase studies](https://msaied.com/projects)
- [ArticlesEngineering notes](https://msaied.com/articles)
- [CertificatesCredentials](https://msaied.com/certificates)
- [AboutHow I work](https://msaied.com#about)
- [ContactGet in touch](https://msaied.com#contact)

  [Start a conversation](https://msaied.com#contact) [WhatsApp](https://wa.me/201094619204) [Email](mailto:hello@msaied.com) 

 1. [Home](https://msaied.com)
2. /
3. [Articles](https://msaied.com/articles)
4. /
5. [Laravel](https://msaied.com/articles?category=laravel)
6. /
7. Why I Built AutReply: One Inbox and an AI Assistant for WhatsApp, Instagram and Messenger

   [Laravel](https://msaied.com/articles?category=laravel) [Tips &amp; Tricks](https://msaied.com/articles?category=tips-tricks) 

 Why I Built AutReply: One Inbox and an AI Assistant for WhatsApp, Instagram and Messenger
==========================================================================================

 The problem I kept seeing, what AutReply does, and the engineering decisions behind its multi-tenant inbox and grounded AI assistant.

 ![](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp) [Mohamed Said](https://msaied.com#person) Published 16 Nov 2026 · Updated 16 Nov 2026 · 8 min read

ShareCopy linkCopied

 ![Why I Built AutReply: One Inbox and an AI Assistant for WhatsApp, Instagram and Messenger](https://cdn.msaied.com/826/01M7K1GYR3B8JV1TBK6JRYVW1Q.png) 

  On this page +1. [What AutReply does](#what-autreply-does)
2. [Architecture: workspaces as tenants](#architecture-workspaces-as-tenants)
3. [The AI assistant: grounded, patient, and honest about its limits](#the-ai-assistant-grounded-patient-and-honest-about-its-limits)
4. [Grounded in the business's knowledge](#grounded-in-the-businesss-knowledge)
5. [Structured output, not free text](#structured-output-not-free-text)
6. [Waiting before replying](#waiting-before-replying)
7. [Handing off to a human](#handing-off-to-a-human)
8. [Comments, not just DMs](#comments-not-just-dms)
9. [Lessons from building it](#lessons-from-building-it)
10. [Try AutReply](#try-autreply)

 Over the years, working with businesses across very different industries, I saw the same failure again and again. **Customers weren't lost to price or product. They were lost because nobody replied in time.**

A customer asks about a price on WhatsApp at 11 PM. Another question sits unread in Instagram DMs. A comment on a Facebook ad, from someone ready to buy, gets no answer. By the next morning, all three have bought from someone else.

The tools most small and mid-sized businesses use don't fix this. They have a phone with WhatsApp Business, the Instagram app, Meta Business Suite and a team trying to keep up with all of them. Messages are scattered, nobody has the full picture, and after business hours nothing gets answered.

So I built **AutReply**.

What AutReply does
------------------

AutReply brings every customer conversation from **WhatsApp, Instagram and Facebook Messenger** into a single real-time inbox. On top of that inbox sits an AI assistant that answers customers 24/7 using the business's own information. When a human is needed, it hands the conversation to the team.

The core building blocks:

- **Unified inbox.** Every channel lands in one screen that updates live. It includes a customer panel, tags, quick replies and AI tools.
- **AI assistant.** It answers from the business's knowledge base: documents, price lists, FAQs and policies. It knows when to hand off.
- **Auto-replies.** Rules for keywords, first messages, after-hours messages and fallbacks. They can apply to all channels or specific ones, and to messages or comments.
- **Campaigns and scheduled messages**, including approved WhatsApp templates for official numbers.
- **Contacts.** Each customer gets one profile across all channels, with tags, notes, import and export.
- **Developer access.** An API and Webhooks let it plug into the systems a business already runs.

WhatsApp can be connected officially through the **Cloud API**, which is the recommended route. There's also a quick QR-based connection for businesses that aren't ready for the official API yet.

Architecture: workspaces as tenants
-----------------------------------

The first real design decision was the tenancy model. Agencies and business owners rarely run just one brand, so the unit of isolation in AutReply is the **workspace**, not the user.

Each workspace is one business, with its own channels, conversations, contacts, rules, knowledge base and settings. A single account can own several workspaces and switch between them. Data never crosses workspace boundaries.

That decision has consequences across the whole stack:

- **Every query is scoped to the workspace.** This applies to Eloquent models, queued jobs and broadcasts alike. A job that processes an inbound webhook has to resolve the workspace from the channel before it touches anything else.
- **Caches have to be tenant-aware.** A cache key without the workspace in it is a data leak waiting to happen. I learned this the hard way, so every cache key in AutReply is now scoped to its workspace.
- **Sessions and cookies need care.** Once the app was served across subdomains, `SESSION_DOMAIN` caused CSRF cookie conflicts. The fix was setting the session domain explicitly, but tracking the cause down took longer than it should have.
- **Plan limits live at the workspace level.** Each plan caps messages, channels, contacts, rules, campaigns and AI points, and enforcement happens wherever those resources are created or consumed.

A **channel** is a connected WhatsApp number, Instagram account or Facebook page. Each channel belongs to exactly one workspace. Inbound events from Meta's webhooks are normalized into a single internal message format, so the inbox, the rules engine and the AI assistant never have to care which platform a message came from.

The AI assistant: grounded, patient, and honest about its limits
----------------------------------------------------------------

The AI assistant is the part of AutReply I spent the most time on. It's built with the **Laravel AI SDK**. Most of the work wasn't the model call itself. It was the behavior around it.

![](https://cdn.msaied.com/zEKeI8CB2aJfOE7V2wdnGYVsDyqpzxvgz5KAJlro.png)

### Grounded in the business's knowledge

The assistant answers from the workspace's **knowledge base**, not from general model knowledge. It has two modes:

- **Strict (recommended).** It answers only from the business's documents and instructions. If the answer isn't there, it says so and hands off to the team.
- **Balanced.** It uses the business's information first and general knowledge for small talk. It never invents prices or policies.

Long business text works better in the knowledge base than in the system instructions, because the assistant retrieves only the relevant chunk for each question. That keeps prompts small and answers focused.

### Structured output, not free text

The model doesn't return a string to be sent as-is. It returns a **structured decision**: the reply messages, whether to hand off, and which tags to apply. That makes the behavior testable and keeps the application in control of what actually goes out.

It also lets the assistant split a long answer into **one to three consecutive messages** in the right order. For example, it can send the answer, then the details, then a follow-up question, which reads much more naturally in a chat app. Billing counts it as a single AI point regardless of how many messages it sends.

### Waiting before replying

People don't write one long message in chat. They send "hi", then "do you deliver?", then "to Nasr City?". Replying to each fragment separately is both expensive and robotic.

So the assistant **waits a few seconds** to collect consecutive messages and answers them together. It's a small detail with a big effect on cost and on how human the conversation feels.

### Handing off to a human

Knowing when *not* to answer matters as much as answering. The assistant hands the conversation to the team when:

- the answer isn't in the knowledge base,
- the customer is angry or explicitly asks for a person,
- the request needs a manual action, such as a payment, complaint, cancellation or booking,
- the customer sends an attachment with no text that the assistant can't read,
- or the AI service fails or the workspace runs out of AI points, and no auto-reply rule matches.

When that happens, the customer always gets a handoff message in their own language. The conversation is tagged **Needs agent**, and the team gets a notification. The assistant doesn't go silent, though. It keeps answering what it *does* know and gently reminds the customer that the team will reply, at most once every ten minutes.

When a team member replies, the bot pauses for that conversation (30 minutes by default) so it never talks over a human. It resumes on its own afterward, or immediately with **Resume bot**.

### Comments, not just DMs

On Facebook and Instagram, the assistant also handles **comments**, and each comment costs a single AI decision:

- A simple question gets a short public reply.
- A request for details (price, sizes, availability) or a complaint gets a **private message** with the full answer, plus a short public reply.
- Praise gets a thank-you, and spam can be hidden automatically.

On Facebook it can also like positive comments. It never likes complaints or spam, and Instagram's API doesn't allow likes on comments anyway.

Lessons from building it
------------------------

A few things I'd tell anyone building a messaging product on top of Meta's platforms:

1. **The platform rules are the product constraints.** WhatsApp's 24-hour customer service window means a business can only reply freely within 24 hours of the customer's last message. After that, official numbers need an approved template. Facebook allows one private reply per comment within seven days. These rules shape the UX more than any design choice does.
2. **Normalize early.** Turning every platform's webhook payload into one internal message format was the best early decision I made. Every feature built afterward got simpler because of it.
3. **Make the AI explain itself.** Every conversation shows *why* the assistant didn't reply: waiting for an agent, an agent replied recently, rate limit, or no AI points left. That one line saved countless support tickets.
4. **Give users a playground.** Business owners trust the assistant once they've tested it with real questions. They can see which knowledge it used and whether it would have handed off. Trust comes from that visibility.
5. **Tokens are a product cost, not just an engineering one.** Batching consecutive messages, retrieving only the relevant knowledge and keeping conversation state compact all show up directly in margins.

Try AutReply
------------

If your business handles a lot of customer messages on WhatsApp, Instagram or Messenger, I'd love for you to try it. Setup takes a few minutes: connect a channel, add your business information to the knowledge base, and the assistant starts replying.

👉 **Start your free trial at [autreply.com](https://autreply.com)**

If you have feedback, questions or want a walkthrough, reach out. I read every message myself.

 Frequently asked questions 
---------------------------

  What is AutReply?AutReply is a platform that brings WhatsApp, Instagram and Facebook Messenger conversations into one inbox, with an AI assistant that answers customers 24/7 from your business’s own information.

   Can the AI assistant make up prices or policies?No. In Strict mode it answers only from your knowledge base, and if the answer isn’t there it hands off to your team. In Balanced mode it can handle small talk, but it never invents prices or policies.

   What happens when the assistant can’t help a customer?It sends a handoff message in the customer’s language, tags the conversation “Needs agent” and notifies your team. It keeps answering what it knows until an agent replies, then pauses.

   How do I connect WhatsApp to AutReply?Through the official WhatsApp Cloud API, which is recommended, or through a quick QR code connection.

   ![Mohamed Said](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp)About the author
----------------

[Mohamed Said](https://msaied.com#person)Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

[About](https://msaied.com#about) [GitHub ↗](https://github.com/EG-Mohamed) [LinkedIn ↗](https://www.linkedin.com/in/msaiedm/) [WhatsApp ↗](https://wa.me/201094619204) [Email Address ↗](mailto:hello@msaied.com) [My CV ↗](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)  

   [Previous articleLaravel AI SDK 1.4: Agents Now Recover From Tool Failures](https://msaied.com/articles/laravel-ai-sdk-14-agents-now-recover-from-tool-failures)  

   On this page
-------------

1. [What AutReply does](#what-autreply-does)
2. [Architecture: workspaces as tenants](#architecture-workspaces-as-tenants)
3. [The AI assistant: grounded, patient, and honest about its limits](#the-ai-assistant-grounded-patient-and-honest-about-its-limits)
4. [Grounded in the business's knowledge](#grounded-in-the-businesss-knowledge)
5. [Structured output, not free text](#structured-output-not-free-text)
6. [Waiting before replying](#waiting-before-replying)
7. [Handing off to a human](#handing-off-to-a-human)
8. [Comments, not just DMs](#comments-not-just-dms)
9. [Lessons from building it](#lessons-from-building-it)
10. [Try AutReply](#try-autreply)

 ###  Have a technical challenge?

 Tell me what you’re building. I reply within two working days.

[Start a conversation](https://msaied.com#contact) 

   Related articles
-----------------

 [ ![](https://cdn.msaied.com/824/9cedece04b58444cb565a8bec2be1737.png) Laravel · 4 min read### Laravel AI SDK 1.4: Agents Now Recover From Tool Failures

12 Nov 2026 ](https://msaied.com/articles/laravel-ai-sdk-14-agents-now-recover-from-tool-failures) [ ![](https://cdn.msaied.com/822/5e40cb946aeac937ab3dc0017777ec8b.png) Laravel · 4 min read### Laravel Read Replicas: Check if a Replica Has Caught Up with Commit IDs

11 Nov 2026 ](https://msaied.com/articles/laravel-read-replicas-check-if-a-replica-has-caught-up-with-commit-ids) [ ![](https://cdn.msaied.com/825/79872f42a01264e81e9ee701c8c8d75b.png) Laravel · 4 min read### UUID Request Input and Migration Failure Events in Laravel 13.42

11 Nov 2026 ](https://msaied.com/articles/uuid-request-input-and-migration-failure-events-in-laravel-1342) 

  Have a technical challenge?
----------------------------

Tell me what you’re building. I reply within two working days.

 [Discuss your project ↗](https://msaied.com#contact) 

  © 2026 Mohamed Said · Built with Laravel, meant to last.Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

 - [Home](https://msaied.com)
- [Articles](https://msaied.com/articles)
- [Certificates](https://msaied.com/certificates)
- [GitHub](https://github.com/EG-Mohamed)
- [LinkedIn](https://www.linkedin.com/in/msaiedm/)
- [WhatsApp](https://wa.me/201094619204)
- [Email Address](mailto:hello@msaied.com)
- [My CV](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
- [Sitemap](https://msaied.com/sitemap.xml)
