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

# AI Assistant

<Info>
  Bytebase sends the following info to the configured AI provider:

  * Tables and column names of the current database schema.
</Info>

Here is a video demoing this feature:

<iframe width="100%" height="320" src="https://www.youtube.com/embed/3qGyad0RK50?si=UO0M98Brd0ByY2aC" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="allowFullScreen" />

## Setup

Enable [AI Assistant](/ai-assistant). Afterward, an OpenAI icon will appear on the SQL Editor.
Clicking the icon will toggle the AI Assistant sidebar.

<img src="https://mintcdn.com/dbx/yhR4_AKNF_MEUOA1/content/docs/sql-editor/ai-assistant/toggle.webp?fit=max&auto=format&n=yhR4_AKNF_MEUOA1&q=85&s=0c4be6f0a5f691bbd343208598fcb72a" alt="sql-editor-text-to-sql" width="946" height="550" data-path="content/docs/sql-editor/ai-assistant/toggle.webp" />

## Text2SQL

Use natural language to compose SQL and execute.

<img src="https://mintcdn.com/dbx/yhR4_AKNF_MEUOA1/content/docs/sql-editor/ai-assistant/text-to-sql.webp?fit=max&auto=format&n=yhR4_AKNF_MEUOA1&q=85&s=d5db65ac75741a205380f4c1534097b9" alt="sql-editor-text-to-sql" width="1059" height="835" data-path="content/docs/sql-editor/ai-assistant/text-to-sql.webp" />

## Explain SQL

For complex statements like stored procedures, you can ask AI Assistant to explain.

<img src="https://mintcdn.com/dbx/yhR4_AKNF_MEUOA1/content/docs/sql-editor/ai-assistant/explain-sql.webp?fit=max&auto=format&n=yhR4_AKNF_MEUOA1&q=85&s=caa1067f293733a0730a2033c178db11" alt="explain-sql" width="1061" height="850" data-path="content/docs/sql-editor/ai-assistant/explain-sql.webp" />

## Find problem

AI Assistant can spot SQL problems.

<img src="https://mintcdn.com/dbx/yhR4_AKNF_MEUOA1/content/docs/sql-editor/ai-assistant/find-problem.webp?fit=max&auto=format&n=yhR4_AKNF_MEUOA1&q=85&s=e44837f4951a1e84115edcdabd593d42" alt="find-problem" width="1060" height="654" data-path="content/docs/sql-editor/ai-assistant/find-problem.webp" />
