Note: Insights SQL assistant is a part of Benchling Intelligence. See the Benchling Intelligence page for information on how to request access to Insights SQL assistant and other AI-based features. This feature is in beta, so keep in mind that it is a work in progress.
Note: We recommend that users of the SQL assistant have some SQL experience or are interested in learning.
Running into an error with a query you are working on? Need help modifying an existing query to bring in some additional data? Having trouble getting started creating a new insights block for your team? Let the Insights SQL assistant give you a hand by including special --!
comments that explain what you are looking for or need help with directly in your SQL. The SQL assistant will analyze your SQL, comments, in relation to your warehouse setup to suggest an update to your SQL that hopefully matches your intentions.
Using the Insights SQL assistant
Once you have the SQL assistant feature enabled, you will get a new magic wand button above your SQL:
To distinguish between standard SQL comments --
and comments that you want directed towards the SQL assistant for help, use the --!
comment format to explain what you are looking for or need help with. The assistant will only run if at least one of these comments is found.
After clicking the assistant button, the system will process your request in the context of your warehouse setup to come up with a suggestion. Because this feature relies on AI it can not be guaranteed to output SQL that perfectly matches your intent, or possibly even perfectly valid SQL. In the case the suggestion is determined to be invalid, you will get a red dot and the error will be inserted directly at the bottom of the suggestion.
The left panel, your original SQL, remains read-only and is there to serve as a point of reference for what you will be replacing if you accept the suggestion. The suggestion itself however is fully editable. You may update it or add new --!
comments and retry the suggestion but now with this as the starting point. We find that if the assistant provides invalid SQL, a single retry is generally sufficient to fix the issue and get to working, valid SQL.
When you are ready, clicking the Accept SQL button will replace your original SQL with the suggestion and automatically run the query, showing you the results.
Limitations
- The system is currently optimized around
$raw
tables and doesn't understand the corresponding views well. We recommend not mixing views and$raw
tables in your queries to the assistant as possible. - Retrying the suggestion does not have the context of prior attempts, so you may need to re-add comments to get it to do what you want.
- The amount of detail the assistant gets about your warehouse decreases somewhat as the size of your warehouse increases (number of tables), so for best performance especially in particularly large warehouses (thousands of tables) we recommend explicitly mentioning or including the tables you know you will need in your initial query or comments.
- The assistant can make use of configured parameters, so remember to configure those before invoking the assistant.
- Always validate both the SQL suggestion as well as the resulting output to ensure it matches your expectations. AI based systems, much like humans, are prone to errors, misunderstandings, and ambiguities.
Feedback
Especially during this beta period, we really value your feedback to help us improve this new tool. Using the thumbs up/down buttons helps us get a sense of if the tool is being found useful. You can also click the Tell us more button after that to provide us with an explanation or more detail.
Security and privacy
For more information about the privacy and security for AI-powered features, please see Security and Privacy for Benchling Intelligence.