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

# Assistant in ClickHouse Cloud

> Learn about, enable, and use Assistant in the ClickHouse Cloud console

Assistant lets you use natural language to analyze data in a ClickHouse Cloud service. It can generate queries, visualizations, and summaries using context such as active tabs, saved queries, schemas, and dashboards.

The Assistant also includes a Docs AI mode for asking questions grounded in the ClickHouse documentation. Use this guide to enable the Assistant and work with both modes in the ClickHouse Cloud console.

**1. Prerequisites**

1. You must have access to a ClickHouse Cloud organization with AI features enabled (contact your org admin or support if unavailable).

**2. Open the AI Chat panel**

1. Navigate to a ClickHouse Cloud service.
2. In the left sidebar, click the sparkle icon labeled “Assistant”.
3. (Shortcut) Press <kbd>⌘</kbd> + <kbd>'</kbd> (macOS) or <kbd>Ctrl</kbd> + <kbd>'</kbd> (Linux/Windows) to toggle open.

![Open AI Chat flyout](https://mintcdn.com/private-7c7dfe99/RMrV3JZHbEy3aFh9/images/use-cases/AI_ML/AIChat/1_open_chat.webp?fit=max\&auto=format\&n=RMrV3JZHbEy3aFh9\&q=85\&s=ad98d16b98abcc8875a9fef907045155)

**3. Accept the data usage consent (first run)**

1. On first use you're prompted with a consent dialog describing data handling and third‑party LLM sub-processors.
2. Review and accept to proceed. If you decline, the panel won't open.

![Consent dialog](https://mintcdn.com/private-7c7dfe99/RMrV3JZHbEy3aFh9/images/use-cases/AI_ML/AIChat/2_consent.webp?fit=max\&auto=format\&n=RMrV3JZHbEy3aFh9\&q=85\&s=ff56a1b3e6b5407ff95c4e1e89df7b9a)

**4. Choose a chat mode**

AI Chat currently supports:

* **Agent**: Multi‑step reasoning over schema + metadata (service must be awake).
* **Docs AI (Ask)**: Focused Q\&A grounded in official ClickHouse documentation and best‑practice references.

Use the mode selector at the bottom-left of the flyout to switch.

![Mode selection](https://mintcdn.com/private-7c7dfe99/RMrV3JZHbEy3aFh9/images/use-cases/AI_ML/AIChat/3_modes.webp?fit=max\&auto=format\&n=RMrV3JZHbEy3aFh9\&q=85\&s=e695326686cbf96050905e3f1eb42a1e)

**5. Compose and send a message**

1. Type your question (e.g. “Create a materialized view to aggregate daily events by user”).
2. Press <kbd>Enter</kbd> to send (use <kbd>Shift</kbd> + <kbd>Enter</kbd> for a newline).
3. While the model is processing you can click “Stop” to interrupt.

**6. Understanding “Agent” thinking steps**

In Agent mode you may see expandable intermediate “thinking” or planning steps. These provide transparency into how the assistant forms its answer. Collapse or expand as needed.

![Thinking steps](https://mintcdn.com/private-7c7dfe99/RMrV3JZHbEy3aFh9/images/use-cases/AI_ML/AIChat/4_thinking.webp?fit=max\&auto=format\&n=RMrV3JZHbEy3aFh9\&q=85\&s=23a1a324e86591f69328228de6c7c08d)

**7. Starting new chats**

Click the “New Chat” button to clear context and begin a fresh session.

**8. Viewing chat history**

1. The lower section lists your recent chats.
2. Select a previous chat to load its messages.
3. Delete a conversation using the trash icon.

![Chat history list](https://mintcdn.com/private-7c7dfe99/RMrV3JZHbEy3aFh9/images/use-cases/AI_ML/AIChat/5_history.webp?fit=max\&auto=format\&n=RMrV3JZHbEy3aFh9\&q=85\&s=9b3c8d9265e906889c3ddd18d6d29485)

**9. Working with generated SQL**

When the assistant returns SQL:

* Review for correctness.
* Click “Open in editor” to load the query into a new SQL tab.
* Modify and execute within the Console.

![Result actions](https://mintcdn.com/private-7c7dfe99/RMrV3JZHbEy3aFh9/images/use-cases/AI_ML/AIChat/6_result_actions.webp?fit=max\&auto=format\&n=RMrV3JZHbEy3aFh9\&q=85\&s=1ca9b4c9c987b0dc3fd2c7b0c6d205c6)

![Open generated query in editor](https://mintcdn.com/private-7c7dfe99/RMrV3JZHbEy3aFh9/images/use-cases/AI_ML/AIChat/7_open_in_editor.webp?fit=max\&auto=format\&n=RMrV3JZHbEy3aFh9\&q=85\&s=148eb60e6217aeea2c091ed40fc5e364)

**10. Stopping or interrupting a response**

If a response is taking too long or diverging:

1. Click the “Stop” button (visible while processing).
2. The message is marked as interrupted; you can refine your prompt and resend.

**11. Keyboard shortcuts**

| Action | Shortcut |
| - | - |
| Open AI Chat | `⌘ + '` / `Ctrl + '` |
| Send message | `Enter` |
| New line | `Shift + Enter` |
