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

# Generate and analyze data insights

> Use natural language to generate SQL commands so you can query domains and analyze data insights.

Generating data insights involves leveraging the Ask feature to automatically generate an SQL command using natural language.
This command analyzes ingested data so that you can notice predictable patterns and events that deviate from these patterns.

## Prerequisites

* Appropriate permission: `nx1_ask`
* An existing domain created using [DataHub](/platform-components/datahub)
* A previously ingested dataset within a DataHub domain

## Generate and analyze data insights

<Tabs>
  <Tab title="Web portal" icon="browser">
    1. Log in to NexusOne.
    2. On the top navigation bar, hover your mouse over **AI** and then select **Ask**.
    3. Select a domain relevant to your data.
    4. Query the data using one of the following methods:
       * Select a suggested query from the list.
       * Enter a question in the **Add an analysis** field and then click the arrow button to proceed.
    5. Analyze the data insight on the [Metabase](/platform-components/metabase/metabase-in-nx1) dashboard within the NexusOne page or open Metabase on a new tab by clicking the Metabase icon.
    6. Optional: To delete the current Ask query and restart the process, click **Delete**.
  </Tab>

  <Tab title="CLI" icon="square-terminal">
    Use the following `nx1` commands to:

    * [Ask a question about a data domain](/cli-reference/nx1/ask).
    * [Generate suggested questions](/cli-reference/nx1/suggest).
  </Tab>

  <Tab title="REST API" icon="code">
    Use the following API endpoints to:

    1. [Get a list of available domains](/api-reference/endpoints/metastore/get-domains).
    2. [Ask a question about a data domain](/api-reference/endpoints/queries-formerly-cards/asks-question-about-a-data-domain)
       or [generate suggested questions](/api-reference/endpoints/queries-formerly-cards/generates-suggested-questions).
    3. [Create a query for a Metabase card](/api-reference/endpoints/queries-formerly-cards/creates-query-for-a-card).
    4. Optional:
       1. [Retrieve queries](/api-reference/endpoints/queries-formerly-cards/retrieves-queries).
       2. [Delete a query by its ID](/api-reference/endpoints/queries-formerly-cards/deletes-a-query-by-id).
  </Tab>
</Tabs>

## Additional resources

* For full instructions about how to ingest a file in NexusOne, refer to
  [How to ingest a file](/documentation/data-pipeline/tasks/ingest/ingest-a-file).
* For more information about roles or permissions, refer to
  [Govern Overview](/documentation/govern/overview).
