Introducing Smart Block: Build with GPT-4 in Retool

Ken Schumacher
Ken Schumacher
Eng @ Retool

Mar 15, 2023

Smart Blocks have expanded into Retool AI, a suite of features to build bespoke AI-powered tools for your business. Learn more.

We’re introducing the Smart Block in Retool Workflows, bringing the power of GPT-4 into automations.

The Smart Block is available in all Retool cloud instances today. If you’re curious about the step-change improvements GPT-4 offers over GPT-3.5, Retool is one of the first places you can try it out. Get started with 1 GB of Workflows data included for free in every Retool plan, and read on to learn more.

ChatGPT felt transformative upon arrival. Its record-setting ascent to 100 million monthly users just 2 months after launch made that feeling tangible, with companies like Intercom, Supabase, and Notion quickly launching collections of AI features to the public. But for many developers, the tactical application of these models was less clear cut. The distance between a chat interface like ChatGPT and your data makes the interaction non-obvious.

We’re removing that gap, and introducing one of the world's first natural language programming interfaces, with the new Smart Block in Retool Workflows. Retool Workflows is a visual programming environment where you can combine JavaScript code and visual logic blocks to create backend services and recurring tasks. Workflows can connect to any data source and take action based on that data.

With the new Smart Block, you can describe how you want to analyze and act on your data in natural language, with help from OpenAI’s GPT technology. Now, AI and your data can interact on a shared visual canvas.

Treat the Smart Block like a natural programming step in any series of tasks you want to automate. Say you have a list of new leads stored in a Google Sheet, and you want to filter that list based on titles. You can:

  • Create a block by dragging one out from your resource query, and Select “Smart”.
  • Identify the dataset you want to feed into your GPT request. It auto-populates with the output of our most recent resource query: a list of leads and their associated details.
  • Write your instructions to GPT. Be direct in your instruction, and refer to any data with {{ }} syntax.
  • Run the block to return the data. After receiving GPT's result, return data however you want: share the summary with stakeholders via email or Slack, or write it back to a database for later analysis.

An interactive AI playground

With human-level performance on various professional and academic benchmarks, GPT-4 surpasses GPT-3.5 by a significant margin—making the model an even better candidate to help parse any unstructured data. Just a few use cases:

  • Summarize hundreds of rows of raw product data into succinct bullet points, then share that report internally every Friday.
  • Create entirely custom systems to classify and route incoming user questions to the right individual.
  • Set up a personalized newsletter that scrapes stories from your most frequently visited sites, and sends a curated summary to your inbox every morning.

Workflows can directly execute code generated by GPT. Here’s how:

  • Give it instructions to write a SQL query or JS code snippet
  • Pass the output of the Smart Block into a DB query or code block
  • Run that query against your DB schemas and API connections
  • Quickly iterate on getting GPT to deliver the output you need
Execute GPT-Generated Code in a Resource Query

Getting started

We’re excited to see the novel applications you’ll build with Smart Block. During our beta, we’re offering free access to the Smart Block to explore GPT-4 applications. Let me know if you have feedback or just want to share what you’re building!

Check out our documentation for more details on usage and limitations, and sign up for a free account to start building today.


Reader

Ken Schumacher
Ken Schumacher
Eng @ Retool
Mar 15, 2023
Copied