AI Assistant

DataLab features an OpenAI-powered AI Assistant that helps DataLab users to code better and smarter.

AI Assistant Features


With "Chat", you can have a conversation with the AI Assistant to get insights from datasets, or to help you solve a data problem. The AI will answer with text, or add code to your notebook to answer the problems you're asking. To use it:

  • Click on the "Chat" toggle at the bottom of your notebook.

  • Click on one of the suggested prompts or ask a question of your own.

  • You can use the 📎 icon to attach a data source for the AI Assistant to consider when answering your questions.

Generate code

With "Generate", you can write what you want to do in natural language (e.g. English), and the AI assistant will produce a code or text snippet to achieve your intent. To use it:

  • Create a new or select an existing text, code or SQL cell

  • In the cell menu, click "Generate".

  • In the prompt that appears, type what you want to AI to do and hit Enter.

  • If the cell didn't have any content, a suggestion will start streaming in. If the cell already had content, after the suggestion is finished, a diff-view will be shown displaying the suggested changes.

Fix Error

When you make a mistake in your code, you'll see a suggestion to "Fix Error". If you click this button, the AI will try to suggest a fix to your code and attempt to explain the code.

How it works

For a schematic overview of how the AI assistant works, see the visual below:

Beyond merely sending your prompt to OpenAI, DataLab adds additional context to the prompt, such as other variables that are defined in the workbook, the schema of connected databases (if any), previous code cells written, etc. Compared to copy pasting a prompt into ChatGPT, this approach generates way better suggestions because of all the additional information.

What data is being shared with OpenAI?

  • DataCamp nor OpenAI uses customer data to train models: the code or context that you pass to OpenAI will not appear as an answer to someone else's prompt.

  • DataLab sends workbook metadata to OpenAI. Database Metadata like table names, column names and types, and workbook context like previously written code and names and types of variables are sent over to OpenAI to improve the quality of the suggestion.

  • DataLab sends the output of code cells to OpenAI. The execution output of code cells is sent over to OpenAI to improve the quality of follow-up suggestions.

  • DataLab only sends data to OpenAI when you use AI features. If you decide not to use AI features, or your group admin has disabled the AI Assistant, no metadata or output is sent over to OpenAI.

  • DataCamp is ISO 27001 certified, as are these AI features. Your data is protected by solid security practices and policies. For an overview of all our safeguards, visit this page.

As a group admin, it is possible to enable or disable the AI assistant for your group; learn more in Manage group settings.

Last updated