What actually happens when a customer messages your AI agent
No magic, no black box: the full pipeline behind one AI reply — the cheap checks that run first, where the answer comes from, the guardrails, and who gets to press Send.
"AI answers your customers" is the pitch of every chat tool this year. It's also exactly the sentence that makes a careful business owner nervous — because it skips the only question that matters: what happens, step by step, between a customer hitting send and something appearing under your brand's name?
Here's the honest anatomy of one reply in Leadiosa. It's the same pipeline whether the message arrives from the website widget or from your Telegram bot — both channels feed one inbox and one brain.
Step 1: the cheap checks run first
An LLM call is the most expensive and least predictable part of the chain, so it goes last. Three cheaper handlers get the message first:
- Order status. With WooCommerce connected, "where is my order #1042?" is answered from your store's actual data — no AI involved, nothing to hallucinate.
- "I want a human." Asking for a person — in any phrasing, any language — moves the thread to your human queue and tells the visitor someone will pick it up. From that moment the AI stays silent in that conversation. A customer who wants a person should never have to argue with a bot about it.
- FAQ matches. Exact hits on your prepared answers cost nothing and can't drift.
Only what survives these filters reaches the agent — and before generating, a lightweight classifier rejects off-topic freeloading ("write me a Python script", "translate this essay"). Your support bot is not a free ChatGPT, and your token budget is protected accordingly.
Step 2: the answer is assembled, not improvised
The reply is grounded in three layers you control:
Personality. Who the assistant is, how it talks, and — separately — hard rules it must not break even when a visitor pushes: "never promise a refund without approval", "never give medical advice". Rules aren't vibes buried in a prompt; they're a distinct list, always enforced.
Knowledge. Retrieval over your own content: articles you wrote or uploaded, your product catalog, answers the system learned from your team. Plus live context — which page the visitor is on and what's in their cart, so "is this one in stock?" resolves to the right product.
Refusal to guess. If a factual question finds nothing relevant in your knowledge, the default is not creativity — it's "let me get a teammate", and the thread moves to your queue. A short wait beats a confident invention every time.
While drafting, the agent can also do things (off by default, one toggle): save a name, email or phone number the visitor volunteered — only into empty fields, never overwriting — and label the conversation with one of your existing tags. Every applied action is recorded on the reply, and AI-captured details wear a small "AI" badge on the contact card. You always know where data came from.
Step 3: someone decides whether it ships
This is the part most tools get wrong. Generating a good reply is half the job; deciding who approves it is the other half.
- Copilot — every AI reply lands in your inbox as a draft: send it, edit it, or discard it. Nothing reaches the customer without a human click, and the draft card spells out any side effects ("on send, the AI will also save contact info"). If a newer message arrives or you reply manually, stale drafts dissolve on their own.
- Autopilot — the AI answers by itself when nobody's online, and suggests drafts while you're at the keyboard.
Start in Copilot. When the last ten drafts have gone out without a single edit, the system tells you so and suggests the switch — trust built on evidence, not on a marketing page. (Some businesses, clinics especially, stay in Copilot forever. That's not a failure to graduate; that's the correct setting for the stakes.)
What this looks like in real businesses
A shop at 2 a.m. "Do you have the ceramic set in white?" — answered from the catalog. "Email me when it's back — anna@…" — contact saved, thread tagged restock, and the morning inbox holds a qualified lead instead of a missed chat.
A clinic in permanent Copilot. Hours, booking, insurance — drafted by the AI, approved by staff, delivered under the clinic's name with a human accountable for every word. "What should I take for…" hits a hard rule and gets a polite referral to a practitioner.
A Telegram-first audience. Customers who live in messengers write to your bot like any contact. Same inbox, same knowledge, same guardrails — replies (files included) land right back in their chat.
The owner, one month in. Week one: reading drafts. Week two: the nudge arrives, Autopilot goes on for nights. Week four: self-learning has turned real answered questions into new knowledge articles, and the weekly digest shows how much the assistant closed alone. The AI became the night shift; the human kept the judgment calls.
The takeaway
An AI agent you can trust isn't one giant clever model — it's a pipeline of small, checkable decisions: cheap handlers first, grounded generation second, human authority over delivery third. Every step above is inspectable in the product, and most of them are a toggle you control.
If you want to see the pipeline run on your own content, paste your website into the demo on our homepage — or start free and interview-train the assistant in five minutes.