technow

Retrieval Augmented Generation Database

Lately, I have been thinking the possibility of database operations without SQL language, getting inspiration from RAG. That database would eliminate a need of learning a SQL language to be able to interact with relational and the NoSQL databases. This does not mean that SQL knowledge won’t have value anymore, the point is that you could still be productive using just natural langage (at least for the most basic database operations I was able to test).

The tools you need

For the sake of testing, I just used a simple database Sqlite3, Gemini API, and a few lines of code to create 5 records into the database I want to test using natural language. This demo is limited to the most simplistic tasks such as deleting, updating, inserting, and data retrieval from your backend data store. So, the initial database had 5 entries I randomly picked.

Image1

I started with retrieving the data for the database using human language instead of SQL language, and I got results I wanted.

Image1

Next, I prompted a bot to make changes to the database and commit all those changes. The intent was to update John Doe's age.

Image1

Also, I could insert a new student (James Day) to the database

Image1

Finally, I asked that the new student gets removed from the database and that happened as well.

Image1

Conclusion

The concept of an "AI people's DB" presents an intriguing possibility for simplifying database interactions through natural language processing and AI technologies. By eliminating the need for complex SQL syntax, such a system could democratize access to database management, enabling users to interact with data using everyday language. Next time we will see how we could visualize the data, do analysis and possibly incorporate some privacy and security safeguards for that data.