Guide
How to Build an AI Chatbot for Your Website
Most guides to this topic either sell you a no-code widget or bury the actual decisions under a wall of AI hype. This is neither — it's the real sequence: what to scope the chatbot to handle, why an LLM-based build beats the old decision-tree bots for almost every business site, how to write a system prompt that keeps it grounded in your own content, where to place the lead-capture ask, and how to get a qualified conversation into your CRM instead of a chat log nobody checks.
On This Page
How to Build This, Step by Step
Six steps, in the order I actually build them. No screenshots — the specific LLM API console or CRM screen you're looking at changes too often for a screenshot to stay accurate for long.
Decide exactly what it should — and shouldn't — handle
Start narrower than you think you need to. List the questions your website visitors actually ask before they message you or fill out a form — pricing structure, service areas, turnaround times, whether you work with a certain kind of business — and treat that list as the chatbot's actual job description. Resist the pull to make it a general-purpose assistant that can discuss anything; a chatbot that tries to answer everything ends up answering nothing well, and a visitor asking something outside its scope should get a clear "here's how to reach a person" instead of an improvised guess.
Choose an LLM-based chatbot over a rule-based one (for almost every business site)
Older website chatbots ran on decision trees — a fixed set of buttons and pre-written replies that break the moment a visitor phrases a question slightly differently than the flow anticipated. An LLM-based chatbot, built on a model like Claude, reads what someone actually typed and responds in context instead of forcing them down a menu. That's the meaningful split to make early: rule-based flows still make sense for a narrow, high-stakes task like booking a specific appointment slot, but for the open-ended "what do you offer, how much does it cost, do you serve my area" conversation most business sites need, an LLM-based build is the one that holds up.
Write the system prompt and ground it in your own content
This is the actual engineering work, and it's mostly writing, not code. The system prompt tells the model who it is, what tone to use, and — critically — instructs it to answer only from the business information you've given it: your services, pricing, policies, FAQs. Anthropic's own prompt engineering documentation covers this directly — setting a role in the system prompt focuses the model's behavior, and even a single sentence makes a difference. For a small knowledge base, pasting your FAQs and policies straight into the system prompt is enough; a larger one needs a retrieval step that pulls the relevant chunk before each reply. Either way, one instruction matters more than the rest: tell it explicitly to say it doesn't know rather than invent an answer.
Design the moment it asks for a name, email, or phone number
Where you place the ask matters as much as the ask itself. Front-load it before the chatbot has answered anything and most visitors bounce before they get any value; wait until deep into a long, meandering conversation and you risk losing someone who was ready to hand over their details three messages ago. The pattern that tends to work: let the chatbot answer the first question or two freely, then ask for contact details once the conversation shows real intent — someone asking about pricing, availability, or "can you do X for my situation" specifically. Intercom's own published chatbot recipes take a similar line: qualify before you route, and always leave a visitor the option to just keep browsing rather than trapping them in a form.
Connect it to your CRM so a captured lead doesn't sit in a chat log
A chatbot that captures a name and email inside its own widget and nowhere else is only half built — that lead needs to land somewhere your team actually checks. The usual pattern is a webhook: the chatbot's backend sends the captured details and a conversation summary to an automation tool like n8n, which writes it into your CRM as a new contact and can trigger a notification or a follow-up sequence in the same step. This is also where you decide what "qualified" means for handoff — a visitor who names a budget and a timeline is a different kind of lead than one who asked a single FAQ, and your CRM record should reflect that difference rather than dumping every conversation into one undifferentiated list.
Test it against real visitor questions before it goes live
A chatbot that looks fine in a handful of happy-path tests you wrote yourself can still fall apart the first time an actual visitor phrases something oddly, asks two questions at once, or tries to get it to say something off-brand. Pull real questions from your support inbox, past chat logs, or just ask a few people outside the project to try to trip it up before launch. Once it's live, keep watching the first week or two of real conversations rather than assuming it'll keep working unattended — that's usually where you find the gap between what you assumed visitors would ask and what they actually do.
What Actually Goes Wrong (and When This Isn't the Right Fit)
Most chatbot problems I get asked to fix trace back to one of these four, not to the underlying model being wrong for the job.
It answers confidently when it should say "I don't know"
The most common failure isn't rudeness or bad grammar — it's a confident, plausible-sounding answer that's simply wrong, because the system prompt didn't clearly enough instruct the model to stick to the content it was given. This is a writing problem before it's a technical one, and it's usually fixable by tightening the instruction, not by swapping models.
The lead-capture ask comes too early and kills conversations
A chatbot that demands a name and email before it answers a single question trains visitors to close the window instead. If your capture rate looks worse after launch than your old contact form did, this — not the model, not the CRM connection — is usually where to look first.
There's no path to a real person
A chatbot that traps someone in a loop when their question falls outside its scope does more damage than having no chatbot at all. It needs a visible, working way out — a WhatsApp number, a booking link, a "message us directly" option — for the moment it genuinely can't help.
Nobody owns keeping its knowledge current
A chatbot's answers are only as current as the content it was grounded in. If your pricing changes and nobody updates the system prompt or knowledge base to match, it keeps confidently quoting the old numbers. If there's no one assigned to review that content periodically, a chatbot may not be the right fit yet — a well-maintained FAQ page might serve you better until there is.
Frequently Asked Questions
Not necessarily for the conversation logic itself — most of the real work is writing a clear system prompt and organizing your business content, not programming. You will need some technical setup to embed the widget on your site and connect it to an LLM API and your CRM, which is where a developer or a no-code automation tool like n8n usually comes in.
Sources: Anthropic's own prompt engineering documentation on grounding a model's behavior through its system prompt, and Intercom's published chatbot recipes for lead-capture and qualification patterns.
Rather Have Someone Just Build It?
Everything above is the real process, and plenty of people reading this can get a first version working themselves — it's mostly writing and configuration, not a locked-down black box. If you'd rather skip the trial and error on the system prompt and lead-capture flow, or the build needs multiple channels and a real CRM integration, that's the part I get hired for. See AI chatbot development services for businesses anywhere, or AI chatbot development in Dubai if you're UAE-based and want someone local.
- 7+ years building automation and AI systems, including 100,000+ leads delivered through automated workflows
- Chatbots built on Claude AI and connected to your CRM through n8n — not a locked-in, proprietary platform
- One flat quote per project, with the system prompt and knowledge base handed off so you're never locked to me maintaining it
Have a Chatbot Question?
Fastest way to get an answer: message me directly on WhatsApp with what you're trying to build. Or send the details below and I'll get back to you.