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

# AI Script Generation

> Generate a complete call script or AI receptionist from a short description, grounded in your website content and uploaded documents. Covers the generation inputs, file limits, the live progress log, website research behaviour, and what to do when a generation fails.

## What is AI Script Generation?

AI Script Generation builds a complete, editable call script from a short description of what you want the assistant to do. You provide a name, a call direction, who the assistant will be talking to, a voice, and a description — and optionally a website URL and supporting documents. Voxworks then generates the full package: a call flow with branching steps, Call Objectives, Guidelines, a populated Knowledge Base, and a voicemail message.

Generation runs in the background with a live progress log, and the finished script opens in the standard script editor — it is a starting point to review and refine, not a locked artefact.

The same generator powers the AI Receptionist creation flow, with a simpler form (see [Generating an AI Receptionist](#generating-an-ai-receptionist) below).

***

## Starting a generation

1. Go to **Call Scripts** and select **New script**.
2. In the **Create New Script** dialog, choose **Generate with AI** — "Describe your script and let AI generate it for you".
3. Select **Create**. The **Generate Script** form opens.

For receptionists, go to **AI Receptionist** and select **New receptionist**. In the **Create New Receptionist** dialog, **Generate with AI** is the default option — receptionists have no template option, so AI generation is the primary way to create one.

***

## Generation inputs

| Field                   | Required | Description                                                                                                                                                                                                                                                  |
| ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Script Name**         | Yes      | The name of the new script, up to 100 characters (e.g. "Appointment Booking").                                                                                                                                                                               |
| **Call Direction**      | Yes      | **Inbound** or **Outbound**. Defaults to Outbound.                                                                                                                                                                                                           |
| **Contact Type**        | Yes      | Who the assistant is talking to (e.g. "Patient", "Customer"). This shapes the generated tone and phrasing.                                                                                                                                                   |
| **Voice**               | Yes      | The voice for the script. Becomes the script's Default Voice.                                                                                                                                                                                                |
| **Description**         | Yes      | The script's goal, conversational pathways, and actions the assistant should take, up to 2,000 characters. This is the most influential input — the more specific you are about pathways and outcomes, the closer the generated flow will match your intent. |
| **Website**             | Optional | Your business website URL. Voxworks visits the site to ground the script in your business context. `https://` is added automatically if you leave it off; the site must be publicly reachable.                                                               |
| **Knowledge Documents** | Optional | Files parsed into the script's Knowledge Base — see limits below.                                                                                                                                                                                            |

Select **Generate** to start. The button reads **Generating...** while the request is submitted.

### Document limits

* **Formats** — PDF, DOCX, PPTX, TXT, Markdown, CSV, or JSON. Files in any other format are skipped with a warning under the dropzone.
* **Count** — up to 5 documents per generation.
* **Size** — up to 10 MB per file.
* **Content** — text is extracted from each file and the first 12,000 characters are used. Duplicate files (same name and size) are added only once.

Uploaded documents are treated as authoritative source material: the generator uses them to fill the Knowledge Base with caller-useful facts, and where a document conflicts with website research, the document wins.

***

## Website research

When you provide a website URL, the generator researches the site before writing the script:

* **Page discovery** — it starts from the URL you gave, then looks for high-value pages via common paths (about, contact, FAQ, help, support, services), the site's sitemap, and links on the homepage. It visits up to 5 pages, prioritising the homepage plus one each of FAQ, about, services, contact, and pricing pages where they exist.
* **Business grounding** — from the visited pages it distils your positioning, products and services, brand tone, audience, and key facts (locations, hours, policies), and writes the script around them. The generator is instructed not to invent facts beyond what it found — where a detail is missing, the script falls back to offering human follow-up rather than guessing.
* **Verbatim FAQs** — every question-and-answer pair found on FAQ pages is copied into the script's [Knowledge Base](/scripts/knowledge-base) word-for-word, one entry per question, keyed as `FAQ: <question>`. Answers are never summarised or paraphrased, so the assistant answers common questions using your site's exact wording. Duplicate questions are removed.

The progress log reports each stage: which pages were selected, which were successfully visited, and how many FAQ items were found (for example, "Website research complete. FAQ items: 12."). After generation, a log line confirms how many researched FAQ items were added to the script's Knowledge Base.

If the site cannot be researched — an unreachable URL, or no readable content — generation continues without it, and the log notes "Website research failed (...). Proceeding without it." You still get a complete script from your description and documents.

***

## The progress log

Once submitted, the modal switches to **Generating Script**, with a progress bar and a streaming log of steps. The current step shows a spinner; when more than 5 steps have run, earlier entries collapse under a "completed steps" toggle you can expand.

A typical run logs steps such as:

* Script generation request received.
* Will research [https://yourbusiness.com](https://yourbusiness.com) for business context.
* Researching [https://yourbusiness.com](https://yourbusiness.com) for business context...
* Website research complete. FAQ items: 12.
* Identifying conversational structure and key pathways...
* Building script flow and branching logic...
* Sending to AI for generation...
* AI response received. Processing output...
* Validating script structure...
* Saving script to database...
* Script generation complete!

You do not need to keep the modal open. If you close it mid-generation, the job continues in the background and a notification confirms: "Generation is still in progress. Your script will appear in the scripts list when ready."

### Setup needed notes

After a script generation completes, an automatic check pass verifies the generated content against your team's real configuration — for example, matching generated tool steps to the tools actually available to your team. Anything that needs your attention is appended to the log as a **Setup needed:** entry, such as a required tool field you must fill in or a variable reference to replace or remove. Open the script in the editor and work through these notes before testing. Generated receptionists use a fixed, pre-verified call structure, so they skip this check.

***

## What gets generated

When the log reaches **Generation Complete**, you see a summary of the script's type and contact, with buttons to **Close** or **Open Script**. Opening the script takes you straight to the [script editor](/scripts/editor-guide). The generated script includes:

* **Call flow** — voice steps with branching conditions and a defined end of call, following the pathways in your description.
* **Call Objectives** — success criteria for the call.
* **Guidelines** — behavioural rules and safety boundaries.
* **Knowledge Base** — facts from your description, researched website content, verbatim FAQ entries, and uploaded documents.
* **Voicemail message** — a concise message for unanswered outbound calls.
* **Default Voice** — the voice you selected on the form.

Generation is tool-aware: it knows which tools are available to your team and can include pre-configured tool steps where your description calls for them — for example sending an SMS, collecting and confirming a caller detail, extracting a value from the conversation, calling an external API, or transferring to a human (offered only when your team has transfer [Endpoints](/routing/endpoints) configured). Some tool fields — such as output mappings — are deliberately left blank for you to wire up in the editor. Any required input field left blank is flagged in the Setup needed notes. Generated steps can also reference contact details through variables such as `{{contact.first_name}}` (string, e.g. `Jane`).

The Data Collection tab starts empty — add [Data Collection](/scripts/data-collection) fields yourself if the script should capture structured data.

Always review the generated script step by step and run a test call before using it in production.

***

## Generating an AI Receptionist

The receptionist form is shorter because receptionists always answer inbound calls from callers — there is no Call Direction or Contact Type to set:

| Field                   | Required | Description                                                                                                                                                                                                                                  |
| ----------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Receptionist Name**   | Yes      | The receptionist's name (e.g. "Ava").                                                                                                                                                                                                        |
| **Voice**               | Yes      | The receptionist's voice.                                                                                                                                                                                                                    |
| **About your business** | Optional | What the business does, and anything the receptionist should know or handle on calls. If left empty, a standard brief is used: answer inbound calls, answer common questions from the knowledge base, take messages, and arrange call backs. |
| **Website**             | Optional | Voxworks visits this site so your receptionist knows your business. Same research behaviour as scripts, including verbatim FAQs.                                                                                                             |
| **Knowledge Documents** | Optional | Same formats and limits as scripts; parsed into the receptionist's knowledge base.                                                                                                                                                           |

The modal titles read **Generate Receptionist** and **Generating Receptionist**, and the log follows receptionist-specific steps (building the greeting, instructions, and message flow). The generated receptionist has a consistent call structure:

* A **greeting** spoken word-for-word at the start of every call.
* A **reception hub** that works out what the caller needs and directs the conversation.
* A **take-a-message** branch that captures the caller's name, number, and reason for calling.
* An **offer-callback** branch for callers who ask to speak with a person — newly generated receptionists have no transfer destination configured yet, so they offer a call back instead until you set one up.
* A **wrap-up** step that confirms next steps and ends the call.

The Max Call Duration is set to 600 seconds by default. When generation completes, the receptionist appears in the **AI Receptionists** list, and **Open Receptionist** takes you to the receptionist editor to assign a phone number and finish setup — see [AI Receptionist overview](/receptionist/overview).

***

## Failures and retries

Generation retries automatically. Each job is attempted up to 3 times:

* If an attempt fails — for example, the AI returns output that fails validation — the log shows "Error: (reason) - will retry." and the job re-runs. Completed website research is kept between attempts, so retries do not re-crawl your site.
* If the final attempt fails, the log shows "Error: (reason) - max attempts reached." and the modal returns to the input form so you can adjust your inputs and generate again.
* If the request cannot be submitted at all, the error appears in the log immediately (for example, "Error: Could not reach the server. Please try again.").

A failed generation does not add a script to your list — there are no partial scripts to clean up. If a generation repeatedly fails on the same inputs, try shortening the description or removing very large documents.

***

## Next Steps

* [Creating a Script](/scripts/creating-a-script) — the other creation methods: from a template, from an existing script, or from scratch
* [Script Editor Guide](/scripts/editor-guide) — review and refine every part of the generated script
* [Knowledge Base](/scripts/knowledge-base) — where researched FAQs and document facts land, and how to keep it lean
* [AI Receptionist Overview](/receptionist/overview) — finish setting up a generated receptionist with a number and tools
