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

# Ask Sherloq AI

> Sherloq AI is your assistant inside the editor.

<img src="https://mintcdn.com/sherloq-31da1dfe/tD9AIrHANoNaF5Xm/images/chat_usecase.png?fit=max&auto=format&n=tD9AIrHANoNaF5Xm&q=85&s=06568a5fa0cddffa608518036e84295e" alt="Sherloq AI Chat" width="2064" height="1764" data-path="images/chat_usecase.png" />

## What is it?

Sherloq AI is your assistant inside the editor.\
You can ask it things like:

> **"How to filter out the exclude folder?"**\
> **"Why is this query using a LEFT JOIN?"**\
> **"Fix syntax error in this query"**

It reads the queries you’ve saved in Sherloq and gives answers that are **based on your real SQL**, not generic advice.

## How to use it

1. **Open Sherloq AI**\
   Click the Sherloq badge in your editor to open the chat.
2. **Ask a question**\
   Type your question in natural language — no need to write SQL.
3. **See the answer with real SQL examples**\
   Sherloq highlights the relevant logic and explains each part clearly.

***

<img src="https://mintcdn.com/sherloq-31da1dfe/ZD1BvcX8WQjPZQn2/images/sherloqaichat_example.png?fit=max&auto=format&n=ZD1BvcX8WQjPZQn2&q=85&s=bd70fd7582963884e3edf9dcf1f34494" alt="Sherloq AI Chat" width="500" height="962" data-path="images/sherloqaichat_example.png" />

## Example: Filtering Folders

🖼️ Here’s what it looks like when you ask a question like\
**“How to filter out the exclude folder?”**

### What this does:

* Joins the `query_folders` table on `parent_id`
* Excludes deleted folders (`deleted_at IS NULL`)
* Filters out names with terms like `monthly`, `weekly`, `template`, etc.

You’ll get both the **SQL** and the **explanation**—so you can learn or adjust it as needed.

## Tip: Ask About Anything

Try things like:

* *“What does this CASE WHEN mean?”*
* *“Can you rewrite this to use CTEs?”*
* *“How to join deals with customers?”*
* *“Fix this BigQuery syntax error”*

Sherloq AI is powered by the queries your team has already written, so it’s always relevant.
