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

# Agent from a call script

> Upload or paste the script your sales or support team uses. The agent follows the script's conversation, and company facts are filled in from your website.

## Introduction

If your team already has a phone call script, it is the best brief an agent
can get. Pick **I have a call script** under the template gallery (next to
**Generate with AI** and **Start with Blank Agent**).

The script and the website are read for different things:

| Source | What it provides |
| - | - |
| **Script** | the greeting, the call steps and the order of questions, objection replies, mandatory statements (recording notice, GDPR), the details to collect, what the agent must not say |
| **Website** (optional) | offer, prices, opening hours, address, phone, e-mail, frequent questions |

Where the script and the website disagree (a different price, say), **the
script wins**.

## Step 1: Script

Upload a file with **Upload file**, drag it onto the **Call script** box,
or paste the text there.
The file's text appears in the box, so you can still edit it before the
analysis.

* Supported formats: **PDF, DOCX, TXT, MD**.
* Files of **up to 10 MB**; up to **60,000 characters** of text are analyzed
  (about 30 pages). A longer script is cut, and the preview warns you.
* The script needs at least 80 characters. Anything shorter is a goal rather
  than a script; use [Generate with AI](/en/voice-agent/ai-generator) for that.

<Note>
  The limit is higher than for the file import in the Knowledge / FAQ box of the
  [templates](/en/voice-agent/onboarding-templates) (2 MB), because that text
  goes into the prompt as it is. A script is not pasted into the prompt whole:
  the AI extracts the conversation structure from it, so it can be longer.
</Note>

Optionally enter:

* **your company website**: used for the facts the script leaves out,
* **the company name**: when it should differ from the script and website,
* **the agent's language**.

## Step 2: Preview

The analysis usually takes 15-40 seconds. Before the agent is created you
see a preview, where every part is marked with its source: **From script** or
**From website**.

* **Conversation** (from the script): call direction, goal, greeting, steps
  and questions in the script's order, mandatory statements, objection
  replies, details to collect.
* **Company facts**: each fact with its own source.
* **Frequent questions**: the script's answers come first; questions the
  script does not cover are added from the website.
* **Notes from the website**: extra knowledge for the agent.

When the script and the website disagree, a list of the differences, with
both versions, appears above the preview. The agent uses the script's. If
the website cannot be read, the agent is built from the script alone and the
preview tells you so.

At the bottom, set the **company name on the call** (how the agent introduces
the company), the **language** and the **voice**. Click **Create agent** to
build it, or **Edit the script** to go back to the text.

## What goes into the agent

The agent is built on the general-purpose template:

* the script's **greeting** becomes the agent's first message, word for
  word. If it does not say the agent is an AI, the agent says so in its first
  reply - the caller has to know (EU AI Act, art. 50),
* the **steps** become the conversation plan, in the same order. The
  script's section headings ("OPENING", "NEEDS") are not steps of their own -
  at most they prefix the step they introduce ("Opening: give the reason for
  the call and invite to…"). The plan holds up to 20 steps; a longer script
  is shortened from the middle, never from the end - booking, summary and
  goodbye stay, and the preview says how many steps were left out,
* the **goodbye** step tells the agent to hang up with the `end_call` tool,
  and the **booking** step - when the agent has booking enabled - to call
  `book_appointment`,
* **mandatory statements** get their own prompt section: the agent says them
  word for word, where the script puts them,
* **objection replies** get their own section: the agent answers an objection
  at most twice and, if the caller still says no, politely ends the call,
* the **form of address**: when the script consistently says "Pani" (or
  "Pan", "Państwo", "Ty"), the agent keeps that form for the whole call, even
  where the website is written in the informal "you". Website FAQ entries in
  another form, or contradicting the script, are left out,
* **contact details** from the website are used only when complete: a
  cut-off phone number or e-mail is dropped, and one branch's hours do not
  become the whole company's (they go into the website notes, with the
  branch's name),
* the **facts** (offer, prices, hours) go into the agent's knowledge base, and
  the contact details into the company details.

You can change everything later in the [agent editor](/en/voice-agent/agent-editor).

<Tip>
  Before the first real call, run a test call and check that the agent gives
  the recording notice at the start of the call.
</Tip>

## API

The same flow is available through the API: `POST /agent-templates/analyze-script`
returns the preview (with a `source` on every value and a `conflicts` list),
and `POST /agents/from-script` creates the agent from it. To turn a script file
into text, use `POST /agent-templates/extract-text?purpose=script`.


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