> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Use ClickHouse Assistant chat in ClickHouse Cloud

> Guide to enabling and using the AI Chat feature in ClickHouse Cloud Console

export const Image = ({img, alt, size}) => {
  return <Frame>
      <img src={img} alt={alt} />
    </Frame>;
};

> This guide explains how to enable and use the AI Chat feature in the ClickHouse Cloud Console.

<Steps>
  <Step>
    <h2 id="prerequisites">
      Prerequisites
    </h2>

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

  <Step>
    <h2 id="open-panel">
      Open the AI Chat panel
    </h2>

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

    <Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/0q6iTuCC0qup5NC4/images/use-cases/AI_ML/AIChat/1_open_chat.png?fit=max&auto=format&n=0q6iTuCC0qup5NC4&q=85&s=e77811dbefdccf1e35e802edbb786f71" alt="Open AI Chat flyout" size="md" width="1762" height="1364" data-path="images/use-cases/AI_ML/AIChat/1_open_chat.png" />
  </Step>

  <Step>
    <h2 id="consent">
      Accept the data usage consent (first run)
    </h2>

    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.

    <Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/0q6iTuCC0qup5NC4/images/use-cases/AI_ML/AIChat/2_consent.png?fit=max&auto=format&n=0q6iTuCC0qup5NC4&q=85&s=342ae169e4f7fdc8b1a87cb64f062273" alt="Consent dialog" size="md" width="1342" height="922" data-path="images/use-cases/AI_ML/AIChat/2_consent.png" />
  </Step>

  <Step>
    <h2 id="modes">
      Choose a chat mode
    </h2>

    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.

    <Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/0q6iTuCC0qup5NC4/images/use-cases/AI_ML/AIChat/3_modes.png?fit=max&auto=format&n=0q6iTuCC0qup5NC4&q=85&s=8a9328a61a539d956455737c3166948d" alt="Mode selection" size="sm" width="584" height="262" data-path="images/use-cases/AI_ML/AIChat/3_modes.png" />
  </Step>

  <Step>
    <h2 id="compose">
      Compose and send a message
    </h2>

    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.
  </Step>

  <Step>
    <h2 id="thinking-steps">
      Understanding “Agent” thinking steps
    </h2>

    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.

    <Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/0q6iTuCC0qup5NC4/images/use-cases/AI_ML/AIChat/4_thinking.png?fit=max&auto=format&n=0q6iTuCC0qup5NC4&q=85&s=6e3e129403c5898ac64a9c753774f824" alt="Thinking steps" size="md" width="1702" height="1180" data-path="images/use-cases/AI_ML/AIChat/4_thinking.png" />
  </Step>

  <Step>
    <h2 id="new-chats">
      Starting new chats
    </h2>

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

  <Step>
    <h2 id="history">
      Viewing chat history
    </h2>

    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.

    <Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/0q6iTuCC0qup5NC4/images/use-cases/AI_ML/AIChat/5_history.png?fit=max&auto=format&n=0q6iTuCC0qup5NC4&q=85&s=b46e36b845d568ed737553769f0b3923" alt="Chat history list" size="md" width="1754" height="634" data-path="images/use-cases/AI_ML/AIChat/5_history.png" />
  </Step>

  <Step>
    <h2 id="sql-actions">
      Working with generated SQL
    </h2>

    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.

    <Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/0q6iTuCC0qup5NC4/images/use-cases/AI_ML/AIChat/6_result_actions.png?fit=max&auto=format&n=0q6iTuCC0qup5NC4&q=85&s=1a19bf6b2471aeb2e94312999662a322" alt="Result actions" size="md" width="1746" height="1362" data-path="images/use-cases/AI_ML/AIChat/6_result_actions.png" />

    <Image img="https://mintcdn.com/private-7c7dfe99-fix-nav-issues/0q6iTuCC0qup5NC4/images/use-cases/AI_ML/AIChat/7_open_in_editor.png?fit=max&auto=format&n=0q6iTuCC0qup5NC4&q=85&s=8f8d3af270aeb29ee82d1a10553b0af1" alt="Open generated query in editor" size="md" width="1662" height="284" data-path="images/use-cases/AI_ML/AIChat/7_open_in_editor.png" />
  </Step>

  <Step>
    <h2 id="interrupt">
      Stopping or interrupting a response
    </h2>

    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.
  </Step>

  <Step>
    <h2 id="shortcuts">
      Keyboard shortcuts
    </h2>

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