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

# How to Use Collate AI

# How to Use Collate AI

## 1. Setting Up Collate AI

* Navigate to **Settings > Applications** in the Collate platform.

<img src="https://mintcdn.com/collatedocs/lyQrThlmh8cYozqe/public/images/collate-ai/setting-up-collate-ai-1.png?fit=max&auto=format&n=lyQrThlmh8cYozqe&q=85&s=24dce9e2561a164ef8136b91a9ca4dd4" alt="setting up Collate AI" width="4044" height="1944" data-path="public/images/collate-ai/setting-up-collate-ai-1.png" />

* Install Collate AI by following the on-screen instructions.

<img src="https://mintcdn.com/collatedocs/lyQrThlmh8cYozqe/public/images/collate-ai/setting-up-collate-ai-2.png?fit=max&auto=format&n=lyQrThlmh8cYozqe&q=85&s=92bb423eeb93e582297879ab1549a2fa" alt="Install Collate AI" width="3243" height="1500" data-path="public/images/collate-ai/setting-up-collate-ai-2.png" />

* Configure and add filters based on criteria such as owner, schema, database, service, and more. You can also combine multiple conditions to meet your specific requirements.

<img src="https://mintcdn.com/collatedocs/lyQrThlmh8cYozqe/public/images/collate-ai/setting-up-collate-ai-3.png?fit=max&auto=format&n=lyQrThlmh8cYozqe&q=85&s=e776031cf0c68f5ddbf5a4e90d9ed277" alt="automatically generate descriptions" width="3243" height="1500" data-path="public/images/collate-ai/setting-up-collate-ai-3.png" />

* **Scheduling**: Schedule Collate AI to run regularly, automatically generating metadata at predefined intervals (e.g., weekly).

<img src="https://mintcdn.com/collatedocs/lyQrThlmh8cYozqe/public/images/collate-ai/setting-up-collate-ai-4.png?fit=max&auto=format&n=lyQrThlmh8cYozqe&q=85&s=652a75b15d3989195d93860776f4a314" alt="Schedule Collate AI" width="3243" height="1500" data-path="public/images/collate-ai/setting-up-collate-ai-4.png" />

## 2. Using the Collate AI Chatbot

* The Collate AI chatbot icon appears on every page after installation.

<img src="https://mintcdn.com/collatedocs/lyQrThlmh8cYozqe/public/images/collate-ai/using-collate-ai-chatbot-1.png?fit=max&auto=format&n=lyQrThlmh8cYozqe&q=85&s=81bccec6a148af6b96e07ea0de3e77b7" alt="chatbot icon" width="4044" height="1944" data-path="public/images/collate-ai/using-collate-ai-chatbot-1.png" />

* Interact with the chatbot by typing natural language questions. For example:
  * “Show me sales data for Q1.”
  * “What is the average revenue per customer?”

* Collate AI will generate the corresponding SQL query and provide a detailed explanation of the query logic.

<img src="https://mintcdn.com/collatedocs/lyQrThlmh8cYozqe/public/images/collate-ai/using-collate-ai-chatbot-2.png?fit=max&auto=format&n=lyQrThlmh8cYozqe&q=85&s=9b9f46090565002300ae7ec3f4672867" alt="natural language questions" width="4044" height="1944" data-path="public/images/collate-ai/using-collate-ai-chatbot-2.png" />

* Users can refine queries by providing further instructions, and the chatbot will adjust the SQL query accordingly.

## 3. Optimizing and Fixing SQL Queries

* The **Metadata Usage** workflows will ingest the queries being run against the tables. You can see how long each query has been executed in the **Queries** tab.

<img src="https://mintcdn.com/collatedocs/lyQrThlmh8cYozqe/public/images/collate-ai/fixing-sql-queries-1.png?fit=max&auto=format&n=lyQrThlmh8cYozqe&q=85&s=cbef588c35d56b3637e0c48059b460e0" alt="metadata usage workflows" width="4044" height="1944" data-path="public/images/collate-ai/fixing-sql-queries-1.png" />

* If a query runs inefficiently, ask the chatbot to optimize it by typing: “Optimize this query.”

<img src="https://mintcdn.com/collatedocs/lyQrThlmh8cYozqe/public/images/collate-ai/fixing-sql-queries-3.png?fit=max&auto=format&n=lyQrThlmh8cYozqe&q=85&s=2adab45713d2d5ea1955cdcfa77b04fe" alt="Optimize this query" width="4044" height="1944" data-path="public/images/collate-ai/fixing-sql-queries-3.png" />

* Collate AI will return a more efficient version of the SQL query, which you can then copy and execute in your database.

* If the query contains errors or isn’t functioning correctly, ask Collate AI: “Can you fix this query?”

* Collate AI will correct the query and provide a working version.

<img src="https://mintcdn.com/collatedocs/lyQrThlmh8cYozqe/public/images/collate-ai/fixing-sql-queries-4.png?fit=max&auto=format&n=lyQrThlmh8cYozqe&q=85&s=5f2ffb7ec7ab00584fa013b22350aadd" alt="Can you fix this query" width="4044" height="1944" data-path="public/images/collate-ai/fixing-sql-queries-4.png" />

## 4. Reviewing Generated Metadata

* Once Collate AI generates descriptions for tables and columns, navigate to the **database view** to review the metadata.
* You can accept or reject each suggestion individually or choose to accept all suggestions in bulk.

<img src="https://mintcdn.com/collatedocs/lyQrThlmh8cYozqe/public/images/collate-ai/reviewing-generated-metadata.png?fit=max&auto=format&n=lyQrThlmh8cYozqe&q=85&s=62eb5453a3b4e8dc98d56f3fe1536f8d" alt="reviewing Generated Metadata" width="4044" height="1944" data-path="public/images/collate-ai/reviewing-generated-metadata.png" />

* Collate AI allows you to document entire datasets in a matter of minutes, significantly reducing the manual effort required to maintain metadata.

## Best Practices

* **Regular Scheduling**: Schedule Collate AI to run at regular intervals to ensure your metadata is always up-to-date, especially when dealing with frequently changing datasets.
* **Leverage the Chatbot for Query Writing**: Encourage both technical and non-technical users to use the Collate AI chatbot for SQL query generation. It simplifies complex query writing and ensures accurate results.
* **Optimize Queries Regularly**: Monitor the performance of your queries and use Collate AI to optimize them, especially when working with large datasets or queries that require complex joins and filters.
