Skip to main content

New updates to Hex’s AI tools for data analysis

Today we’re making some updates to our Magic AI assistant that make it more powerful, intuitive, and faster 🤖.

The first version of Magic has been available for almost a year now, and we’re excited about how useful it’s been for our users. Thousands of people each week are using these features to get more done with data: editing complex SQL queries, debugging confusing Python code, and speeding up the most tedious parts of their jobs (cough pandas cough regex).

This round of updates makes these AI tools even more accurate, updates and polishes their UX, and introduces some powerful new functionality. Check out the blog for more (and higher quality) demos, watch this 3 minute video summary, or read on for the quick notes!

➕ Generate mode

Magic can now generate multiple cells at a time in your notebook, chaining together SQL, Python, and Chart cells to answer complex questions or kickstart a new analysis.

It’s easy to invoke this from anywhere: just hit Cmd+G, use from an edit mode prompt bar, or click the “Add with Magic” button between cells.

New cells are all created as drafts, so you can inspect, edit, and validate AI generated code before accepting it. Once accepted, the new cells seamlessly integrate into your notebook.

💬 More powerful, streamlined prompting

To support new cell generation and more complex instructions, we’ve rebuilt the prompt bar, unifying all Magic actions into one simple interface.

You can activate Magic on a cell with Cmd+Shift+M, and seamlessly switch between editing existing cells or generating new cells with the and keys.

The new design also supports more complex multi-line instructions and gives more flexibility to auto-fixes, letting you provide specific instructions instead of relying on Magic to guess what kind of fix you'd like to make.

🎯 Mentioning data

The prompt bar now supports "@ mentioning" datasets to specify what resources it should use.

In any prompt bar, you can hit @ and then keep typing to search for resources.

This is a simple addition, with a huge impact on prompting efficiency and accuracy. Use this to point at a specific database table (handy if you're off-roading and using some unusual, undocumented resources) or if you're in a complex project, to direct Hex towards a particular dataframe.

🤓 Accuracy and context

In addition to these big changes, we’ve also been putting in lots of work on our state-of-the-art retrieval pipelines, and seen steady improvement in Hex’s ability to accurately generate SQL queries. But it’s important to note that no matter how good our engineering is, your context is critical! The more metadata you can provide about your tables and columns, the better Hex can effectively prompt the model and maximize completion quality.

You can do this in three main ways:

  • dbt Docs: if you’re using dbt Cloud, all you have to do is update the metadata in your models, and it’ll automatically flow into Hex and be used to help inform query generation.
  • Support for warehouse metadata: ditto if you update information about your columns and tables in Snowflake, BigQuery, or Redshift.
  • via Hex’s built-in Data Manager, which lets you add and edit metadata, as well as promote and exclude schemas and tables.

Alright, that's what's hot off the presses! I can't wait to hear your feedback on these updates, and to see what you build with a little help from Magic 🧙.