---
title: Chat pages for websites
description: Put a published agent on a website as a link, a QR code or a chat button, within limits you set.
updated: 2026-11-14
---

> All VIABLE docs, for people and their agents: https://developers.viablelab.org/llms.txt

# Chat pages for websites

A chat page puts a published agent on any website as a link, a QR code and a chat button. Visitors need no account, so it suits a library's help desk.

It always runs the published version. To know who learners are, use a course instead. Librarians can start from **Overview → Open learning on a website**.

::: figure stage-publish

## Turn it on

::: steps
1. **Open the tab.** Publish the agent, open **Connect → Chat page**, and click **Set up chat page**.
2. **Choose the key.** Under **Key & limits**, pick the key it **Runs on**. Every message is a run on this key.
3. **Turn it on.** Set limits and websites (below), then click **Turn on chat page**.
:::

## Share it or add it to a site

**Share** gives the link and QR code. **Add it to a site** asks **Where will people chat?** and gives the steps for each place. On any website, paste the script before `</body>`. Copy yours from the tab:

```html
<script src="https://page.viablelearning.org/embed.js" data-agent="your-agent-slug" async></script>
```

### The chat button

Under **Chat button**, choose what the button opens:

- **Window**: the chat floats over the corner of the page. Escape closes it.
- **Side panel**: the page moves aside and the chat stays beside it, open from page to page in the same tab, like a docs site's assistant. Where fewer than 640 pixels of page would be left, the panel lies over the page instead.

On a phone, either one fills the screen. While the chat is open, the button steps aside; the chat's own close button brings it back.

With the profile's theme on **Automatic**, the chat takes the website's own light or dark when the site declares it (CSS `color-scheme: dark` or `light` on its `<html>`), and changes with it; a site that declares neither leaves it to the visitor's device. **Light** or **Dark** stays as chosen.

The button can show the agent's picture, an icon, its label (**Ask AI**, say) or an icon and its label, round or with rounded corners. Its text turns white or near-black, whichever reads better on the agent's color. The script reads all of this when it loads, so a change needs no new snippet. To try another choice on one site only, add `data-opens="side"` or `data-opens="window"` to the script tag.

If your site has a bar fixed to the right edge, the side panel would cover its end. The panel marks the page while it pushes it aside, so the bar can make room:

```css
html[data-viable-chat-open="right"] .my-fixed-bar { right: var(--viable-chat-width); }
```

In LibGuides, add a Media / Widget asset to one guide, or use Admin → Look & Feel → Custom JS/CSS for every guide. Canvas removes scripts, so it gets a frame.

Your page can open the chat with a question already asked, for example from its own search box when nothing matches:

```js
window.__viableChat?.['your-agent-slug']?.open({ ask: 'How do I cite a web page?' })
```

The question is sent once the chat has loaded, as if the visitor picked it.

Under **Chat button**, **Open links to your site in the same tab** makes a link to the website the chat is on, such as a page it cites, open there instead of in a new tab. It also lets the agent take the visitor to a page of that site when they ask ("open the examples page"): an Agent step gets an `open_page` tool for that site's pages only, says where it is taking them, and the page goes there once the reply is shown. With the side panel the chat stays open on the new page; a window closes with the page it was on. A single-page site can route to it itself, so the chat stays open either way:

```js
window.addEventListener('viable-chat:navigate', (event) => {
  event.preventDefault()
  router.push(new URL(event.detail.url).pathname)
})
```

**Tell the agent which page the visitor is on** sends, with each message, the address of the page the chat is open on and its title. Anything after `?` or `#` is left out, and the address must be on the site the script is on. The run's context carries them as `page`, so the agent can start from the page the visitor is reading: an Agent or LLM step sees it with **Reference data** on, and an instruction can use `{{context.page.title}}`. When the site moves between its pages without reloading, the chat hears about the change within a second. It is off until you turn it on, since a site's addresses can say something about the visitor, and it is kept with each run's trace, like the rest of the context.

## Limits and allowed sites

- **All visitors, per day**: 10–5,000 messages, default 300. **Daily cap** sets what it may spend a day.
- **Each visitor, per minute**: 1–30, default 8. **Each visitor, per day**: 0 for no limit.
- **Longest message**: 200–4,000 characters.

Daily counts reset at midnight UTC. One network address can send up to 400 messages a minute to an agent, so a school's classes can share it, and each visitor also keeps their own per-minute limit. The daily limit is shared by all visitors: at 300 a day, 30 learners get ten messages each. **Only these websites** (up to 20) limits where the button and frame appear, not the link.

## Recordings and attachments

- **What it records**: each device is an anonymous visitor with a visitor code (V-…), listed in [Teach → Learners](/dashboard/learners). **Keep recordings** saves spoken messages privately.
- **Voice**: with a Transcribe step, **Visitors can speak** appears. With a Speech step, so does **Play answers aloud**.
- **Photos & files**: up to 4 files of 8 MiB each, when every step that reads the message can read them.

## What it makes public

> [!WARNING]
> Anyone with the link, or on an allowed site, can chat with your agent on your key.

- The profile is public. Replies show their sources, but uploaded files show only their names unless the knowledge base allows opening them.
- The page hides your workflow, but a model can repeat its instructions. Write nothing there you wouldn't show a visitor.
- Visitors can't see each other's conversations. People sharing one computer and browser are one visitor.

**Pause** takes the link and embeds offline. **Turn off chat page** also clears the settings.

## The agent profile

The profile is how the agent presents itself, on its chat page and in courses. In **Connect → Profile → Edit profile**, set the **Greeting**, up to four **Suggested questions** and the **Notice** saying what the AI is. Changes show without publishing.

## Take it to your own server

On **Agents**, open the agent's **⋯** menu, choose **Export…**, then **With its knowledge (.zip)**. No course is needed. Owners and editors can download it.

- **It holds** the published version, its knowledge bases with their files, the text of their website pages as VIABLE last read them, its profile and chat page settings, and the agents it calls.
- **It leaves out** the page's key, conversations, logs and the headers of Fetch URL steps. Anything else it had to leave out is listed in its `notes`. It can be at most 25 MB.
- **It runs** on your own server with the VIABLE Engine, with the same page, limits and allowed sites. You bring the model.

To use it in another project, press **Import** on **Agents** there and choose the file. That makes the agents and knowledge bases, with no course. The profile and chat page aren't made: set them up on the agent.

::: cards
- [Knowledge bases](/docs/build/knowledge): choose whether readers can open cited files.
- [Keys and costs](/docs/project/keys-and-costs): give the page its own key and budget.
:::
