Robust Text-to-SQL With LangChain: Claude 3 vs GPT-4

preview_player
Показать описание
Generate advanced SQL with LLMs in seconds by building custom LangChain chains.

The code used in the video can be found here:

▬▬▬▬▬▬ V I D E O C H A P T E R S & T I M E S T A M P S ▬▬▬▬▬▬

0:00 The state of Chat-to-SQL

1:22 Connecting to a database (BigQuery) with LangChain

4:10 Using out-of-the-box SQL chains

6:42 Using out-of-the-box SQL agents

10:10 Managing Chat-to-SQL risk

13:02 Creating your own custom SQL chains
Рекомендации по теме
Комментарии
Автор

Great video! Always something new to learn!

andaldana
Автор

what has been your experience with text to pandas dataframe? Is it better than text to sql in terms of complexity?

abhinabaghose
Автор

This is really interesting but I have some concerns about this method, I'd love to hear what you think about them:
1. We are always sending the entire schema as context. If we want to have a large dataset connected to this "application", we will waste a ton of tokens on that. The agent that LangChain built slowly decides which tables might be relevant, thus reducing the amount of tokens used as context. How would you approach something like this?

2. Sometimes, tables and column names might not be super intuitive to the LLM, and without sampling the data, it can assume properties, values or anything else. So this requires the user to review the query and make sure it makes sense, which is what we are kind of trying to prevent when we start using AI for queries. What do you think about adding a semi step that will somehow sample the relevant data?

Shai_Di
Автор

Unable to see the names of the db using but the Database connected successfully, it shows an empty array [], What I'll do?

sahinakhtar
Автор

What happens if he drops the table when hallucinating

SR-zipw
Автор

THIS is function-calling but instead of a "json" u get a "sql query". Am i missing something?

TheBestgoku
Автор

I am late to the game on this video. I have been working on a TextToSQL project. Like most of the examples I have viewed, the LLM can understand the context of columns. From the project I am working on, the names of the columns may have some hint of what the data would be or its use. The schema I have has a date, a reference date, and a delivery date. Delivery date is obvious. There are other fields where the names are not indicative of the values. What happens when you have multiple tables with a large schema? My approach is to use the LLM to build the SQL and not to synthesize, as the amount of data could be quite large.

mrchongnoi
Автор

Hi, great tutorial! How would you implement a chat fuctionality? where you can ask follow up questions??

kelvinadungosi