> For the complete documentation index, see [llms.txt](https://en.help.firstline.cc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://en.help.firstline.cc/feature/ai-agent/start-ai-agent-from-scenario.md).

# How can Fancy collaborate with conversation scripts?

Follow the steps to set up how Fancy AI agents and conversation scripts work together, so open-ended Q\&A and fixed service workflows complement each other.

Fancy can first understand the customer's problem, then hand the conversation to the appropriate conversation script based on the need. For example,**general questions are answered by Fancy, while order inquiries or return requests are handled by a preconfigured script**, making service more flexible and easier to manage.

## Before you start, understand how the two are divided

* **Fancy AI agent:** Suitable for natural questions, follow-up questions, knowledge lookup, and determining what help the customer needs.
* **Conversation script:** Suitable for fixed menus, data collection, step-by-step flows based on conditions, and service processes already established by the business.

**The recommended way is to let Fancy receive the customer first, then have Fancy hand off to a conversation script as needed.** If you want to add AI responses to specific questions within a fixed script first, you can use the conversation script's built-in **AI response agent** feature; the setup method is different for the two.

## How do I set up Fancy and conversation scripts?

{% stepper %}
{% step %}

### 1. Create and configure Fancy

Go to FIRST LINE's **AI agent**management page, create an agent, and complete the basic information, reply instructions, and knowledge settings. If some issues need to be handled by a human, also set up the human handoff rules first.
{% endstep %}

{% step %}

### 2. Prepare the conversation script to use

Create or select a suitable conversation script, such as "Order Inquiry" or "Return Request." Make sure the script is enabled and can complete the required steps in order.
{% endstep %}

{% step %}

### 3. Set up Fancy's "routing"

In **AI agent → Routing** add a new setting, fill in the needs customers may ask about, set the action to **switch to conversation script**, and specify the corresponding script.

For example: "When the customer clearly says they want to check their order delivery status, switch to the Order Inquiry script."

It is recommended to make the conditions specific, to avoid mixing up 'want to know the return policy' with 'want to formally process a return.'
{% endstep %}

{% step %}

### 4. Select Fancy in the messaging channel

Go to the settings for the messaging channel you want to use, and set **AI agent** to Fancy. In this way, when a customer sends a new message, Fancy can first receive them, then use a conversation script as needed.

If you just want customers to follow a fixed menu, you can continue using the regular conversation script; you don't necessarily need to use Fancy first.
{% endstep %}

{% step %}

### 5. Try chatting and confirm the flow

Actually test common customer questions, follow-up questions, switching scripts, completing service, and transferring to a human.

Pay special attention to whether the script should end directly after completion, or whether you want to hand it back to Fancy to continue explaining. Confirm it meets your needs before going live.
{% endstep %}
{% endstepper %}

## Example: Order inquiry

**Customer:**"I want to know when my order will be delivered."

1. Fancy understands the customer wants to check delivery progress.
2. Fancy switches to the "Order Inquiry" script according to the settings.
3. The script asks for the necessary information and checks the order according to the company's existing method.
4. After the inquiry is completed, the script returns the result; if Fancy still needs to provide other explanations, you can set **"Return to AI agent"**.

This lets Fancy handle understanding the need, while the conversation script handles tasks that require fixed steps.

## After the script is completed, what are the follow-up options?

| Service need                                                                         | Recommended setting                                                                                                 |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------- |
| Inquiry completed, only need to provide the result                                   | Let the conversation script finish normally; Fancy will continue assisting when the customer sends a message again. |
| Inquiry completed, want Fancy to continue with questions or explanations immediately | Use at the appropriate spot **"Return to AI agent"**.                                                               |
| When human assistance is needed                                                      | Transfer to a live customer service agent.                                                                          |
| The customer asks a question the script cannot handle                                | Arrange the next step according to the original settings, and hand it to Fancy or a human if necessary.             |

**Please note: after the script completes normally, Fancy will take over the conversation again, but will not reply immediately.** Fancy will continue helping only when the customer sends the next message. If you want Fancy to continue immediately, please use **"Return to AI agent"**; if the script explicitly ends the conversation or transfers to a human, Fancy will not take over.

{% hint style="info" %}
**"Return to AI agent" does not require selecting an agent separately.** Its purpose is to hand the conversation back to the Fancy that previously took over this flow. Please try chatting before going live to confirm the whole service can continue as expected.
{% endhint %}

## When the script cannot handle the message

When the customer asks a question that the conversation script cannot handle, the AI agent will first execute the handling method originally set for the script. If no other handling method is set, and the conversation was originally handed off from Fancy, it will be handed back to Fancy to continue assisting the customer.

Before officially enabling it, it's recommended to test the case where the customer brings up another question midway, to confirm that Fancy and the conversation script can work together smoothly.

## Frequently asked questions

### Can I let Fancy receive customers directly without using conversation scripts?

Yes. If the main need is open-ended Q\&A, just set the messaging channel to be received by Fancy; only arrange scripts when fixed steps are needed.

### Can I directly choose another Fancy from within a conversation script?

Currently, it is recommended to use Fancy through the messaging channel, then use **routing**to switch to a conversation script. If you only need a single AI Q\&A step within the script, you can use the script's built-in AI response feature.

### How do I prevent customers from being passed back and forth all the time?

Only switch scripts when a fixed process is truly needed, and clearly arrange what should happen after the script ends. It is also recommended to test cases where the customer changes needs midway, cannot complete the process, or needs human assistance.

Further reading:[Learn about handing off from AI agent to conversation script](https://help.firstline.cc/feature/ai-agent/liao-jie-ai-dai-li-zhuan-jiao-jiao-tan-jiao-ben).
