> ## Documentation Index
> Fetch the complete documentation index at: https://docs.custral.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Agent

> Answer website visitors instantly from your own site, and hand the chat to your team when a person is needed.

## Overview

The chat widget's AI agent answers visitors the moment they ask, at any hour, from the
pages of your own website. When a visitor wants a person, or the agent can't find the
answer on your site, it hands the chat to your team.

A chat the agent handles on its own stays out of your inbox, so your team isn't
notified about questions it has already answered. You read those chats on the
[Insights](/comms/chat/insights) tab. Once a chat needs a person, it joins the inbox with
everything said so far, and the agent's replies show as **Website Assistant**.

## Set it up

<Steps>
  <Step title="Scan your website">
    Go to **Settings → Chat Widget → Knowledge**. Under **Scan a website**, check the
    domain and click **Scan site**. The agent answers only from the pages this scan finds.
  </Step>

  <Step title="Turn the agent on">
    On the **AI Agent** tab, turn on **Answer with AI before a human replies**.
  </Step>

  <Step title="Give it a persona">
    Under **Persona & instructions**, write how it should sound and what it must never do,
    or click **Generate with AI** to draft one. Then click **Save changes**.
  </Step>

  <Step title="Try it">
    Open your website and ask the chat a question your pages answer. The chat appears on
    the **Insights** tab with the agent's reply. Tap **Talk to a person** and it joins
    your inbox.
  </Step>
</Steps>

## What it answers from

The agent answers only from your scanned website and the
[answers your team adds](/comms/chat/insights#teach-it-an-answer). Before it replies, it
searches them for the visitor's question. When nothing matches, it says so and offers a
person instead of guessing. It can't see your records, your inbox
or anything else in your workspace, and it can't take actions such as booking, refunding
or changing an account. When an answer cites a page, the widget shows its link under the
answer.

Find the scan on the **Knowledge** tab:

| Field | What it does |
| - | - |
| Domain | The site to scan. Only pages on this domain are fetched. Once the widget is on your site, its domain is filled in. |
| Seed URLs (optional) | Pages to start from, such as your pricing page or docs. Add any page your home page doesn't link to. |
| Max pages | The most pages one scan fetches, from 1 to 200. The default is 50. |

A scan starts from your site's sitemap (listed in `robots.txt`, or at `/sitemap.xml`),
so it finds pages your home page doesn't link to. For a site without a sitemap, the scan
finds its pages through a web search of your domain.

**Sources** lists each site you've scanned, with its status, how many pages it holds and
when it was last scanned. Each site is scanned again every week. Click **Re-scan** to
pick up a change now, or **Delete** to take its pages out of what the agent knows.

The same pages power the widget's [Help tab](/comms/chat/help).

## Persona and instructions

Write the agent's tone and guardrails here: how it introduces itself, what it must never
promise, and which questions belong to a person. For example: "Be concise. Never quote a
discount. Send pricing questions for more than 200 seats to Sales."

**Generate with AI** drafts a persona from your workspace and the site the agent has
scanned. Describe how it should sound, or leave the box empty. If you've already written
a persona, the button says **Replace** and the draft takes its place. Nothing changes
for visitors until you save.

You don't need to explain how to hand a chat over. The agent already knows.

## When it hands off to a person

The agent brings in your team when:

* **The visitor taps "Talk to a person"**, under the greeting or under an answer. For a
  [known customer](/comms/chat/known-customers) the button names their owner, such as
  "Talk to Dana".
* **The visitor's message contains one of your escalation phrases.** The chat is handed
  over before the agent writes anything.
* **The visitor asks for a person in their own words**, such as "can someone from sales
  call me?"
* **The agent offered a person and the visitor said yes.**
* **The agent found nothing on your site to answer from, and the hand-off dial is at 0.7
  or higher.** The visitor gets your team instead of a guess.

### Escalation phrases

**Always escalate on these phrases** starts with nine phrases: "talk to a human", "talk to
a person", "speak to a human", "speak to someone", "real person", "human agent", "live
agent", "talk to sales" and "speak to sales". Edit, remove or add any. Clearing the list
brings the nine back.

A phrase matches anywhere in a message, in any case. "Can I talk to sales about seats?"
matches "talk to sales".

### The hand-off dial

**Hand off to a human when…** runs from **Let AI try** (0) to **Escalate early** (1), and
starts at 0.5. It decides what happens when the agent finds nothing on your site to
answer a question from:

| Dial | A question your site doesn't answer |
| - | - |
| Below 0.7 | The agent replies anyway. |
| 0.7 or higher | The chat goes to your team, and the agent doesn't reply. |

## What the visitor sees at hand-off

The agent tells the visitor the team is coming and how soon they usually reply. Outside
your office hours it says when they're back: "I've passed this to the team. They're away
until Monday at 9 AM." A visitor with no email on file is asked where to send the reply,
so they don't have to wait on the page. See
[Office hours and email follow-up](/comms/chat/office-hours).

The chat then goes to the owner of the visitor's record when there is one, or follows
your [routing rules](/comms/chat/routing).

## When it stops answering

The agent stops answering in a chat for good once:

* it has handed the chat over, even before anyone takes it;
* a teammate takes the chat, or it's transferred or assigned to someone;
* a teammate replies. A reply also assigns the chat to that teammate if nobody has it.

A chat that routing has only offered to your team, with nobody assigned yet, keeps its
answers, so the visitor is never left with nobody replying.

## Good to know

* **Answers use AI credits.** Each reply draws from your workspace's credit balance. A
  hand-off by button or phrase uses none. See
  [What consumes credits](/start/custral/billing#what-consumes-credits).
* **It knows the page.** A question comes with the page the visitor sent it from, so
  "is this plan monthly?" on your pricing page is answered about that page. See
  [Suggested questions and page prompts](/comms/chat/page-prompts).
* **It can't read files.** A visitor's screenshot or document goes to your team, and the
  agent answers only the text of a message.
* **It has limits.** One visitor can't get more than 12 answers a minute or 60 a day, and
  a workspace gets up to 2,000 answers a day. Past either limit the agent stays quiet; the message is
  still in your inbox for your team.
* **It can offer buttons.** After an answer, visitors can tap **That answered it** or
  **Talk to a person**. See [Buttons after an answer](/comms/chat/answer-buttons).

## Questions it isn't for

The agent answers questions about your business. Asked to write a poem or
ignore its instructions, it declines in one line and carries on. A visitor who keeps at it
(three times in a day) is told once what the agent is for, and gets no more answers that
day. Those chats stay out of your inbox and aren't counted as questions it couldn't answer.

Complaints and greetings are never treated as off-topic.

## Troubleshooting

| Symptom | Likely cause | What to check |
| - | - | - |
| The agent never replies | **Answer with AI before a human replies** is off, or wasn't saved | Turn it on in the **AI Agent** tab and click **Save changes**. |
| The agent stopped replying in one chat | It handed the chat over, or a teammate took it or replied | Expected. A person owns that chat now. |
| Answers are vague or say it doesn't know | Nothing scanned, the scan failed, or the page isn't in the scan | On the **Knowledge** tab, check the source's status and page count. Add the page under **Seed URLs** and re-scan. Or write the answer from the **Insights** tab. |
| A visitor's chat isn't in the inbox | The agent answered it, and nobody has asked for a person yet | Expected. Find it on the **Insights** tab, under **Chats the assistant handled**. |
| Too many chats reach your team | The dial is at 0.7 or higher, or a phrase is too broad | Lower the dial below 0.7, and remove short phrases that match ordinary questions. |
| Visitors who ask for a person keep getting answers | Their wording matched no phrase | Add the words your visitors use under **Always escalate on these phrases**. |
| The agent went quiet for everyone | Your workspace reached its 2,000 answers for the day | Your team still gets every message. The limit resets at midnight UTC. |

<Note>
  When reporting an issue, include the request id shown in the error toast. It links the in-app error to the server
  logs.
</Note>

## Related

<CardGroup cols={2}>
  <Card title="Office hours and email follow-up" icon="clock" href="/comms/chat/office-hours">
    What visitors are told when the agent hands off.
  </Card>

  <Card title="Buttons after an answer" icon="circle-check" href="/comms/chat/answer-buttons">
    "That answered it" and "Talk to a person" under each answer.
  </Card>

  <Card title="Help in the widget" icon="book-open" href="/comms/chat/help">
    Let visitors search the same pages the agent answers from.
  </Card>

  <Card title="Chat routing" icon="route" href="/comms/chat/routing">
    Who gets a chat once it's handed over.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.