How to Use the SingleStore ChatGPT Plugin

YD

Yaroslav Demenskyi

Growth Engineer

How to Use the SingleStore ChatGPT Plugin

SingleStoreDB is the ideal contextual database to power modern generative AI applications — including those built with your own data on ChatGPT. And today, the SingleStore plugin is available for ChatGPT-4, allowing you to query your database in English.

Here’s how to get started:

installing-the-pluginInstalling the Plugin

Open the ChatGPT version 4 page:

Go to “Settings & Beta, and activate plugins.

Hover over the GPT-4 tab to access the plugins store.

Once you’re in the store, enter SingleStore in the search bar.

We already have the plugin installed here, which is why you’re seeing the “uninstall” button. But if you’re accessing the button for the first time, you’ll click “install” and follow the installation steps. During the last step of the installation, you will need to log in to the SingleStore portal. This is required to save subsequent database connection configurations, and create Notebooks.

Activate the plugin after installation.

If all the steps have been followed correctly, you can now use the plugin.

using-the-singlestore-chat-gpt-pluginUsing the Singlestore ChatGPT Plugin

In our example, we will be using a database with 2,000 books.

First, familiarize yourself with the available functionalities of the plugin by typing “Show this plugin’s operations.”

Now you know what operations are available in the plugin — some of them are only necessary for ChatGPT to better understand the context.

Next, you need to connect to the database (SQL/Mongo databases are supported). To connect to a database, type: Connect to a SQL/Mongo database. In our example, we will connect to the SingleStore Kai™ database.

This operation will return a link to store the database configuration, which will be used for subsequent queries to the database. It's important to note that this link is one-time-use and expires after five minutes.

After clicking the "Connect to a database" link, a configuration window will open where you need to enter the address and name of the database.

After storing the configuration, the tab will close, signaling that you can now execute queries in the database.

If you click on the used link again, you will receive the following message:

Now the following functionalities are available:

  • Database structure analysis
  • Execution of aggregate queries
  • Creation of Notebooks
  • Display of all Notebooks you’ve created

To start, you should explore the database structure by typing: Show my db structure.

Now ChatGPT knows the collections and fields that exist in our database, and you can perform aggregate queries. Next, I will show you a few example queries.

As you can see, the plugin is capable of executing both simple and more complex queries. You can experiment and test different queries to meet your requirements.

Now, we can create a Notebook. You can create a Notebook for the current session or simply write: "Create a notebook that ... with ... name."

In our example, we will create a Notebook for all the previously written queries.

Once you download the Notebook, you can open it and view its contents. If there's anything you want to change in the content, you can always ask ChatGPT about it.

To view all the Notebooks you've created, type: Show my notebooks.

interested-in-doing-more-with-chat-gpt-single-storeInterested in doing more with ChatGPT & SingleStore?

We’ve got plenty of helpful tools and tips — including an upcoming webinar on building for the ChatGPT plugin store, which you can register for here.

You can also check out these additional resources:


Share