AI Assistant

The AI Assistant is a generative AI feature within the SQL Query Editor that provides real-time insights while you author SQL queries against any database in the Customer 360 page.

Assist

Use the AI Assistant to:

  • Ask for help while resolving a SQL error

  • Get advice on how to improve a query

  • Ask questions about SQL syntax, such as “What is the syntax for a window function?”

  • Create SQL queries starting from natural language, such as “Who are my top 100 customers by lifetime spend?” or “Show me everyone who shopped in-store over the last 30 days.”

Important

As with all generative AI capabilities, the outputs of AI Assistant are probabilistic. Users should double check outputs for accuracy.

Review the Privacy FAQ for the AI Assistant to learn more about how the AI Assistant interacts with GPT-4 and the Microsoft Azure OpenAI Service.

Amperity Learning Lab

Amperity Learning Lab

The AI Assistant is a generative AI-based feature that can help you build better SQL queries against the data in your Amperity tenant.

Open Learning Lab to learn more about how the AI Assistant can help you build better queries. Registration is required.

Enable (or disable) the AI Assistant

The AI Assistant may be enabled (or disabled) by a user who is assigned the DataGrid Operator policy.

To disable the AI Assistant

  1. From the Queries page, click Query settings.

  2. Under AI Assistant settings, select the Disable AI Assistant option to disable the AI Assistant.

  3. Click Save.

How the AI Assistant works

The AI Assistant is powered by a private instance of OpenAI GPT-4.

Amperity uses the largest context window that is currently available, and then provides query, schema, results, and error information to the model to help ensure the best chance of generating highly relevant results.

Note

More detail about how the AI Assistant works, including data sharing policies, how the model stores data, and what types of data is sent (or not sent), is available from the AI Assistant Privacy FAQ .

Examples

The following examples show some of the ways you can use the AI Assistant while working in the SQL Query Editor.

Note

The answers to these questions within your tenant will depend on the query, schema, results, and error information that was provided to the model and may be different than the examples shown in this topic.

Ask questions about syntax

You can ask the AI Assistant to help you understand how specific types of syntax work in a SQL query.

Question

“What is the syntax for a CASE statement?”

Answer

The AI Assistant will respond similar to:

Ask questions about syntax

Note

Amperity uses Presto SQL syntax within the SQL Query Editor.

Ask for help resolving errors

When you have an error in your query syntax you can ask the AI Assistant for help resolving the error.

Question

“Can you help me resolve this error?”

Answer

The AI Assistant will respond similar to:

Ask for help resolving errors

Build natural language queries

You can use natural language—the same types of sentences you use when talking to co-workers and friends—to ask the AI Assistant to help you build queries against any database in the Customer 360 page.

Customers by lifetime spend

Question

“Who are my top 100 customers by lifetime spend?”

Answer

The AI Assistant will respond similar to:

Build natural language queries

Tip

When “Tables and fields are valid” is shown for the SQL returned by the AI Assistant you can try running the query in the SQL Query Editor.

Click the Copy SQL link in the response from the AI Assistant, paste the SQL into the SQL Query Editor, click the Run query button, and then (after the query is finished running) you can view the results.

In-store shoppers

Question

“Show me everyone who shopped in-store over the last 30 days.”

Answer

The AI Assistant will respond similar to:

Build natural language queries