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

# Create an agent

> Create a new AI agent with New agent: choose its type, name it, switch on what it can do, then publish it for customers.

Onboarding already created your first agent and set it as the default. Create another agent when a WhatsApp number or website needs different behaviour, for example a support agent that only answers from your policies and a sales agent that recommends products and takes orders. Every agent has its own type (Popcorn's rules with a **Voice**, or custom instructions), capabilities, knowledge, tools and channels.

## Before you start

* Decide the agent's type, which cannot be changed later. An agent on **Popcorn's rules** (recommended) needs no instructions: Popcorn decides how it sells, answers and hands over, and you set its **Voice**. An agent on **Custom instructions** runs on instructions you write, which are then required; **Draft with agent** can write them from a short description. See [Popcorn's rules and Voice](https://docs.trypopcorn.ai/agents/popcorns-rules.md).
* If the agent should answer from your own information, create the knowledge bases and publish their articles first under **Knowledge** in the sidebar (see [Knowledge overview](https://docs.trypopcorn.ai/knowledge/overview.md)).
* **Recommend products**, **Take orders in chat** and **Track orders** work through your connected store (see [Integrations](https://docs.trypopcorn.ai/integrations/overview.md)).
* Plan to publish right after creating the agent. A new agent has no published version, so a WhatsApp number you switch on for it starts answering only after you publish.

## Create the agent

**1. Open New agent**

Click **Agent** in the sidebar, then **New agent**. The **Create agent** page opens. It has the same five tabs as an existing agent: **Instructions**, **Knowledge**, **Actions**, **Handoff** and **Channels**.

**2. Choose the agent type**

On the **Instructions** tab, under **Agent type**, keep **Popcorn's rules** (**Recommended**) or choose **Custom instructions**. "You can't change the type after the agent is created."

**3. Name the agent**

Under **Profile**, fill in **Agent name**. Creating the agent without one shows **Give the agent a name**.

**4. Write the instructions (custom instructions only)**

For a custom agent, describe in **Instructions** your store, how the agent should talk to customers and what it should never do, or click **Draft with agent** to have it write a first draft. Creating a custom agent without instructions shows **Add instructions so the agent knows how to reply**. See [Writing custom instructions](https://docs.trypopcorn.ai/agents/writing-instructions.md). An agent on Popcorn's rules has no instructions field.

**5. Choose knowledge**

On the **Knowledge** tab, switch on each knowledge base the agent may answer from. **New knowledge base** takes you to **Knowledge** if you still need to create one.

**6. Switch on what it can do**

On the **Actions** tab, **Selling and orders** has **Recommend products**, **Take orders in chat** and **Track orders**; **How it replies** has **Send images in chat**, **Share customer details with the agent**, **Split long replies**, **Delay replies** and **Check replies before sending**; **Follow-ups** has **Close resolved chats** and **Follow up when customers go quiet**; **Safety** has **Block spam and off-topic chats** and **Let customers opt out**. Under **Tools**, switch on any custom tools the agent may call (**Add tool** and **Open marketplace** are there if you have none yet). Each setting is described in [Capabilities](https://docs.trypopcorn.ai/agents/capabilities.md).

**7. Set up handing over**

On the **Handoff** tab, switch on **Hand over to your team** if the agent should pass chats to a person, and choose how your team hears about it under **Alerts**. See [Connect knowledge, tools, channels and notifications](https://docs.trypopcorn.ai/agents/connect-knowledge-tools-channels.md).

**8. Create it**

Click **Create agent**. You see **Agent created** and land on the new agent's page. If something did not save you see **Agent created, but some settings didn't save**, or **Agent created, but these tools weren't added** with the tool names: the agent exists with everything else you chose, so check those settings on its page and click **Save and review**.

If a field needs fixing when you click **Create agent**, the tab that holds it shows a count of the fields to fix, and the page opens the first tab that has one.

Some settings are not on the **Create agent** page and wait until the agent exists:

* Connecting a WhatsApp number: the **Channels** tab reads **You can connect WhatsApp numbers after you create the agent.** Switch numbers on from the agent's page (see [Connect knowledge, tools, channels and notifications](https://docs.trypopcorn.ai/agents/connect-knowledge-tools-channels.md)).
* Slack alerts: under **Handoff**, switching on **Slack alerts for handovers** reads **Create the agent first, then connect Slack on its page.**
* The **Voice** of an agent on Popcorn's rules: it starts with the default Voice, which you change on the agent's **Instructions** tab (see [Popcorn's rules and Voice](https://docs.trypopcorn.ai/agents/popcorns-rules.md)).
* **Handover topics**, on the agent's **Handoff** tab (see [Capabilities](https://docs.trypopcorn.ai/agents/capabilities.md)).

## Default values on the form

Every switch starts off except **Let customers opt out**, which starts on. Fields that appear when you switch something on start with these values:

| Field | Starts at |
| - | - |
| **Reply delay, in seconds** (under **Delay replies**) | 14 to 34 seconds |
| **Close after (hours)** (under **Close resolved chats**) | 24 |
| **Number of follow-ups** (under **Follow up when customers go quiet**) | 3, with **Follow-up 1 (hours)**, **Follow-up 2 (hours)** and **Follow-up 3 (hours)** set to 1, 2 and 5 |
| **Minimum reply score (0 to 1)** (under **Check replies before sending**) | 0.6 |
| **Maximum retries** (under **Check replies before sending**) | 3 |

## Publish the new agent

A new agent has no published version yet. Its header shows **Not published yet** and reads "Set up your agent, then save and publish it." Until you publish, a WhatsApp number you switch on under **Channels** does not route to the agent, and the agent cannot be chosen with **Set as default** (the menu item reads **Publish to set as default**).

**1. Make the first save from the agent page**

Change anything on the agent page, for example switch on a WhatsApp number under **Channels**, and click **Save and review**. The first save records the agent as it was when created as a published version with the note **Initial published version**, and your edits become a draft.

**2. Publish**

In the **Publish changes?** dialog, which says "Nothing is published yet, so this will be the first version.", click **Publish changes**. See [Test and publish](https://docs.trypopcorn.ai/agents/test-and-publish.md).

**3. Route conversations to it**

Switch on a WhatsApp number under **Channels** and publish again, paste the **Website chat widget** embed code on your site, or choose **Set as default** from the agent's row menu on the **Agents** page.

> [!TIP]
>
> Use the test chat on the agent page to try the agent before connecting a live number: from 1280 pixels wide it sits beside the settings, and below that the **Test agent** button in the header opens it. Once the agent has a published version, the chat uses it. Test conversations appear in your Inbox and each AI reply uses one credit, like a real conversation.

## The agent onboarding created

The agent created during onboarding is named after your business (for example **Noor Perfumes Assistant**), already has a published version, and starts with a different setup than a blank **New agent**:

* It runs on **Popcorn's rules** with the default **Voice**. Open the agent to change the Voice on its **Instructions** tab (see [Popcorn's rules and Voice](https://docs.trypopcorn.ai/agents/popcorns-rules.md)).
* The knowledge base built from your website pages already connected.
* **Hand over to your team** and **Let customers opt out** switched on.
* **Send images in chat** and **Share customer details with the agent** switched on.
* **Close resolved chats** switched on with a 24-hour window, and **Follow up when customers go quiet** switched on with one follow-up after 1 hour.
* **Delay replies** and **Check replies before sending** switched off.
* **Recommend products**, **Take orders in chat** and **Track orders** off at first. If you connected a store during setup, the second step switches all three on and publishes the change, with the version note "Store connected: the agent can now share products, take orders and track them." Without a store they stay off.

Open it from the **Agents** page to review these settings before you connect a live number.

## Related

> [card] [Popcorn's rules and Voice](https://docs.trypopcorn.ai/agents/popcorns-rules.md)
>
> The two agent types, and how to set an agent's **Voice**.

> [card] [Capabilities](https://docs.trypopcorn.ai/agents/capabilities.md)
>
> What each switch on the **Actions** and **Handoff** tabs does.

> [card] [Connect knowledge, tools and channels](https://docs.trypopcorn.ai/agents/connect-knowledge-tools-channels.md)
>
> Attach knowledge, WhatsApp numbers, Website chat and handover alerts.

> [card] [Test and publish](https://docs.trypopcorn.ai/agents/test-and-publish.md)
>
> Drafts, the publish dialog and version history.


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