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

# AI Assistant

> Automatically give your customers quick, helpful answers on WhatsApp and Messenger using AI trained on your documents and website.

Customers ask the same questions every day: how long delivery takes, how returns work, which size to pick. An **AI Assistant** learns the answers from your own documents and website, and replies to those questions on WhatsApp for you, any time of day.

When it doesn't know the answer, or a customer asks for a person, it hands the chat to your team.

![The AI Assistants page with one assistant, Store Support Assistant, showing status Ready and the Active switch on, a table of assistants, and the Create assistant button](https://mintcdn.com/chatflows-docs/OsRhuCuCtK1k1HEc/automation/img/ai-assistant/assistants-list.png?fit=max\&auto=format\&n=OsRhuCuCtK1k1HEc\&q=85\&s=e3facae664962c87556697c427c2c5bf)

## What you get

> [card] Answers at any hour
>
> Customers get a reply straight away, even at night or on weekends.

> [card] Answers from your own information
>
> It replies using what you teach it: your policies, FAQs and website pages.

> [card] A person when it matters
>
> It passes the chat to your team when it isn't sure, or when a customer asks for a human.

> [card] Test before customers see it
>
> Ask it questions in a private test chat and fix its answers before you switch it on.

## Before you start

> [accordion] A connected WhatsApp number
>
> The assistant replies from your connected number. See [Connect WhatsApp](https://docs.chatflows.io/core-setup/channels/whatsapp.md).

> [accordion] The information you want it to use
>
> Gather what your customers usually ask about, such as your delivery, returns and size guides. It can be a file, pages on your website, or text you paste in.

## Set up your AI Assistant

**1. Create the assistant**

Click **AI Assistant** in the sidebar, then click **Create assistant**. Fill in:

* **Name** *(required)*: a name only your team sees, such as "Support Assistant".
* **Instructions** *(required)*: what the assistant does and how it should reply. For example: "You are the support assistant for Linen & Loom. Be friendly and keep replies short."
* **What it must never do** *(optional)*: topics it should avoid or leave to your team. For example: "Never promise a refund."

Click **Save**. The assistant opens on its own page.

![The New AI assistant form with a required Name field, a required Instructions box with example text, and a What it must never do box](https://mintcdn.com/chatflows-docs/OsRhuCuCtK1k1HEc/automation/img/ai-assistant/create-assistant.png?fit=max\&auto=format\&n=OsRhuCuCtK1k1HEc\&q=85\&s=ee1f2fabda1ff0371da8129fb9ff4031)

**2. Teach it on the Knowledge tab**

Open the **Knowledge** tab and add what the assistant should know. You can add three kinds of source:

* **Document**: upload a PDF, DOC, DOCX, TXT, MD or CSV file, up to 25 MB each.
* **Website**: enter a web address and click **Crawl website**. The assistant reads that page and the pages it links to on the same site.
  * Set **Max pages** to read up to 100 pages.
  * If your site changes often, set **Re-crawl every** so it reads the pages again after a number of days.
* **Text**: enter a **Title**, type or paste your information, and click **Add text**.

The assistant starts learning as soon as you add a source. When it's done, the source shows **Ready**.

![The Store Support Assistant page on the Knowledge tab, with Sources, Documents, Tokens used and Replies sent counts, the Ready status and Active switch, and the Add knowledge box showing Document, Website and Text tabs](https://mintcdn.com/chatflows-docs/OsRhuCuCtK1k1HEc/automation/img/ai-assistant/knowledge.png?fit=max\&auto=format\&n=OsRhuCuCtK1k1HEc\&q=85\&s=d1535a94c657c03140abc6f153a5d727)

The **Activity** tab, next to **Knowledge**, **Behaviour** and **AI Chat**, shows the assistant's usage and conversation logs.

**3. Test it in AI Chat**

Open the **AI Chat** tab and ask the questions your customers usually ask. These test messages never go to customers.

Each reply shows its status, how confident the assistant was, and the AI tokens it used. If an answer is wrong or missing, add the information on the **Knowledge** tab and ask again.

![The AI Chat tab with two test questions and replies, each marked Answered · 100% with the tokens it used, and a Type a customer question box](https://mintcdn.com/chatflows-docs/OsRhuCuCtK1k1HEc/automation/img/ai-assistant/ai-chat.png?fit=max\&auto=format\&n=OsRhuCuCtK1k1HEc\&q=85\&s=f3a7b38da58976e3fe041615c41718a3)

**4. Choose how it replies and when it hands over**

Open the **Behaviour** tab. It has three sections, explained [below](#behaviour-settings). Click **Save behaviour** when you're done.

**5. Turn it on**

Turn on the **Active** switch at the top of the page. The status shows **Ready** once the assistant has information it can answer from.

**6. Add it to an automation**

The assistant replies to customers from inside an automation. Open a flow in the [flow builder](https://docs.chatflows.io/automation/flow-builder.md) and add the [**AI Assistant**](https://docs.chatflows.io/automation/flow-steps/advanced.md#ai-assistant) step from the **Advanced** tab. See [The AI Assistant step](#the-ai-assistant-step) below.

> [!TIP]
>
> Create the assistant → teach it on **Knowledge** → test it in **AI Chat** → set its **Behaviour** → turn on **Active** → add it to an automation.

## Behaviour settings

### Role & Rules

Your **Instructions** and **What it must never do** from when you created the assistant. You can change them here.

To use the customer's name in a reply, add the merge field `{{contact.first_name}}`.

![The Role & Rules box on the Behaviour tab, with the Instructions and What it must never do boxes filled in](https://mintcdn.com/chatflows-docs/OsRhuCuCtK1k1HEc/automation/img/ai-assistant/behaviour-rules.png?fit=max\&auto=format\&n=OsRhuCuCtK1k1HEc\&q=85\&s=c6f6d998d1ab951ebe259c17d23f0ac0)

### Replies

* **Fallback message**: what the assistant sends when the answer isn't in its knowledge.
* **Reply footer**: text added to the end of every reply, such as "Reply HUMAN to talk to our team." Any word written in CAPITALS here also works as a handoff word.
* **History turns**: how many earlier messages the assistant reads to follow the conversation.
* **Max reply length**: the longest a reply can be. 600 is about a short paragraph.
* **Creativity**: how closely replies stick to your information. A lower number keeps answers consistent. 0.3 is a good starting point.

![The Replies box with a Fallback message, a Reply footer, and History turns, Max reply length and Creativity set to 10, 600 and 0.3](https://mintcdn.com/chatflows-docs/OsRhuCuCtK1k1HEc/automation/img/ai-assistant/behaviour-replies.png?fit=max\&auto=format\&n=OsRhuCuCtK1k1HEc\&q=85\&s=773a656a2e649db6c867615ef543fcf2)

### Handing over to a human

Choose when the assistant stops answering and leaves the chat to your team:

* **Handoff keywords**: words separated by commas. When a customer sends one, the assistant hands over straight away.
* **Hand off on low confidence**: hands over when the assistant isn't sure of its answer. **Minimum confidence** sets how sure it must be.
* **Unresolved turns before handoff**: how many questions it can fail to answer before it hands over.
* **Respect business hours**: uses your [business hours](https://docs.chatflows.io/settings/business-hours.md) to decide what happens when you're closed. Choose **Reply as usual**, **Hand off to a human** or **Stay silent**.

![The Handing over to a human box with Handoff keywords, Hand off on low confidence switched on, Minimum confidence 0.55, Unresolved turns before handoff 3, Respect business hours switched on with Outside business hours set to Hand off to a human, and the Save behaviour button](https://mintcdn.com/chatflows-docs/OsRhuCuCtK1k1HEc/automation/img/ai-assistant/behaviour-handoff.png?fit=max\&auto=format\&n=OsRhuCuCtK1k1HEc\&q=85\&s=994ec8acb8de936634f65606668e8bd1)

## The AI Assistant step

In the flow builder, add the **AI Assistant** step and pick your **Assistant**. Only assistants that are **Ready** and **Active** appear in the list.

Then choose a **Mode**:

* **Hand over the conversation**: the assistant answers every new message until it hands the chat to your team. The flow stops after the handover. Use this for a support chatbot.
* **Answer one question**: the assistant answers one question, then stops until the flow runs again. This mode has a few more settings:

  * **Greeting message**: sent when the assistant starts, so the customer knows it's ready. Leave it empty to use the default greeting.
  * **Question**: what the assistant answers. Choose **The customer's last message**, or **A saved variable** with an answer collected earlier in the flow, such as from an [Ask Question](https://docs.chatflows.io/automation/flow-steps/ask.md) step.
  * **Save answer as**: saves the reply so later steps can use it. With the default name, use it as `{{vars.ai_answer}}`.
  * **Send the answer to the customer**: on by default. Turn it off to only save the answer, so a later step decides what to send.
  * **Show typing indicator**: shows the customer a reply is on its way.

  After answering, the flow continues down an **answered** or **unanswered** path, so you can decide what happens next in each case.

![AI Assistant step settings in Answer one question mode, with Store Support Assistant selected, a Greeting message, Question set to The customer's last message, Save answer as ai\_answer, and the Send the answer to the customer and Show typing indicator switches turned on](https://mintcdn.com/chatflows-docs/OsRhuCuCtK1k1HEc/automation/img/ai-assistant/step-answer-one.png?fit=max\&auto=format\&n=OsRhuCuCtK1k1HEc\&q=85\&s=e38628d72c7750029f9a4a023d261f21)

**Example:** a **Start Trigger** for the message "hi", then an **AI Assistant** step set to **Hand over the conversation**. Customers can ask anything, and the assistant replies until it hands the chat to your team.

![A flow with a Start Trigger set to Exact match: hi, connected to an AI Assistant step that says Hands over the conversation](https://mintcdn.com/chatflows-docs/OsRhuCuCtK1k1HEc/automation/img/ai-assistant/flow-step.png?fit=max\&auto=format\&n=OsRhuCuCtK1k1HEc\&q=85\&s=9d2a1b711a2e7dc27fe5b3cde5e2e317)

## Stop the assistant in a chat

You can take over a chat from the assistant at any time, even if the customer didn't ask for a person:

1. Open the chat in your **Inbox**.
2. Click the AI icon at the top. It only shows while the assistant is answering that chat.
3. The assistant stops replying to that customer straight away, and the icon disappears.

If the customer starts the automation again later, the assistant comes back on its own.

## Common questions

> [accordion] What happens when the assistant doesn't know the answer?
>
> It sends your **Fallback message**. If you turned on **Hand off on low confidence**, or the customer reaches your **Unresolved turns before handoff**, it hands the chat to your team.

> [accordion] Can a customer ask to talk to a person?
>
> Yes. Add words like HUMAN or AGENT to **Handoff keywords**, and mention them in your **Reply footer** so customers know. The assistant hands over as soon as a customer sends one.

> [accordion] Does it reply when my shop is closed?
>
> You choose. Turn on **Respect business hours** on the **Behaviour** tab, then pick **Reply as usual**, **Hand off to a human** or **Stay silent**. See [Business hours](https://docs.chatflows.io/settings/business-hours.md).

> [accordion] Do my test questions go to customers?
>
> No. Messages in the **AI Chat** tab are only for testing and are never sent to anyone.

> [accordion] My website changed. Do I need to add it again?
>
> No. Set **Re-crawl every** on the website source, and the assistant reads your pages again on that schedule.

## Where to next

> [card] [Flow builder](https://docs.chatflows.io/automation/flow-builder.md)
>
> Build the automation your assistant answers from.

> [card] [Business hours](https://docs.chatflows.io/settings/business-hours.md)
>
> Tell the assistant when your team is around.

> [card] [Inbox](https://docs.chatflows.io/messaging/live-chat.md)
>
> Pick up the chats the assistant hands over.

> [card] [Question steps](https://docs.chatflows.io/automation/flow-steps/ask.md)
>
> Collect an answer first, then let the assistant reply to it.


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