Skip to main content

Magic Public Beta

๐Ÿ”ฎ Hex Magic Public Betaโ€‹

Weโ€™re very excited to announce that Hex Magic โ€“ our suite of AI augmentation tools โ€“ is moving into public beta. This gives all Hex users a powerful set of AI-driven features to help you do more with data.

Magic lets you use AI to generate, edit, debug, and document code right from your Hex project, with a deep contextual understanding of your code and data.

Opt-in to Hex Magic by visiting your Hex user preferences (Settings โ†’ Preferences) and toggling on the Magic option. Users on Pro, Teams, and Enterprise plans get unlimited Magic usage, and users on Community have 100 Magic requests per month.

As a reminder, this is a beta. Magic โ€“ like all AI features โ€“ is subject to errors, hallucinations, and mistakes. Please use it with care!

Hex Magic is not yet available for workspaces on EU or HIPAA compliant stacks.

๐Ÿง™ New Magical Powersโ€‹

Hex Magic gives you access to 5 Magic tools: Generate, Edit, Explain, Fix, and Explode. Youโ€™ll find the Magic menu in the top right corner of SQL, Python, Markdown, and R cells.

For tips, tricks, and a detailed list of examples of how to use Magic, check out the documentation.

Hex Magic overview

๐Ÿช„ Generateโ€‹

ex: show me all orders placed in the last 30 days for > average order price.

Magic Generate lets you ask for code and queries with natural language. Describe what you want to generate in plain English, being as specific as possible, and hit Enter. As Magic thinks, you'll see the generated code begin to fill in below.

Magic has context on your tables and schemas, so you really can just ask natural language questions and Magic will map to the most relevant tables!

โœ๏ธ Editโ€‹

ex: change this query to look at unusually small orders.

Magic Edit works just like Generate, but for modifying existing code and queries. If you trigger Magic in a cell that already has code, it'll default to edit mode.

You can ask Magic Edit to do anything to your code, from answering a totally different question to performing manual tasks like renaming every table reference. As Magic thinks, you'll see edited code begin to fill in alongside the previous code, with a line-by-line diff of the changes made.

๐Ÿ“ Explainโ€‹

Magic explain automatically documents code โ€“ whether itโ€™s something you wrote, or something unfamiliar youโ€™re seeing for the first time. It works similar to a Magic edit, so you'll see the documented code with comments stream back word-by-word.

Magic explaining some pandas and matplotlib code

๐Ÿฉน Fixโ€‹

Magic fix automatically detects and fixes errors in your code. Whenever a cell returns an error, Magic begins preparing a fix, which can be applied with the "Magic fix" button in the error output.

Here, Magic's just fixing a missing commaโ€” but it can solve complex issues, and resolve multiple problems at once rather than step-debugging through them all.

Magic fixing a simple SQL error

๐Ÿ’ฅ Explodeโ€‹

Magic explode takes CTEs and "explodes" them into individual chained SQL cells. This can make complex queries more easy to debug, understand, and iterate on.

Explode makes use of query mode, so your exploded queries will not add any additional runtime over the original CTE.

๐Ÿท๏ธ Bonus: Renameโ€‹

Naming things is hard easy with Magic. You can ask Magic to rename a cell based on the code within it, to keep your project neatly organized.

Other improvementsโ€‹

  • When you click the New Project button, youโ€™ll be greeted with a much friendlier empty state โ€” it now take exactly two clicks to go from the Hex homepage to a working SQL cell. For workspaces with multiple data connections, Admins can also now designate a Default data connection that (you guessed it) the first SQL cell will default to.
The new blank project screen
  • You can now sign up for Hex with your personal email, and spin up a free-forever workspace for any side projects or portfolio work. Or if youโ€™re a data consultant, you can create separate workspaces to hand off to each of your clients.

  • We also made improvements to our workspace switcher so you can quickly see which email(s) you're authenticated with, and transition between different workspaces.

  • When the output of a SQL query has caching enabled, paging through the results will now be significantly snappier. ๐Ÿซฐ

  • We fixed a bug that was making dataframe SQL on w i d e tables far slower than it needed to be.

  • Weโ€™ve made improvements to engine that aggregates data for charts, speeding up chart runtimes along the way. (You might be sensing a theme hereโ€ฆ)

  • Finally, we also made some improvements to how we write the results of a project to our database, making projects and apps much faster to render results.