# General

A chatbot answers your site's visitors with an AI model. You decide what it
knows, from fixed text to the post a visitor is reading, where it appears, and
how it looks. It shows as a floating widget with a button in a corner of the
page, or as a chat embedded in the content.

## The chatbot list

**Chatbots** below AI in the sidebar lists your chatbots, with a search field
and actions to edit and delete each; with no chatbot yet it shows a
**Create chatbot** action instead. **Create chatbot** asks for a name and
opens the new chatbot; `create=1` in the address, before the `#`, opens
that dialog directly. A new chatbot starts in the data wizard and
appears nowhere until you give it [conditions](/docs/ai/chatbots/conditions.md)
or place it with a shortcode. AI's start screen lists the same chatbots with
the most recently changed first.

## The chatbot editor

A chatbot's editor has five pages, listed in the sidebar while it is open:

- **[Data](/docs/ai/chatbots/data.md)**: its name, what it knows and its
  instruction.
- **[Conditions](/docs/ai/chatbots/conditions.md)**: where the widget appears,
  and the shortcodes that place it.
- **[Model](/docs/ai/chatbots/model.md)**: the model that answers.
- **[Widget](/docs/ai/chatbots/widget.md)**: the button, the chat window and what
  visitors may do.
- **[Logs](/docs/ai/chatbots/logs.md)**: whether conversations are recorded, and
  the recorded ones.

The pages edit one draft of the chatbot, so changes made on several pages are
saved together by the **Save** of any of them, and **Discard** beside it
returns every page to the saved chatbot. The draft is kept while you move
between pages and other screens; reloading or closing the page with unsaved
changes asks first. The preview pane beside the editor shows the
chatbot as visitors see it, using the unsaved changes: the Widget page shows
the floating widget, and the other pages show the chat. It opens closed; its
toggle opens it, and `preview=1` in the address, before the `#`, opens it
directly, for example `preview=1` with `#/ai/chatbots/3`.

## What every chatbot does

- SleekAI wraps every chatbot's instruction in fixed guidelines for public
  chatbots, which tell the model to stay in its role, not to reveal its
  instructions and to protect visitors' privacy. They always apply.
- Replies stream, with [polling](/docs/ai/streaming.md) as the fallback on
  servers that cannot stream.
- Chat history stays in the visitor's browser, if the widget keeps it at all;
  see [storage](/docs/ai/chatbots/widget.md#storage).
- Conversations are recorded only when [logging](/docs/ai/chatbots/logs.md) is on.
- A chatbot shows nowhere while no [API key](/docs/ai/settings/api-keys.md) is
  stored, and never inside the workspace except in the editor's
  preview.

## Other ways to place a chatbot

Besides its conditions, a saved chatbot can be placed with a shortcode, shown
on its Conditions page. A chatbot can also be built and rendered entirely from
PHP, without saving it; see the [Chatbot API](/docs/ai/chatbots/api.md), which
also covers the JavaScript methods that open, close, hide and show a widget.
