|
| 1 | +--- |
| 2 | +slug: /use-cases/AI_ML/AIChat |
| 3 | +sidebar_label: 'AI Chat' |
| 4 | +title: 'Using AI Chat in ClickHouse Cloud' |
| 5 | +pagination_prev: null |
| 6 | +pagination_next: null |
| 7 | +description: 'Guide to enabling and using the AI Chat feature in ClickHouse Cloud Console' |
| 8 | +keywords: ['AI', 'ClickHouse Cloud', 'Chat', 'SQL Console', 'Agent', 'Docs AI'] |
| 9 | +show_related_blogs: true |
| 10 | +sidebar_position: 2 |
| 11 | +--- |
| 12 | + |
| 13 | +import Link from '@docusaurus/Link'; |
| 14 | +import Image from '@theme/IdealImage'; |
| 15 | +import img_open from '@site/static/images/use-cases/AI_ML/AIChat/1_open_chat.png'; |
| 16 | +import img_consent from '@site/static/images/use-cases/AI_ML/AIChat/2_consent.png'; |
| 17 | +import img_modes from '@site/static/images/use-cases/AI_ML/AIChat/3_modes.png'; |
| 18 | +import img_thinking from '@site/static/images/use-cases/AI_ML/AIChat/4_thinking.png'; |
| 19 | +import img_history from '@site/static/images/use-cases/AI_ML/AIChat/5_history.png'; |
| 20 | +import img_result_actions from '@site/static/images/use-cases/AI_ML/AIChat/6_result_actions.png'; |
| 21 | +import img_new_tab from '@site/static/images/use-cases/AI_ML/AIChat/7_open_in_editor.png'; |
| 22 | + |
| 23 | +# Using AI Chat in ClickHouse Cloud |
| 24 | + |
| 25 | +> This guide explains how to enable and use the AI Chat feature in the ClickHouse Cloud Console. |
| 26 | +
|
| 27 | +<VerticalStepper headerLevel="h2"> |
| 28 | + |
| 29 | +## Prerequisites {#prerequisites} |
| 30 | + |
| 31 | +1. You must have access to a ClickHouse Cloud organization with AI features enabled (contact your org admin or support if unavailable). |
| 32 | + |
| 33 | +## Open the AI Chat panel {#open-panel} |
| 34 | + |
| 35 | +1. Navigate to a ClickHouse Cloud service. |
| 36 | +2. In the left sidebar, click the sparkle icon labeled “Ask AI”. |
| 37 | +3. (Shortcut) Press <kbd>⌘</kbd> + <kbd>'</kbd> (macOS) or <kbd>Ctrl</kbd> + <kbd>'</kbd> (Linux/Windows) to toggle open. |
| 38 | + |
| 39 | +<Image img={img_open} alt="Open AI Chat flyout" size="md"/> |
| 40 | + |
| 41 | +## Accept the data usage consent (first run) {#consent} |
| 42 | + |
| 43 | +1. On first use you are prompted with a consent dialog describing data handling and third‑party LLM sub-processors. |
| 44 | +2. Review and accept to proceed. If you decline, the panel will not open. |
| 45 | + |
| 46 | +<Image img={img_consent} alt="Consent dialog" size="md"/> |
| 47 | + |
| 48 | +## Choose a chat mode {#modes} |
| 49 | + |
| 50 | +AI Chat currently supports: |
| 51 | + |
| 52 | +- **Agent**: Multi‑step reasoning over schema + metadata (service must be awake). |
| 53 | +- **Docs AI (Ask)**: Focused Q&A grounded in official ClickHouse documentation and best‑practice references. |
| 54 | + |
| 55 | +Use the mode selector at the bottom-left of the flyout to switch. |
| 56 | + |
| 57 | +<Image img={img_modes} alt="Mode selection" size="sm"/> |
| 58 | + |
| 59 | +## Compose and send a message {#compose} |
| 60 | + |
| 61 | +1. Type your question (e.g. “Create a materialized view to aggregate daily events by user”). |
| 62 | +2. Press <kbd>Enter</kbd> to send (use <kbd>Shift</kbd> + <kbd>Enter</kbd> for a newline). |
| 63 | +3. While the model is processing you can click “Stop” to interrupt. |
| 64 | + |
| 65 | +## Understanding “Agent” thinking steps {#thinking-steps} |
| 66 | + |
| 67 | +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. |
| 68 | + |
| 69 | +<Image img={img_thinking} alt="Thinking steps" size="md"/> |
| 70 | + |
| 71 | +## Starting new chats {#new-chats} |
| 72 | + |
| 73 | +Click the “New Chat” button to clear context and begin a fresh session. |
| 74 | + |
| 75 | +## Viewing chat history {#history} |
| 76 | + |
| 77 | +1. The lower section lists your recent chats. |
| 78 | +2. Select a previous chat to load its messages. |
| 79 | +3. Delete a conversation using the trash icon. |
| 80 | + |
| 81 | +<Image img={img_history} alt="Chat history list" size="md"/> |
| 82 | + |
| 83 | +## Working with generated SQL {#sql-actions} |
| 84 | + |
| 85 | +When the assistant returns SQL: |
| 86 | + |
| 87 | +- Review for correctness. |
| 88 | +- Click “Open in editor” to load the query into a new SQL tab. |
| 89 | +- Modify and execute within the Console. |
| 90 | + |
| 91 | +<Image img={img_result_actions} alt="Result actions" size="md"/> |
| 92 | + |
| 93 | +<Image img={img_new_tab} alt="Open generated query in editor" size="md"/> |
| 94 | + |
| 95 | +## Stopping or interrupting a response {#interrupt} |
| 96 | + |
| 97 | +If a response is taking too long or diverging: |
| 98 | + |
| 99 | +1. Click the “Stop” button (visible while processing). |
| 100 | +2. The message is marked as interrupted; you can refine your prompt and resend. |
| 101 | + |
| 102 | +## Keyboard shortcuts {#shortcuts} |
| 103 | + |
| 104 | +| Action | Shortcut | |
| 105 | +| ------ | -------- | |
| 106 | +| Open AI Chat | `⌘ + '` / `Ctrl + '` | |
| 107 | +| Send message | `Enter` | |
| 108 | +| New line | `Shift + Enter` | |
| 109 | + |
| 110 | +</VerticalStepper> |
0 commit comments