The rise of artificial intelligence has led to the disruption of sectors and reshaping how we function. AI has already demonstrated its vast potential to boost performance and output in many industries, learning from data we input and carrying out functions that were previously only performed by humans.
Generating new ideas can help you approach a challenge or opportunity from a different angle. An excellent growth hack for quickly coming up with new ideas is integrating OpenAI with Baserow. You can ask a question, come up with a title for a blog post, or get assistance in formulating a response to a message.
With a relational database like Baserow, you can organize your data in a structured way with the familiarity of a spreadsheet interface. However, Baserow databases are far more powerful than traditional spreadsheets, and can handle larger amounts of data. If you haven’t already, try one of our 60+ templates to help quickly create databases for your website, CRM, apps, or CMS.
This tutorial will show you how to integrate OpenAI’s GPT-3.5 and GPT-4 with Baserow. We will set up automation to generate new and innovative ideas from new topics added to a table, without leaving the database.
These are the steps we’ll take:
We will integrate no-code tools to create ideas stories, business plans, character descriptions, and marketing slogans.
These are the tools we need:
Make.com (formerly Integromat) is an automation tool that lets you connect different apps and services to automate workflows and repetitive operations.
The OpenAI API is powered by a diverse set of models with different capabilities which include language models that can understand and generate text: GPT-4, GPT-3.5 and GPT-3. ChatGPT is an AI chatbot that uses GPT-3’s language model to interact with humans in a conversational way.
By the end of this tutorial, you’ll have a fully automated workflow to create ideas stories, business plans, character descriptions, and marketing slogans, saving you time and effort. We’ll demonstrate how to use Make to prompt GPT-3 to generate text automatically depending on a given prompt in a Baserow table.
First, log into Baserow. Then, create a group by selecting the ‘+ Create group’ button in the dashboard.
Name your group, and select the ‘Add group’ button.
Once you’ve created a group, add a database from scratch to the newly-created group.
When you create a new database from scratch, a new table will be created. The database contains key tables for our idea generation.
In this tutorial, we will create a Baserow database called “Idea generation” and within it, are two tables. One for qualifying prompts (Table A - Topics) and the other for generated ideas (Table B - Ideas).
In table A, we want to add the list of topics and prompts. Add the following fields to the table:
|Field name||Field type|
|Topics||Single line text|
We want to use the formula field to dynamically create creative prompts based on our Topics field to brainstorm some ideas on a topic or question.
The prompt serves as an instruction and makes it clear the list of ideas we want to generate.
Giving the model a clear and specific prompt to write about will help it produce more focused and relevant content. Brainstorm new ideas for creative content, messaging or marketing campaigns.
We’ll use the help of OpenAI and Make to use our topics or questions from table A to generate 5 creative ideas in our Ideas table.
In table B, we want to populate the list of generated ideas and link to the corresponding rows in table A. Baserow provides a graphical interface that allows users to create tables and define relationships easily. Add the following fields to the database table:
|Field name||Field type|
|Ideas||Single line text|
|Prompt||Link to table|
Within your Baserow user account, you can create multiple unique database tokens that allow Baserow to connect with other apps. You can create and find the database token under your account settings.
Database tokens provide similar functionality to login credentials, but they provide additional security and flexibility. A token, like your username and password, should be kept secure and handled with the utmost confidentiality.
Creating database tokens is available to all Baserow users; you don’t need to be on a paid plan.
OpenAI endpoints can be used for various tasks such as content or code generation, summarization, expansion, conversation, creative writing, style transfer, and others. OpenAI API uses API keys for authentication.
Create a free OpenAI account. After logging in, click on the account tab at the top right corner of the screen. Then select “View API keys” from the menu options to retrieve the API key we’ll use in our requests.
Remember that your API key is a secret. Do not share it with others or expose it in any client-side code.
Next, we want to make requests via Make (formerly Integromat).
We want OpenAI to produce a list when prompted. Once we have our list, we can populate these ideas as new rows on Baserow.
To get started, create a new Make account or log into your existing account. Then create a scenario and add modules to the scenario.
https://api.baserow.io, otherwise, replace the URL with your self-hosted URL.
You should get a response back that resembles the following:
Now, let’s brainstorm some ideas related to a topic whenever a new row is added to a table.
Next, we will pass the command into a field to run an API request. The API will generate a list of ideas from the instructions or context in the Prompt field.
This will create an array of 5 results.
Now we have the results with an array. Because we want to generate a row for each idea, we need to loop through all AI responses to create new rows.
Make’s Iterator module is a special type of module that converts an array into a series of bundles. Each array item will be outputted as a separate bundle.
The goal of iteration is to prompt Make to populate all of the ideas from a single prompt to Baserow in a single operation, regardless of the number of ideas generated. As a result, this step automatically loops through all the responses to create a Baserow row for each response.
If the name of a piece of data in Make ends in brackets like this:
[ ], that indicates that the data is represented as an array. In this case, “Choices” is an array, as you can see in the screenshot below, so we can input it into the array field.
The iterator won’t take any actions by itself. Any modules added after the iterator will instead execute once for each item in the array. Next, we want to populate table B with the ideas generated.
We’ll use the same database as in the first Baserow module. But, the table ID will be the one we want to store the AI ideas generated.
Our scenario is set up and ready to activate, but we may still need to run a quick test. Run the scenario, Make will load the prompt and store the data in the Baserow database.
The Iterator will split the array of results into single bundles, each bundle with one result will then be added one at a time in the selected table.
Let’s jump back to Baserow. Check your Baserow table B for the responses and there are five new creative ideas! The related row will also be populated in the linked table A.
Specify when and how frequently an activated scenario runs. To do so, go to the scenario detail page and locate the Schedule tab or click on the clock icon to set a preferred schedule.
To set the schedule, adjust the Run scenario to set the time when it should run.
Save and activate the scenario by toggling on the scheduling switch at the bottom left corner. Now that the automation is set up, you can create new topics in table A to generate ideas immediately, without leaving your database.
Using the API to connect to our favourite apps helps us get the most out of Baserow, extending customization and functionality. You can send prompts, receive responses, and generate new ideas or versions of topics by integrating OpenAI and Baserow.
Organisations stand to gain significantly from AI automation. Still, it is helpful to carefully assess its effects and make sure that people continue to play a crucial role in business processes. While some processes may be automated, like with any new technology, people still play an essential part in designing, deploying, and maintaining these systems.
If you run into an issue while following the tutorial, feel free to reach out to ask for help in the Baserow community.
What’s your use case? Tell us how you use Baserow
Today we are releasing Baserow 1.15 with personal views, today() and now() formula functions, timezone support, and much more.
Want to write a post in collaboration with us?How to contribute?