Skip to main content
MindsDB empowers organizations to harness the power of AI by abstracting AI models as Generative AI Tables. These tables are capable of learning from the input data and generating predictions from the underlying model upon being queried. This abstraction makes AI highly accessible, enabling development teams to use their existing SQL skills to build applications powered by AI.

What are Generative AI Tables?

Generative AI is a subfield of artificial intelligence that trains AI models to create new content, such as realistic text, forecasts, images, and more, by learning patterns from existing data. MindsDB revolutionizes machine learning within enterprise databases by introducing the concept of Generative AI tables. These essentially represent AI models as virtual database tables, capable of producing realistic outputs given certain inputs.
Generative AI Tables streamline the process of making predictions based on your data, thereby allowing developers to tap into the comprehensive ecosystem of state-of-the-art Generative AI using simple SQL statements. To better understand this concept, let’s have a deeper exploration in the use case of generating automated responses to emails coming from customers. First let’s look at the data that we have. In this case, imagine that you have a table with incoming emails.
On execution, we get:

Creating a Generative AI-Table

We can for example create an OpenAI model that will generate a response given some prompt_template instructions written in plain English.
Now that we generated our AI Table, we can query for messages and their generated responses using JOINs.
Results in:

Difference between AI Tables and Standard Tables

To understand the difference, we can go over a much simpler example, here we will see how traditional database tables are designed to give you a deterministic response given some input, and Generative AI Tables are designed to generate an approximate response given some input. Let’s consider the following income_table table that stores the income and debt values.
On execution, we get:
A simple visualization of the data present in the income_table table is as follows: Income vs Debt Querying the income table to get the debt value for a particular income value results in the following:
On execution, we get:
And here is what we get: Income vs Debt chart But what happens when querying the table for an income value that is not present there?
On execution, we get:
When the WHERE clause condition is not fulfilled for any of the rows, no value is returned. Income vs Debt query When a table doesn’t have an exact match, the query returns an empty set or null value. This is where the AI Tables come into play! Let’s create a debt_model model that allows us to approximate the debt value for any income value. We train the debt_model model using the data from the income_table table.
On execution, we get:
MindsDB provides the CREATE MODEL statement. On execution of this statement, the predictive model works in the background, automatically creating a vector representation of the data that can be visualized as follows: Income vs Debt model Let’s now look for the debt value of some random income value. To get the approximated debt value, we query the mindsdb.debt_model model instead of the income_table table.
On execution, we get:
And here is how it looks: Income vs Debt model