DEV Community

Cover image for Create a CRUD AI Agent in 5 Seconds
Thomas Hansen
Thomas Hansen

Posted on • Originally published at ainiro.io

Create a CRUD AI Agent in 5 Seconds

If Satya Nadella is right, and SaaS indeed is Dead, and AI Agents will replace all existing SaaS offerings, because it's "mostly CRUD with basic business logic" - The remaining question becomes; "How can you create a CRUD-based AI Agent?" We just happen to know the answer to that question.

CRUD Explained

CRUD implies Create, Read, Update, and Delete, and is the axiom around which your data evolves. Almost no developer thinks consciously about this, but both HTTP and SQL are based upon CRUD. HTTP has verbs that is in a one to one relationship with CRUD, and so does SQL. You can see the list of these associations below.

  • Create - POST / INSERT
  • Read - GET / SELECT
  • Update - PUT / UPDATE
  • Delete - DELETE / DELETE

This implies that if you can extract meta data from your database, you can generate CRUD apps that propagates meta data from the structure of your database, through the HTTP layer, ending up as function declarations the LLM can execute. The process is based upon meta programming, in a homoiconic graph-based programming language, strongly influenced by declarative constructs. We refer to this programming language as Hyperlambda - But relax, there's no need to learn Hyperlambda - The machine will for the most parts assemble your code automatically.

The CRUD Generator

One of our core components in Magic Cloud is its CRUD generator. This component allows you to wrap almost any database into an HTTP CRUD API. Once you've generated your CRUD API, you can just as easily generate AI functions wrapping each CRUD function. This gives you everything required to perform CRUD operations towards your database from the LLM. Look at the following screenshot illustrating the final result to understand what I'm talking about here.

CRUD AI Agent

You can try it out for yourself below. Remember to choose the "chinook" type before you start playing with CRUD operations, and ask the LLM to "list all functions" if you're curious about what it can do.

I need to emphasise that I created the above AI Agent literally in a couple of seconds, and you can see the entire process in the above video. Of course, for a production ready AI agent, we will typically spend much more time, polishing it with quality assurance and prompt engineering.

Business Logic

This implies there's only one remaining thing required according to Satya Nadella, which is the business logic parts. Most business logic can rapidly be added to these AI functions using declarative constructs when using Magic. You can see an example below.

Adding Business Logic to your AI Agent

The above will automatically modify your Hyperlambda code to send an email according to your instructions once executed. The process isn't perfect, and it could benefit from some simplifications - But basically, with both of these constructs we now have everything required to completely replace any SaaS offering according to Satya Nadella.

Combining the above with the ease of adding business logic into your apps as AI workflows, this implies that coding is almost optional today to deliver fully working apps.

Is SaaS Dying?

According to Nadella SaaS is dying. His reasoning is that AI agents can rapidly replace any existing SaaS offering, because (and I quote Satya here) "it's mostly CRUD with some simple business logic." With platforms such as Magic Cloud, creating AI agents with CRUD and business logic can be done in seconds.

This doesn't imply that SaaS as a business model is about to die - Quite the contrary! Most who develop these types of AI agent-based apps, will probably chose to deliver these using monthly subscriptions. We're a great example of that ourselves - Although we're technically not a SaaS company, but rather a PaaS company. However, if you play around with my CRUD AI agent here, it will rapidly become painstakingly obvious that this is a really big deal. It basically changes how we work, to the point where it's barely recognisable from the way we used to work.

This implies that existing SaaS providers, such as HubSpot and SalesForce, will see a lot of their existing value proposition evaporate. This is inevitable because building an AI Agent-based alternative is simply too easy, and the end value for the customer is also much better. I'd much rather have a CRM system that allows me to use natural language to navigate it, than "a bajillion" buttons and dropdown lists making it almost impossible to navigate the frikkin' thing. If I need help with an AI Agent, I can simply ask it for help. If I need help with SalesForce, I got to sign up for a 3 week long course, wait for a month before there's an available spot, and spend a couple of months before I understand how to use the frikkin' thing. Implying ...

Your existing knowledge is counter productive for your ability to make a living

Which becomes true, because you as a software developer have an "investment bias", resulting in that you will inevitable clinge to what was an intelligent choice before AI agents became a viable option. Since AI agents changes every single parameter, your existing knowledge is "mostly useless", because who needs an expert in ReactJS capable of creating 500 different GUI widgets, when the only remaining GUI is a textbox and a response div?

Wrapping up

With platforms such as our Magic Cloud, you can generate code. This is different from AI-generated code, in that it's using meta information, and not relying upon having the LLM generate code. Only after the code is generated, the LLM plays a vital role in using the system.

With CRUD generators such as ours, allowing you to declaratively add business logic, either with prompt engineering or declarative programming - Everything changes! With Magic this implies that you can literally create a lot of apps by simply clicking a button, having the machine create the code. This is why our slogan at AINIRO is as follows ...

Where the Machine Creates the Code

This changes everything, and creates opportunities in time and space, impossible to imagine for most of us just a few years ago. SaaS as a business model is probably not dying anytime soon, but existing SaaS vendors will have difficulties catching up - Because any schmuck with a CRUD generator can simply replace their entire value proposition in a couple of hours. If you want a conclusion, let's try to create one.

SaaS is Dead, Long live AI Agent-based SaaS, based upon CRUD and declarative business logic

So basically, SaaS died, but it came back to life a couple of seconds later 😃

Top comments (2)

Collapse
 
dyfet profile image
David Sugar

SaaS has been replaced by SASS, Smart Ass Software Services ;) (or if the marking folks requires it, Smart Ai Software Services). But yes, then you can say you have sass ;).

Collapse
 
polterguy profile image
Thomas Hansen

Hahaha, I will totally steal that one :D