# How to Add an AI Chatbot to Your Website That Answers From Your Docs

Source: https://blog.lotsagent.com/add-ai-chatbot-to-website-answers-from-docs
Published: 2026-11-30T00:30:18.273557+00:00

To add an AI chatbot to your website that answers from your docs, you create an agent, point it at your help site so it reads every page, test it with real customer questions, and paste two lines of code into your site. With LotsAgent that is the whole job, and the agent answers from your docs first, links the page each answer came from, and says so plainly when your docs don't cover a question instead of making something up.

I'm Sivaguru, and I built LotsAgent. This guide walks through the exact steps in the product as it works today, the snippet you paste, the limits you should set before you go live, and the one list I check every week to make the answers better. Every label below is the label you will see in the console.

## What you'll have at the end

- A chat on your website, opened from a floating button or from your own "Help" link, that answers questions from your help center, docs, PDFs and notes.
- Answers that link the page on your site they came from, so visitors can read more and trust what they see.
- A list of questions your docs could not answer, most asked first, so you know what to write next.
- Optional: the same agent on its own web address, like help.yourcompany.com.

## Before you start

Have three things ready:

1. **Your docs address.** The help center, docs site or FAQ page you want the chatbot to answer from. A sitemap works too.
2. **Your site addresses.** Every site that will show the chat, for example `https://www.example.com` and `https://app.example.com`.
3. **Ten real questions.** Pull them from your support inbox or contact form. You will use them to test.

If your answers live in a support inbox rather than a help center, read [how to turn a support inbox into a help-center agent](https://blog.lotsagent.com/how-to-turn-a-support-inbox-into-an-agent-workflow-that-actually-escalates-the-right-things) first, then come back here.

## Step 1: Create the agent

Start your 14-day trial on [lotsagent.com](https://lotsagent.com). No card is needed. You sign in with your LotsTech account and the setup wizard opens. (Later, you start more agents from **Agents**, then **New agent**.)

The wizard has five steps, and it saves as you go:

1. **What it does:** pick **Help center from my docs**.
2. **Name:** the name people see in the chat and its handle. The handle is the agent's unique name on LotsAgent and becomes part of its web address (your-handle.lotsagent.com). If a handle is taken, the wizard says so and you pick another.
3. **Knowledge:** add your docs (step 2 below).
4. **Try it:** ask your real questions (step 3 below).
5. **Put it on your site:** add your site addresses and paste two lines (step 5 below).

If you leave halfway, the agent waits as a draft and its Overview shows **Finish setting it up**. You can change every setting later. If you'd rather describe the agent and have it built with you, open **Ask LotsAgent** in the console. I covered the wizard in more detail in [build your first AI agent without code](https://blog.lotsagent.com/build-your-first-ai-agent-in-5-minutes-no-code-guide).

## Step 2: Add your docs as knowledge

This is the step that decides how good your chatbot is. You can add knowledge in the wizard or on the agent's **Knowledge** tab, in three ways.

### Import your website or help center

Add a website by its address and choose what to read:

- **A page and the pages under it**, for example `https://example.com/help` and everything below it.
- **One page**, for a single FAQ or pricing page.
- **A sitemap**, when your docs are spread across paths.

LotsAgent reads up to 200 pages for each website (50 during the trial), and one agent can have up to 20 websites. It follows your site's robots.txt, and pages appear in the list as they are read.

Then pick how it stays current: **Update daily**, **Update weekly** or **Update only by hand**. You can click **Re-sync now** at any time. A re-sync reads changed pages again and drops pages that are gone, so when you fix a help article in the morning, the chatbot follows it.

### Upload files

Text, Markdown, CSV and PDF files, up to 25 MB each. This is where onboarding guides, price lists and policy PDFs that are not on your public site go.

### Paste text

Paste an answer, a policy or your own notes, with the public page where people can read it. When the agent uses that text, it links that page.

### What makes answers good

The agent answers from your knowledge first and links the page each answer came from. When your help has a link for each topic, the answer links that topic, not just the page. So a few habits pay off:

- **One topic per heading.** A help page with clear headings gives the agent clean sections to quote and link.
- **Write the answer, not just the steps.** "Yes, you can export to CSV from Reports" beats a screenshot with no words.
- **Keep internal or outdated pages out.** Import the folder your customers read, not the whole site.

## Step 3: Test it before anyone sees it

In the wizard's **Try it** step, or later with **Test** on the agent, open a chat and ask your ten real questions in the words your customers use, typos included.

For each answer, check three things:

1. **Is it right?** If not, the doc it read is unclear or out of date. Fix the doc, then **Re-sync now**.
2. **Does it link the right page?** If it links a long page instead of a topic, split the page or add headings.
3. **What happens when you ask something your docs don't cover?** It should say your knowledge does not cover it. That is the behaviour you want on a public site.

Your own test chats stay readable on the Test screen, so you can compare answers after each fix.

## Step 4: Choose who can chat

On the agent's **Deploy** tab, open **Sidebar**. Under **Who can chat**, pick one:

- **Anyone, no sign-in needed.** This suits a docs chatbot on a public site. Each visitor gets a random id inside the chat frame.
- **People signed in to my app.** Use this when the agent should know who it is talking to, for example inside your product. Your server signs a short token for the signed-in person, about ten lines of code, and the [embed docs](https://lotsagent.com/docs/embed) have examples in Node, Python and PHP.

For a chatbot that answers from your docs, pick **Anyone**. LotsAgent will not let anonymous visitors chat with an agent that has tools acting for a signed-in person, so a public docs chatbot stays a docs chatbot.

## Step 5: Add the chat to your website

Still on **Deploy**, **Sidebar**:

1. Copy the agent id. Use the id, not the handle: the id never changes.
2. Under **Your site addresses**, add every site that will show the chat. Use the exact origin, like `https://www.example.com` (with a port if you use one), or `https://*.example.com` for any one-level subdomain. Up to 20.
3. Paste these two lines into your pages:

```html
<script src="https://embed.lotsagent.com/v1/a/AGENT_ID/widget.js" async></script>
<lots-agent></lots-agent>
```

Replace `AGENT_ID` with the id you copied. There is no `token-url` here because anyone can chat; that attribute is only for signed-in people.

4. Turn on **Live on your site**.

A round button appears in the corner and opens the chat as a sidebar. On screens narrower than 640 px it opens as a full-screen sheet. The chat runs in its own secure frame, so your page cannot read the conversation, and the agent cannot read your page.

### Testing on your own computer first

`http://localhost` works only while **Testing on localhost** is on. You will see a red Test badge while it is. Turn it off before you go live.

### If your site sends a Content Security Policy

Add these two sources, and nothing else:

```
script-src https://embed.lotsagent.com
frame-src https://embed.lotsagent.com
```

### Make it fit your site

These are all in the [embed docs](https://lotsagent.com/docs/embed), and the ones most docs chatbots use are:

- **Your own Help link instead of the floating button.** Add `launcher="none"` to the element, then put `data-lotsagent-open` on any link or button. Add `data-lotsagent-prompt="How do I reset my password?"` to open it with a question already typed in.
- **Dark mode.** Add `theme="dark"`, or `theme="auto"` to match your site's light or dark mode.
- **A full help page.** `mode="inline"` makes the chat fill an element on your page, which works well on a /help page. Give the element a height.
- **Look and wording.** In **Deploy**, **Sidebar** you set the colour, the title, the button text, a welcome title for the empty chat and up to 4 starter questions shown as buttons.

## Step 6: Set your limits before you go live

A public chatbot needs guardrails. In **Deploy**, **Sidebar**, under **Limits and privacy**:

| Setting | Default | What it does |
|---|---|---|
| Messages per person per day | 50 | Up to 1,000. Over it, the person is told when it resets. |
| Daily spend cap | $20 | Emails you at 80% of the cap. At the cap the agent rests until the next day. |
| Notice | None | Your own words, shown before the first message. |
| Keep chats for | 30 days | Shorter if you want, from 1 day. |

On top of those, all anonymous visitors together get up to 500 messages a day on each agent, and your account has a monthly limit across all your agents. If something goes wrong, **Stop now** in the agent's menu turns the chat off at once.

Write a short notice. Something like "This assistant answers from our help center. For billing changes, email support@example.com." It sets expectations, and your own privacy policy should mention the chat too.

## Step 7: Read your knowledge gaps every week

This is the part I'd never skip. When people ask something your knowledge does not answer, the agent notes the topic. The **Knowledge** tab lists these questions, most asked first.

Once a week:

1. Open the list and take the top few questions.
2. Write or fix the help article for each one.
3. Click **Re-sync now** on that website (or wait for the daily update).
4. Mark each question as covered.

Only the topic of each question is kept, in the agent's own words, never the conversation, and each one is kept for 90 days after it was last asked. After a few weeks your help center covers what people actually ask, not what you guessed they would ask.

## Optional: give it its own web address

The same agent can also live full screen on its own address. On **Deploy**, open **Web address** and turn on your-handle.lotsagent.com, or enter your own domain such as help.yourcompany.com, add the DNS record it shows at your domain provider and click **Verify**. Every plan includes one custom domain for each agent.

When the agent has its own address, the sidebar header shows **Open this chat in a new tab**, and the same chat continues full width there.

## When something doesn't show up

| What you see | Why | Fix |
|---|---|---|
| Nothing appears | The agent is off, your CSP blocks the script, or `launcher="none"` is set with no trigger on the page | Turn **Live on your site** on, add the two CSP sources, or add a `data-lotsagent-open` link |
| "This agent is not set up for this site." | Your page's origin is not in **Your site addresses** | Add the exact origin |
| "This agent has answered as many visitors as it can today. Sign in, or try again tomorrow." | The anonymous visitor limit for the day was reached | Wait for the day to turn, or move busy users to sign-in |
| "This agent is resting until tomorrow." | The daily spend cap was reached | Raise the cap, or wait for the day to turn |

The embed docs list every message the chat can show, why, and what to do.

## What it costs

LotsAgent plans are priced by the number of agents, and every plan includes credits every month:

- **Starter:** $19 a month for 1 agent.
- **Pro:** $75 a month for 5 agents.
- **Business:** $200 a month for 20 agents, white-label on every agent.

Yearly billing gives you 2 months free. Every agent includes its own knowledge base, one custom domain and unlimited end users. There are no seat fees and no charge per answer: beyond your included credits, you pay what the AI costs plus 20%. On the trial, Starter and Pro, the chat shows a small "Built with LotsAgent" link; Business shows no LotsAgent mark. Details are on the [pricing page](https://lotsagent.com/pricing).

## Going further

A docs chatbot is the first job most people give an agent, and the same agent can grow. Connect it to your app and it can act for signed-in people with their own permissions, and anything that sends, deletes or moves money waits for the person to click Confirm. I wrote about where to draw that line in [the AI agent review step](https://blog.lotsagent.com/ai-agent-review-step-human-approval).

For a docs chatbot, though, the steps above are all you need: create, add knowledge, test, paste two lines, set limits, and read the gaps every week.

Related reading: [AI Chatbot for Customer Service: What to Let It Answer and What to Send to Your Team](https://blog.lotsagent.com/ai-chatbot-for-customer-service-what-to-answer-what-to-send).

## FAQ

### Will the chatbot make up answers when my docs don't cover a question?

No. The agent answers from your knowledge first, and when your knowledge does not cover a question it says so instead of making something up. The question then shows up in your knowledge gaps list so you can write the missing help.

### How does the chatbot stay up to date when I change my docs?

Each website you import updates automatically every day or every week, or only by hand. Click Re-sync now at any time. A re-sync reads changed pages again and drops pages that are gone.

### Do my website visitors need to sign in to use the chatbot?

No. Under Who can chat, pick Anyone, no sign-in needed. That suits a chatbot that answers from your docs. Sign-in is only needed when the agent should know who it is talking to.

### Can my website read the chat, and is the chat data used to train AI?

Your page cannot read the chat: it runs in its own secure frame. Chats are not used to train AI. They are kept for 30 days by default, and you can choose a shorter time, from 1 day.

### Can I put the chatbot on my own domain instead of a sidebar?

Yes. On Deploy, Web address, turn on your-handle.lotsagent.com or add your own domain, like help.yourcompany.com. Every plan includes one custom domain for each agent, and one agent can be in your sidebar and on its own address at the same time.

### How much does an AI chatbot for my website cost with LotsAgent?

Starter is $19 a month for 1 agent, Pro is $75 a month for 5 agents and Business is $200 a month for 20 agents. Yearly billing gives you 2 months free, and you can start with a 14-day trial with no card needed.
