# Publish your bot

{% hint style="warning" %}
Please note that [data retention ](/bot-answers/data-retention.md)are not published from the DRAFT to the LIVE version of your bot. If you would like to have the same data retention settings in your LIVE version as in your DRAFT version, please set up the data retention on that version directly.
{% endhint %}

### Understanding the DRAFT version

When you're building your bot, you do so in the DRAFT version of that bot. When you surf to [app.chatlayer.ai](http://app.chatlayer.ai/), you always start building in DRAFT.&#x20;

The DRAFT version is the one you use to build your bot. It's where you can make changes to the bot, test out flows, and work on the NLP. Once you're happy with your bot and want to push it towards your customers, you need to publish a LIVE version of your bot.&#x20;

As part of the latest update, you now have the convenience of switching between live and draft mode using a simple button located on the top navigation bar.

<figure><img src="/files/4z72PFGXHmenwGVCq6Oe" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
The Draft versions of our bots are not built to handle production traffic as Live versions are. Using a Draft bot for customer-facing communications can result in delays and performance issues, as well as reflect immediately to customers

To ensure optimal performance, always publish your bot and connect your customer-facing channels to the Live version of your chat or voicebot. Use your Draft version and channels for iterations and tests before publishing a new Live version.
{% endhint %}

### Understanding the LIVE version

After publishing your bot, you can view the published version under the 'History' tab to keep track of all the changes made and when they were published.

<figure><img src="/files/JyE9S6B85LCMx89Lbk3G" alt=""><figcaption></figcaption></figure>

Switching to the live version provides you with immediate access to the latest version of your bot, including all the flows you have just published. This version of your bot users will interact with, and any changes made to it will have an immediate impact.

<figure><img src="/files/XOEHaPAy1t1OBx3V5AcP" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
We recommend not changing any data or configurations directly in your LIVE environment as this can break the bot that your customers are actively using.&#x20;
{% endhint %}

### Publishing options

There are three distinct publishing options:

1. **Publish:** This action releases both flows and NLP to the live version.
2. **Publish Selected Flows:** Use this option to publish specific flows only. NLP will remain unaffected.
3. **Publish NLP:** Select this option when you want to publish only your NLP, leaving the flows unchanged.

### 1. Publish

* Once your changes are complete, simply click on the 'Publish' button located next to the live/draft switcher button and select the 'Publish' option to make your updates live and visible to the live version.
* Before publishing your chatbot, it is important to ensure that your NLP model is up-to-date. To make this process easier, we have added an 'Update NLP' button which can be found in the 'Publish' menu. Don't forget to update your NLP model to ensure that your chatbot provides the best possible experience for your users.

<figure><img src="/files/NkXosE7jv20M4GhxNspt" alt=""><figcaption></figcaption></figure>

* When creating a new version of your bot, you can add notes to help you keep track of the changes made in that specific version. This is especially handy when multiple people are working on the same bot.

<figure><img src="/files/BzVTLeVYiBX8kXwlACTm" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Depending on the size of your bot, publishing could take a while. Relax, your bot is on its way!
{% endhint %}

### 2. Publish selected flow

Now you can select a specific flow to publish. This can be useful if you only want to make updates to a specific flow and don’t want to publish the entire project. Please read the full documentation [here](/publish/publishing-your-bot/publish-a-flow.md).&#x20;

### 3. Publish NLP

Publishing your NLP model has never been easier. Simply click the 'Publish' button and select 'Publish NLP' to make your NLP model live.

<figure><img src="/files/MX27rCIZBRuIMaKy2wP5" alt=""><figcaption></figcaption></figure>

Take into account that:

* You must have **published to the live** version at least once.&#x20;
* The NLP needs to be trained **before** publishing it.&#x20;
* You cannot publish just the NLP if no NLP changes have been made since the last publish.&#x20;
* You cannot publish just the NLP if intents have been removed from your DRAFT version since the last publish. This is to avoid showing flows that are linked to intents that no longer exist. That means that removing intents from the LIVE version is only possible through 'Publish full bot'. Adding new intents to LIVE with 'Publish NLP Only' on the other hand, is possible.

{% hint style="info" %}
Different NLP models in different environments will never be 100% identical. There are random factors inherent to this kind of machine learning that create different results, even with the same data. These differences are usually small, but in some cases where intents are very similar, the differences can be more apparent and lead to significant differences in confidence or entirely different classifications.&#x20;
{% endhint %}

## Maintaining the bot

Once your bot is live and users are talking to it, you can keep making changes to your bot in the DRAFT version. Once your changes are final, you can publish a new LIVE version of your bot. The existing version of your LIVE bot will then be overwritten with your current DRAFT version.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chatlayer.ai/publish/publishing-your-bot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
