# Quickstart

This guide creates an agent, gives it your content to answer from, and puts it on your website. It takes about ten minutes and one script tag.

Source: https://www.duvi.ai/docs/quickstart

## Before you start

Building an agent does not draw on your credit balance, so you can complete every step below before a customer sees it.

You need three things:

- **A verified Duvi account.** The agent list stays locked until you verify the email on the account.
- **Content for the agent to read.** Files, a website address, or both.
- **Somewhere to paste a script tag.** Your CMS, your theme, or a tag manager. There is no build step and no package to install.

## Create an agent

1. **Name the agent**

   Open **Agents** and select **New agent**. Enter a name. Duvi creates the agent and opens its builder conversation, which is the default place to finish setup.
2. **Choose a model and a voice**

   Ask the builder to select a model, plus a transcriber and a voice if the agent will take calls. You can also open Configure and select them directly. Studio adds up the latency of all three so you can see what an answer costs in time before you commit to it. See [Model and voice](https://www.duvi.ai/docs/model-and-voice).

   Chat mode decides which controls the widget shows: `text` shows a message box, `voice` shows a call button, and `both` shows a message box with a microphone.
3. **Write the system prompt**

   Say what the agent does, who it is talking to, and what it must never do. Six short labelled sections work better than one long paragraph. See [System prompt](https://www.duvi.ai/docs/system-prompt) for the sections and a worked example.
   ```text title="system prompt"
   You answer questions about Duvi plans and credits for
   customers who already have an account.

   Answer only from the knowledge you were given. If the answer
   is not there, say so and offer to take their details.

   Never quote a price that is not in the price list.
   ```

> **Keep facts out of the prompt**
>
> Duvi sends the system prompt with every exchange, so anything pasted into it is billed on every turn. Prices, policies and opening hours belong in [Knowledge](https://www.duvi.ai/docs/knowledge), where retrieval sends only the passages that match the question.

## Add knowledge

Open the **Knowledge** tab. Select files from your account library, or add a website address for the agent to crawl. You can use both on the same agent.

The crawler reads `robots.txt` first and takes its page list from the sitemaps declared there, so your site decides what gets indexed. See [Knowledge](https://www.duvi.ai/docs/knowledge) for the full crawl rules.

Saving re-reads every source from the start. The agent keeps answering from its existing index while the new one builds, so there is no gap in service. The Knowledge tab shows one of four states: Pending, Indexing, Ready or Failed.

Wait until the status reads **Ready** before you judge an answer. Pending and Indexing need time. Failed needs you to inspect the source. See [Indexing states](https://www.duvi.ai/docs/knowledge#indexing-states).

## Embed the widget

Open **Appearance** before launch if the widget needs your logo, a different color, a clearer launcher label or starter prompts. Appearance changes the website widget only; it does not change the agent’s answers. See [Appearance](https://www.duvi.ai/docs/appearance).

Open **Channels** and copy the snippet. Paste it before the closing `body` tag on every page the agent should appear on.

```html title="index.html"
<script src="https://ceronica.duvi.ai/scripts/chat-bot-widget.js" defer></script>
<digiiq-chatbot agent-id="YOUR_AGENT_ID"></digiiq-chatbot>
```

Then open **Security** and add your domain under **allowed domains**. Add the `www` version as well if you use it, because Duvi matches on hostname and treats them as separate entries. An empty list lets any site embed your agent. See [Allowed domains](https://www.duvi.ai/docs/security#allowed-domains).

> **The agent id is public**
>
> The agent id appears in the page source of every site you embed on. It opens a conversation with this agent and nothing else: no account access, no files, no credits. The allowed domains list is what limits its use.

## Test the agent

Ask the agent five questions you already know the answer to, and one you know it cannot answer. Check two things: that it finds the right fact, and that it says it does not know rather than inventing an answer. See [Testing](https://www.duvi.ai/docs/testing) for the full list, including the difficult conversations worth trying.

****

It answers, but from the wrong page

Two sources disagree. Open Knowledge, remove the stale source, and save to reindex. If both sources must stay, state in the system prompt which one wins.

****

It says it has no information about anything

Check the knowledge state. If it reads Failed, Duvi replaced nothing and the agent is answering from an empty index. A scanned file with no text layer is the usual cause.

****

The widget does not appear on my site

Compare the hostname in your browser address bar against the allowed domains list. Duvi treats `www.example.com` and `example.com` as separate entries.

For symptoms across every part of the product, see [Troubleshooting](https://www.duvi.ai/docs/troubleshooting).

> **What this costs**
>
> Building the agent is free. Credits go on the conversations it handles, and the length of each exchange matters more than the number of exchanges. See [Credits](https://www.duvi.ai/docs/credits).
