Create a Low-Code GPT AI App in Five Minutes
By combining AINIRO with OpenAI's GPTs, you can wrap your entire database in a CRUD app in five minutes, using AI to interact with your database.
Join the DZone community and get the full member experience.
Join For FreeA GPT is basically a custom AI app allowing you to have ChatGPT interact with any API. This results in a completely new user interface, where you're using AI to interact with your application instead of a graphical user interface.
At AINIRO.IO, we're committed to delivering value and amazing tech based on AI, some examples being our ChatGPT chatbot, AI Search, and AI Expert Systems — And now we're adding a fourth type of application to our AI suite; "AI Apps."
What Is an AI App?
With a Magic Cloudlet, you can create an API wrapping your database without coding. This allows you to take any database you have from before, point Magic at it, click a button, and five seconds later, you've got a CRUD API wrapping your database. Since GPTs consume APIs, this allows you to create an entire application based upon your API that uses natural language as its UI. Below is a screenshot of an example app I created in five minutes.
The big deal about the above thing is that little line where it says, "Talked to sales2-team.us.ainiro.io". What ChatGPT does at that point is to access my API and retrieve data according to my instructions. I'm asking for records released by AC/DC, so ChatGPT will invoke my API's "Albums" table, filter on AC/DC, and use the return value as a part of its conversation with me.
ChatGPT is directly accessing my database
I can also create, update, and delete items. Below is an example of how I added "High Voltage" to their discography.
If I tell my GPT app to list all albums by AC/DC again, it will show me three albums now.
ChatGPT With CRUD
Basically, this allows me to do all CRUD operations with ChatGPT, giving me complete access to my database with an "AI User Interface," completely replacing my GUI. CRUD, of course, implies create, read, update, and delete. The really kick-ass thing is that ChatGPT tends to "extrapolate intentions," allowing me to provide much more complex instructions to it, such as, for instance.
Create a new artist using my Chinook action and give my new artist the name "Björk". Then add a new album called "Homogenic" and associate with Björk.
The above results in the following.
It failed twice, possibly due to it being a BETA feature. It is not perfect yet. But after a couple of failed attempts, it was able to automatically continue and finally succeeded. If I ask it to list albums or artists after the insert, it will show one new artist and one new record.
The above instruction to ChatGPT created one new artist and one new album, in one go
AI Business Logic
If you think about what I just did, this implies we can use AI and natural language interfaces to create "business logic" for our apps, where we're using natural language as our interface, and the AI extrapolates what business logic we want for it to use — effectively ending up with an application that has infinite capacity for interactions.
Since CRUD is the axiom which all data-centered apps evolve around, this implies if you've got CRUD, you've got effectively 90% of everything you need to create highly rich AI-based apps, using nothing but natural language as their user interface, providing infinite possibilities for interactions to your end users. Some use cases can be found below.
- CRM systems
- TODO applications such as ClickUp
- Accounting systems such as SAP and QuickBooks
- Headless CMS systems where you're using the AI to interact with your CRM system's database
- Etc, etc, etc
Basically, every time you've got a database in an app, you can use a simple formal CRUD API combined with ChatGPT to interact with that database.
How I Created the App
The app I created is based on 11 tables, but I don't think there's any upper limit to the number of tables. Each table has five CRUD endpoints, giving us a total API endpoint count of 55. The API my above app has, therefore, consists of 55 HTTP endpoints. Notice the 5th API endpoint is for counting records to reduce bandwidth consumption. The total number of lines of code for my app was 2,906 LOC.
What's probably more important than the above facts is how I created the app. You see, I literally created the entire app in 5 minutes using AINIRO Magic Cloud. You can follow the entire process in the following YouTube video.
The above process can easily be duplicated for any database you have, allowing you to create an AI app based on any database in five minutes. The configuration options of the Magic backend generator that creates your CRUD endpoints just so happen to give you almost all configuration options you'll ever need to modify your app according to your requirements. I'm not going to go through all of its configuration options, but to give you a rough idea of its features, you can look at the following screenshot.
Try the App
You can play with the app here. The app is publicly available for everyone. You have to register at OpenAI to access it, and you will use your own ChatGPT tokens when interacting with it - But the database you're using is the same database as everybody else, allowing you to persist items into the Chinook database when you're interacting with it. Below are some sample instructions you can use when interacting with it.
- Count albums using my Chinook action.
- Use the Chinook action and list all customers with the last name of Hansen
- Create a new customer using my Chinook action having the name of John Doe and email john@doe.com
- Count customers using my Chinook action associated with the support representative having a last name of Park
- John Doe is a customer; use the Chinook action to update his email to john@hotmail.com
You have to be "formal" as you speak to it. For instance, it doesn't automatically understand if you're talking about customers, artists, or support representatives if you just throw out a name. You also have to explicitly state you want to use the Chinook action.
Parts of the above issues can be fixed using some intelligent prompt engineering and applying an "instruction" to the app. However, I wanted the app to be in a "vanilla state," implying I did zero changes to it after I was done with the above YouTube video to demonstrate it exactly the way it was as I finished creating it live in the above video. In fact, the only thing I changed after I was done with the above YouTube video was to add an image icon to the app.
Beyond CRUD
Don't believe this is only about CRUD. We've got pre-defined API modules providing you with basically everything you need, and if we don't have these already, we can easily create such API modules, giving you almost anything you can imagine through your AI app. Below are some examples of modules we've already created that you can use in your cloudlet.
- Send email API endpoint allowing you to send emails from your AI app
- Search DuckDuckGo endpoint allowing you to search for information using DuckDuckGo and use it in your AI app
- Etc ...
In fact, we can even provide you with Stripe payments directly from within your AI app, accepting payments through Stripe, assuming you've got a Stripe account from before. The point is that these are stand-alone API endpoints you can use to populate your cloudlet, which again results in automatic GPT integration, allowing you to use any API logic you wish almost through an AI user interface.
Create Your Own Low-Code GPT
Magic is the core of the AI app. Magic happens to be open source. If installing Magic locally is too much of a hassle, we also happen to provide Magic Cloudlets as our flagship product.
With a Magic cloudlet from AINIRO.IO, you also get backup, security, online deployment, your own sub-domain URL, etc. The cloudlet is also deployed in a Kubernetes cluster with multi-machine volumes, further tightening security and reducing the likelihood of data loss, etc. However, if you can't afford a Cloudlet, feel free to play with the open-source version if you're technically savvy enough to set up your own server and deploy Magic to it.
Then watch the above YouTube video a couple of times to understand how to create Low-Code AI apps, and you're probably able to easily, within a few hours, create your own AI app entirely from scratch.
Published at DZone with permission of Thomas Hansen. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments