> ## 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.

![setting up Collate AI](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)

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

![Install Collate AI](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)

* 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.

![automatically generate descriptions](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)

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

![Schedule Collate AI](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)

## 2. Using the Collate AI Chatbot

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

![chatbot icon](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)

* 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.

![natural language questions](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)

* 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.

![metadata usage workflows](https://mintcdn.com/collatedocs/lyQrThlmh8cYozqe/public/images/collate-ai/fixing-sql-queries-1.png?fit=max\&auto=format\&n=lyQrThlmh8cYozqe\&q=85\&s=cbef588c35d56b3637e0c48059b460e0)

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

![Optimize this query](https://mintcdn.com/collatedocs/lyQrThlmh8cYozqe/public/images/collate-ai/fixing-sql-queries-3.png?fit=max\&auto=format\&n=lyQrThlmh8cYozqe\&q=85\&s=2adab45713d2d5ea1955cdcfa77b04fe)

* 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.

![Can you fix this query](https://mintcdn.com/collatedocs/lyQrThlmh8cYozqe/public/images/collate-ai/fixing-sql-queries-4.png?fit=max\&auto=format\&n=lyQrThlmh8cYozqe\&q=85\&s=5f2ffb7ec7ab00584fa013b22350aadd)

## 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.

![reviewing Generated Metadata](https://mintcdn.com/collatedocs/lyQrThlmh8cYozqe/public/images/collate-ai/reviewing-generated-metadata.png?fit=max\&auto=format\&n=lyQrThlmh8cYozqe\&q=85\&s=62eb5453a3b4e8dc98d56f3fe1536f8d)

* 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.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.