# Chat

> A chatbot that answers from your knowledge base, with sources visitors can open.

Create a **chat** widget on a knowledge base, pick the sources it may use, add the site domain, then paste the snippet. For mount options, variants, and identity, see [Install](/docs/sdk).

## Create a chatbot

1. Open a knowledge base that already has one or more sources with content. If it does not, [add a source](/docs/ingestion) first.
2. Create a **chat** widget.
3. On **Setup**, choose the sources and add the domain that will host the embed.
4. Save, then copy the snippet from **Install**.

```html
<script src="https://datalumo.app/widget/v1/datalumo.js"></script>
<script>
  Datalumo.chat('ORG_ID/WIDGET_ID').mount();
</script>
```

The widget key is `{organisation}/{widget}`. It is safe to put in HTML.

WordPress and Laravel can place the bubble for you. See those [integrations](/docs/wordpress).

## Look

On **Look**, pick the shape:

| Variant | What visitors see |
|---|---|
| **Bubble** | Floating launcher, default |
| **Sidebar** | Full-height panel that pads the page so content is not covered |
| **Inline** | Fills a container you pass as `target` |

Theme (`auto`, light, dark) and accent colours live here too. `auto` follows the host page when it has a dark/light marker, otherwise the visitor's OS.

Under **Conversation start**, set the first message and up to 6 suggested questions shown as chips on an empty thread. Leave the first message blank to use the built-in greeting in the widget's language.

**Thumbnails** shows a small card under the answer for each cited page that has an image. Off by default. Citation pills in the sentence stay. Pages without an image still use the numbered chips.

## Reply

On **Reply**:

- **Persona.** Tone and role. Blank uses a friendly default.
- **If your content has no answer.** **Say you don't know** (only your sources) or **Use general knowledge** (may fill gaps).
- **Suggest follow-up questions.** After an answer, the bubble can offer a few related questions from pages that reply did not cover. On for new chat widgets. Existing ones stay off until you turn this on. Click one to send it; the list then goes away.
- **Custom instructions.** Click **Add instruction** for each rule the assistant should follow, such as which pages to link or what to avoid.
- **What it can do.** Knowledge search stays on. Optional [chat actions](/docs/chat-actions): allowlisted web search, signed webhooks, and page actions.

Advanced: store query text in analytics, and show images from your sources as thumbnails.

Edits stay pending until you **Save**.

## Answers

Each chat reply uses one answer from your plan. When answers run out, the official embed shows search hits in the bubble instead of calling the model. The HTTP API returns **402** with the same hits. See [Errors & limits](/docs/errors).

## Visitor identity

To keep history for a logged-in visitor, sign their id on your server with the widget's signing secret and pass `user.id` plus `user.hash`. See [signed visitor identity](/docs/sdk#signed-visitor-identity).

Once that is in place, the official chat bubble shows a clock after they have at least one stored conversation. They can reopen an earlier chat, search the list by title, star a chat so it is not removed after 90 days, or delete one. The WordPress plugin can sign logged-in users for you. See [WordPress](/docs/wordpress).

## Custom clients

Building your own UI, or calling chat from a server? Use the [chat endpoint](/docs/widgets#chat). Prefer the embed in the browser.
