AI Chatbot for Your Website: Choose, Build, Launch

AgentSunrise
AI chatbot
website chatbot
RAG
customer support
AI automation

AI Chatbot for Your Website is a conversational interface that understands natural-language questions, uses approved sources, and chooses one of four actions: answer, clarify, abstain, or hand off to an operator. For businesses, it can explain a product, search for information in documents, collect a structured lead, and route inquiries.

A reliable bot does not “know everything” and does not replace support by default. Its scope is limited; answers based on the knowledge base include a source; if there is not enough data, it does not make things up; risky actions are confirmed by a human. The widget should also be keyboard accessible, not block the main page, and not send extra data to the model.

Short answer: static FAQ works for fixed questions, RAG is for answers based on updated sources, and an agent is for limited actions in CRM or other systems. The first pilot is best built as a RAG bot for a single topic with mandatory handoff and a frozen set of questions.

This material is for website owners, sales and support leaders, product managers, and web teams. It does not promise conversion growth: results depend on traffic, tasks, data, UX, and operator performance.

Key points in one minute

  • First define the question scope and the answer owner.
  • Do not upload documents without an owner, version, and validity period.
  • Separate answer, clarify, abstain and handoff.
  • RAG improves source grounding, but it does not eliminate prompt injection.
  • Handoff to an operator should include the conversation, intent, sources, and reason.
  • Load a third-party widget asynchronously or after the critical content.
  • Test keyboard navigation, focus, screen reader support, and the mobile viewport.

Contents

FAQ, RAG, or an Agent: Which to Choose

Format How It Responds When It Fits Main Risk
FAQ/rule bot selects a prepared answer few stable questions does not understand paraphrases or new topics
LLM without sources generates from the model and prompt ideation, not factual support confident hallucination
RAG bot finds passages and generates based on them catalog, policies, documentation poor retrieval or outdated source
agent RAG + approved tools/actions lead, CRM, status, booking extra or unauthorized action

RAG means retrieval-augmented generation: before answering, the system retrieves context from external sources. GOV.UK AI Insights notes that dynamic retrieval makes it possible to use new information at inference time without fully retraining the model. That does not guarantee correctness: retrieval relevance and answer alignment with the source must be tested separately.

Choose the minimum sufficient architecture. If a visitor needs five fixed answers and a form, a FAQ may be more reliable and less expensive. An agent is justified only where the action has measurable value and a controlled error rate.

ANSWER Method

The ANSWER framework connects content, behavior, and operations:

  1. A — Area: which topics, users, languages, and actions are allowed.
  2. T — Texts: sources, owners, versions, access, and validity period.
  3. V — Validation: retrieval, grounding, response rules, and test set.
  4. E — Escalation: when and to whom the conversation is transferred.
  5. T — Telemetry: quality, latency, cost, incidents, and feedback.

Scenario Card

Field Example
user potential customer for a specific product
intent check compatibility
allowed sources product page and current FAQ
answer rule respond only when directly supported by the source
clarify ask for the model/use case
abstain no verified information
handoff risk of error or request for personalized consultation
metric grounded answer accepted by reviewer

How to prepare a knowledge base

Source inventory

For each source, specify:

  • name and URL/path;
  • content owner;
  • audience and access level;
  • date and version;
  • expiration date or review frequency;
  • type: policy, product, instruction, legal, marketing;
  • conflicting authoritative source;
  • whether citation to a visitor is allowed.

Site content is not automatically a good source of truth. SEO pages may repeat content, hide important terms in a footnote, or describe an earlier product version. Marketing copy cannot be used as a normative source if it conflicts with the contract or internal policy.

Preparation

  1. Remove duplicates and navigation noise.
  2. Split the document by meaningful headings.
  3. Save the title, section path, URL, version, access label, and updated_at.
  4. Extract tables and constraints so the chunk does not lose context.
  5. Add a process for removing outdated sources.
  6. Compile the questions the source must answer and must not answer.

Chunk size, overlap, and retrieval method cannot be chosen universally. They are tested on a frozen question set, including similar phrasings and negative examples.

How the response is formed

It helps to split the production pipeline:

input → intent/safety → retrieval → rerank → answer policy → generation → citation check → response

Answer policy

  • answer — the source directly supports the conclusion;
  • clarify — a specific parameter is missing;
  • abstain — the source is missing or conflicting;
  • handoff — the question requires a human, access, or a risky decision.

The bot should not turn a missing answer into a generic model phrase. A refusal is more useful than a confident mistake: it explains the boundary and suggests the next step.

Citations

Show a readable title and a link to the page, not an internal chunk ID. Verify that the citation really contains the basis for the key claim. For conflicting sources, priority is determined by policy, not by embedding similarity.

When to hand off to an operator

Handoff is needed when:

  • the user explicitly asks for a person;
  • the confidence policy is not met;
  • the sources conflict or are outdated;
  • the request concerns a contract, payment, claim, or another risky topic;
  • the user rephrases the question repeatedly without getting results;
  • access to restricted data is required;
  • a tool/API returned an error;
  • the tone of the conversation requires intervention.

Handoff package

Pass the following to the operator:

  • the full conversation or an approved excerpt;
  • a brief summary;
  • the defined intent and collected fields;
  • the sources shown;
  • the reason for transfer;
  • actions already taken;
  • the response channel and consent status.

The phrase “I’ll switch you now” without a queue and an owner is not a handoff. If the operator is unavailable, the bot should honestly state the mode and offer an asynchronous channel.

How to collect leads without hidden fields

Collect only the data needed for the stated purpose. Before the input, explain why the phone number or email is needed and where the request will go. Do not make the person repeat information after handoff.

Example structure:

Field Required Validation
topic yes enum
name as scripted length/characters
contact for follow-up format + confirmation
company no text
comment no size + unsafe content handling
consent according to applicable requirements explicit event

The LLM can extract suggested values, but the form or gateway must show them to the user and verify them before writing to the CRM.

Security and prompt injection

OWASP LLM01:2025 defines prompt injection as a change in model behavior caused by user or external content. OWASP also specifically notes that RAG and fine-tuning do not eliminate this risk entirely.

Controls

  • treat visitor input and retrieved content as untrusted;
  • separate system policy from data;
  • filter access by tenant, role, and source label before retrieval;
  • do not put secrets in the prompt;
  • use allowlist tools and a strict schema;
  • confirm irreversible actions;
  • sanitize output before HTML rendering;
  • limit links, markdown, and uploads;
  • maintain audit logs and security tests.

OWASP Prompt Injection Prevention Cheat Sheet recommends least privilege, comprehensive monitoring, remote content sanitization, and regular testing. No classifier should be treated as absolute protection.

Accessibility and widget UX

If the chat opens as a modal dialog, implement full modal behavior, not just aria-modal. W3C APG Dialog Pattern requires an accessible name, focus being moved inside, cyclical navigation Tab/Shift+Tab, closing on Escape and returning focus to the invoking element.

Check:

  • a prominent open button with an accessible name;
  • visible focus and full keyboard-only operation;
  • correct reading of new messages, without endless announcements;
  • a close button and focus return;
  • text scaling and mobile keyboard;
  • contrast, loading/error/offline states;
  • ability to open a source link;
  • no auto-playing audio or intrusive pop-up.

Do not label the chat as modal if the background remains interactive. And do not trap the keyboard inside the widget without a clear way to close it.

Site speed and third-party JavaScript

A chat widget is a third-party script or iframe that can affect the main thread, network, privacy, and stability. web.dev recommends async/defer for non-critical third-party scripts, long-task audits, and testing the failure scenario for the external domain.

Practical budget:

  • do not load the main chat before critical content or the user's first intent;
  • do not duplicate SDKs and analytics;
  • measure JS bytes, requests, long tasks, and Web Vitals before/after;
  • test slow networks and provider unavailability;
  • place the launcher without layout shift;
  • have a fallback contact link without JavaScript.

Do not publish a claim that the widget “does not affect speed” without RUM. Measure specific pages and devices.

How to test the bot

Build a frozen eval from real anonymized queries:

Class Expected behavior Critical fail
answerable answer + supporting source source does not confirm the answer
ambiguous clarifying question fabricated assumption
out of scope refusal/route confident out-of-scope response
conflicting policy priority / escalation random selection
stale refusal or new version use of an outdated fact
injection policy preserved disclosure / action
PII minimization and consent unnecessary collection / inference
handoff full context package loss of conversation
UI keyboard / screen reader / mobile keyboard trap
performance deferred / fallback blocking the main page

Evaluate retrieval separately from the answer. Otherwise, you can't tell whether the model distorted a good source or whether search simply failed to find what was needed.

Pilot metrics

  • grounded answer rate on a frozen eval;
  • citation support rate;
  • correct abstain/handoff rate;
  • critical error rate;
  • operator acceptance rate;
  • repeat question after the answer;
  • time to human and lost handoffs;
  • lead field completeness after confirmation;
  • latency p50/p95 and error rate;
  • model/infra cost per completed conversation;
  • widget impact on RUM/Web Vitals.

Containment rate without quality is dangerous: the bot can 'close' conversations with incorrect answers. Track metric pairs — containment + satisfaction/grounding, automation + critical errors.

Implementation plan

  1. Choose one topic and an owner.
  2. Record the baseline for inquiries and handoffs.
  3. Build a source inventory and policy.
  4. Choose an FAQ, RAG, or agent format.
  5. Implement answer / clarify / abstain / handoff.
  6. Connect CRM only for the minimum confirmable fields.
  7. Run a frozen eval and security tests.
  8. Check accessibility, mobile, and performance budget.
  9. Launch on a portion of traffic with operator oversight.
  10. Decide scale / revise / stop based on quality, risk, and TCO.

If you need a preliminary process map, use the pre-AI audit checklist. For CRM actions, the architecture of an AI agent for Bitrix24 and amoCRM will be useful.

Frequently asked questions

How is an AI bot different from a regular chatbot?

A regular bot follows rules and buttons. An AI bot understands free text and generates a response, often with retrieval. That is why it needs stricter boundaries, sources, and evals.

Can you train a bot on the entire website?

Technically, the site can be indexed, but first you need to exclude duplicates, outdated pages, utility content, and contradictions. Each authoritative source should have an owner and a version.

Will a RAG bot hallucinate?

It can. RAG improves grounding, but retrieval can still fail and the model can distort context. You need citations, an abstain policy, and separate retrieval/answer tests.

When is a human operator needed?

On explicit request, when sources are insufficient or conflicting, for risky topics, restricted data, tool failures, or repeated failure. Handoff should preserve context.

Does the widget affect site speed?

It can: it's extra JavaScript, network traffic, and an iframe. Load it asynchronously or on intent, set a performance budget, and measure real pages.

How much does an AI chatbot cost?

The price depends on sources, integrations, actions, traffic, security, and support. Calculate CAPEX and 12-month OPEX; a template is included in the article on the cost of AI implementation.

How AI Dawn builds chatbots for websites

AI Dawn can analyze the inquiry flow, prepare a source inventory and RAG, design an answer/handoff policy, integrate chat with the website, CRM, and channels, run evals, security, accessibility, and performance tests, launch a pilot, train operators, and support the system.

The safest first step is to choose one topic, record the baseline, approved sources, constraints, and critical failure. After that, you can define the FAQ/RAG/agent format and the criteria for scale / revise / stop. Discuss the project.

Conclusion

An AI chatbot for a website is useful when it has a limited scope, controlled sources, verifiable behavior, and a real handoff to a human operator. The ANSWER method links scope, content, validation, escalation, and telemetry.

Start with one topic and a minimum FAQ/RAG setup, implement answer, clarification, refusal, and handoff, test for prompt injection, keyboard UX, and the widget's impact on the page. Add CRM actions and autonomy only after a frozen eval and pilot measurements.

Request an audit

Share your contact details and we will follow up.

← All articles

Comments (0)

Loading comments…

Leave a comment
No registration required

Book a strategy call
for agentic operations

Tell us which workflow you want to improve. We will map feasibility, risks, and the fastest MVP path.

By submitting, you agree to our privacy policy

Contacts

Global Operations

Serving U.S. clients remotely
with private cloud and on-prem options

Strategy calls by request

We respond after reviewing your workflow context.

lamooof@gmail.com

For partnership inquiries

Have a proposal?

Write to us in messengers

© 2025 AgentSunrise