A Natural Language AI (LLM) SQL Database - Could this work?

Поделиться
HTML-код
  • Опубликовано: 29 июн 2024
  • A Natural Language AI (LLM) SQL Database - Could this work?
    👊 Become a member and get access to GitHub and Code:
    / allaboutai
    🤖 Great AI Engineer Course:
    scrimba.com/learn/aiengineer?...
    🔥 Open GitHub Repos:
    github.com/AllAboutAI-YT/easy...
    📧 Join the newsletter:
    www.allabtai.com/newsletter/
    🌐 My website:
    www.allabtai.com
    I take a look at turning a SQL Database into embeddings to use a LLM and RAG to talk in natural language to my data from my SQL DB. Will it work as intened?
    00:00 SQL RAG Db Intro
    01:47 SQL RAG Setup
    05:31 Testing
    08:09 Conclusion
  • РазвлеченияРазвлечения

Комментарии • 44

  • @uberalus
    @uberalus 10 дней назад +15

    This is cool. Thanks for sharing. This "talk to your database" kind of concept is going to be one of the primary use cases in many businesses. If you have time for a part 2 of this, it would be nice if you could experiment with a larger database with multiple tables and relationships, and have the LLM query the database for info and also be able to write queries to retrieve data from that database, as it would be familiar with the data models and relationships between the tables. I don't know how this could be done after the embeddings process, but being able to prompt the following say in a database for a car dealership would be golden: "Give me a list of all vehicles purchased by business xyz from January 2022 to January 2024 in chronological order. For each sale, include a summary of transaction details, if any, along with the the selling agent's contact information and the business' contact information."

    • @dimosdennis
      @dimosdennis 9 дней назад +2

      Great example you got there. I think that the best way to go about it is instead going with embeddings, just have an agent with specific tools in its disposal. Each tool would map to a specific SQL query (for example get_sale(business_id), get_sale_agent(agent_id), etc). This is the proper way i think. You just need to create a DAL, or even use existing repositories - or APIs for that matter - most ERPs should have those already.
      The catch is that those tools would not be that efficient from a DB perspective, but hey, if you know your use cases, you can always add more tools to your agent. I think that this is the way to go.

    • @AllAboutAI
      @AllAboutAI  8 дней назад +3

      Will def to this mare :) hope you dont mind using your comment as my script haha

    • @sedatbvb9947
      @sedatbvb9947 5 дней назад

      As a company, we developed another model for this as well. Love to chat with you. Our main problem in complicated databased were the speed of the answer. we have solved it in a easy way!

  • @hotlineoperator
    @hotlineoperator 10 дней назад +4

    1: Stuctured data -> SQL query
    2. Unstructured data -> LLM query

  • @jrfcs18
    @jrfcs18 10 дней назад +2

    This is good stuff. I agree that this kind of chat with your database has the best use case for businesses. Keep it up.

  • @GeeCeeAte
    @GeeCeeAte 10 дней назад +1

    I’ve been pondering using a rag like this all night and woke up to see this! Haven’t seen it yet. But what a crazy coincidence! Can’t wait to see the vid

  • @myfavorites5513
    @myfavorites5513 10 дней назад +4

    This is awesome. Instead of saving embeddings to a json file, you can save than to and vector database.

    • @AllAboutAI
      @AllAboutAI  8 дней назад

      yes 100% this was just for the demo purpose

  • @Ms.Robot.
    @Ms.Robot. 10 дней назад +2

    Kris dude!
    Alright, let’s get real. This concept of using an AI to talk to databases in plain language is fucking genius. If you pull it off, querying data would be as easy as chatting up your barista. Imagine the power - no more wrestling with SQL, just straight-up questions and instant answers. It's like having a brainiac translator at your beck and call, turning your words into perfect SQL queries. The key will be making sure your AI is sharp enough to handle the nuances and complex stuff without tripping over itself. But if you can nail that, you'll be revolutionizing how we interact with data.

    • @AllAboutAI
      @AllAboutAI  8 дней назад +1

      Thanks a lot mate! Appericiate the feedback :)

  • @nerdg2
    @nerdg2 10 дней назад +2

    its an amazing idea!! lets go forward!

  • @brianscarborough5720
    @brianscarborough5720 10 дней назад +1

    I think this would be very helpful, especially as others have mentioned, using it on a larger DB and multiple tables. Plus, to keep it local, it would be interesting to see it on an sqlite DB. Thanks for these great ideas!

  • @idonotcomplyrevolution
    @idonotcomplyrevolution 10 дней назад +2

    This is something I've already worked on, how we do this is by "injecting" the conversation history/new conversation with the data, only downside is you need a lot of RAM when working with huge data sets or huge folders of files. So the use of SQL or SQL commands are not required, though after watching this I may have a bash using SQL to see if it is worth implementing or increases performance.

    • @AllAboutAI
      @AllAboutAI  8 дней назад

      Very interesting! will look into that aswell

  • @AIInsights23
    @AIInsights23 8 дней назад

    Thanks alot im software asset management consultant SAM we need this very much please do this more, but i saw last on github someone do the same i need to go back and check, God bless you 🙏

  • @cgutierrezinfor
    @cgutierrezinfor 10 дней назад +1

    This is amazing. It will be very great if you build an app web to do this SQL Rag app

  • @j0hnc0nn0r-sec
    @j0hnc0nn0r-sec 10 дней назад +1

    It’s not stupid, but it’s very vulnerable

    • @AberrantArt
      @AberrantArt 10 дней назад +2

      Don't worry, soon we will have tons of regulations and laws around AI.

  • @wawoai
    @wawoai 10 дней назад +1

    This is awesome Kris do you have ideas on how to scale? Maybe to millions of entries? Ty

    • @larshektoen8291
      @larshektoen8291 10 дней назад +1

      Yes, will it work for databases 3-5 Gb ? Any size limit? Maybe chunking?

    • @AllAboutAI
      @AllAboutAI  8 дней назад

      yeha like I said, dunno how this works at scale tho

  • @jay-dj4ui
    @jay-dj4ui 9 дней назад +1

    great idea, however, this is stateless still. We would love to see if we can make a stateful session that can "remember" the vector index data for longer period of time.

    • @AllAboutAI
      @AllAboutAI  8 дней назад

      Yeah thats interesting. tnx for the idea :)

  • @pontiacgtx4801
    @pontiacgtx4801 6 дней назад

    is it possible to do it without embeddings and just query the sql given the schema? like try to ask to get the best sql query for said request on real time
    ?

  • @artur50
    @artur50 10 дней назад +2

    which of your repo is for this ?

  • @gnosisdg8497
    @gnosisdg8497 10 дней назад +1

    how can i access the github? i just pushed my little help to the donation part

    • @AllAboutAI
      @AllAboutAI  8 дней назад

      :D hope you got it! if not send me an email

  • @dumbol8126
    @dumbol8126 10 дней назад +1

    noooo i was working on exactly this since last 2 days now my idea is less orignal

    • @AllAboutAI
      @AllAboutAI  8 дней назад

      haha sorry, how is it going?

  • @edgarl.mardal8256
    @edgarl.mardal8256 9 дней назад +1

    Er du norsk?

    • @AllAboutAI
      @AllAboutAI  8 дней назад

      jaa

    • @edgarl.mardal8256
      @edgarl.mardal8256 8 дней назад

      @@AllAboutAI Kult, jeg driver å bygger en cold sales Agent, men klarer ikke å finne bra TTS materiale, vet du om noe? Eventuelt noen gode LLM? Jeg har en, og skal trene den, men trenger en TTS som er trent om en ikke skal trene den selv også selv da.

  • @paulham.2447
    @paulham.2447 4 дня назад

    Talking to a database since the arrival of AI and LLMs doesn't seem new to me, it's a "game changer" type of use (this should be the immediate priority of all companies that to use it). I don't understand the nuance you seem to bring into this video! What do you mean with SQL, someone to explain to me in two words?