Member-only story
How To Use LLMs To Turn English Instructions Into Executable SQL
An Overview of the Vanna Python Package
With the ever-increasing adoption of Large Language Models (LLMs), it’s now possible to create applications and develop programs with the most underrated programming language: English.
The promise is simple. You express what you need in natural language. Then, an agent interprets your query and turns it into executable code.
Does this look unrealistic?
It did a few years ago, but with the fulgurant evolution of Generative AI, this recently has become easier than ever.
In this post, I’ll first start by explaining how it’s possible to build a text-to-SQL system using modern NLP techniques.
Then, I’ll show you how Vanna.ai leveraged these principles to build a unique AI-based text-to-SQL solution.
I’ll cover how the solution works, what features it provides and I’ll walk you through an interactive demo I built using it.
After reading this post, you’ll first understand how to leverage LLMs and vector databases for generative tasks that are not limited to text to SQL.
Then you’ll understand what Vanna does, how you can train it on your data without leaking the content, and how you can use it from Python code.
Without further ado, let’s have a look 🔍
If you’re interested in practical tips to increase your productivity in building ML systems, you feel free to subscribe to my newsletter.
I send weekly insights in programming and system design to help you ship AI products faster.
What is Vanna?
As the landing page beautifully puts it, Vanna.AI is a “Python-based AI SQL agent trained on your schema that writes complex SQL in seconds.”