LangChain - Dynamic Routing - Retrieve data from different databases

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ต.ค. 2024

ความคิดเห็น • 14

  • @bharathjc4700
    @bharathjc4700 หลายเดือนก่อน

    Great inputs appreciate for insights

  • @yazanrisheh5127
    @yazanrisheh5127 5 หลายเดือนก่อน

    Thanks for the video! I have 3 questions:
    1)Can you explain the def route(info) function? I'm a bit confused.
    2)Also, what if my file that I wanna talk to in natural language consists pdfs and tables? Should I store that in vectorstore? For example a research paper
    3) Instead of having several templates where 1 executers sql query and then the other converts it to natural language, couldn't you have used the python agent which executes the SQL commands directly and displays the answer? I thought of it in terms if you had 1000+ users and it would cost time/money if you are passing through multiple templates. What do you think?

    • @yashthakkar2629
      @yashthakkar2629 4 หลายเดือนก่อน

      Did you find the solution if so please let me know. I am working on something similar to this

    • @yazanrisheh5127
      @yazanrisheh5127 3 หลายเดือนก่อน

      @@yashthakkar2629 On which exactly

  • @RobertoFabrizi
    @RobertoFabrizi 5 หลายเดือนก่อน

    Thank you for the video. I have one question, because in my example it didn't work out of the box like it did for you. In your example, you ask for the most expensive "dessert", yet in the query you got back category = 'Dessert'. Why did it automatically uppercase the D for you? Dessert is not in the schema, only the category column is, so how did it figure it out? In general though, since you can't rely on how people write things, this seems to require a much more complex prompt that normalizes the input somehow (for example something like always uppercase every value passed in where conditions)

    • @codingcrashcourses8533
      @codingcrashcourses8533  5 หลายเดือนก่อน

      I recommend to always use .lower() to prevent being casesenstive. Would be better :)

  • @elleryleungnews
    @elleryleungnews 5 หลายเดือนก่อน

    Thanks for this example. But I have a question: Let's say I want to build a Business analyst AI, and use database as data source. Now the SQL response is large (e.g. over 1 mil record), it would not be possible to put it in the prompt like that, correct? Then how to solve this problem if I don't vectorise the data and put it in vector store in advance?
    Thank you.

    • @codingcrashcourses8533
      @codingcrashcourses8533  5 หลายเดือนก่อน +1

      You need some aggregations functions or whatever, but you can´t just put this into the context window of an AI.

  • @khushipitroda385
    @khushipitroda385 5 หลายเดือนก่อน

    Hello, I have query related Chromadb, langchain and python,
    I want to extract all data from chromadb and put it in qdrant, for that ive to use get method, but the problem is my data is very large, i cant extract in a variable it'll crash a memory, is there any way we can fetch the data (embeddings as well as metadata) from chroamadb? Thanks :)
    result = vector_db.get(include=["embeddings","metadatas", "documents"])

  • @chregano
    @chregano 5 หลายเดือนก่อน

    Thanks for this! How would you recommend handling a non-trivial schema with 50/60 tables with relations between them?

    • @codingcrashcourses8533
      @codingcrashcourses8533  5 หลายเดือนก่อน +1

      Just dont. Llms can not handle These kind of complexity (yet)

  • @JoEl-jx7dm
    @JoEl-jx7dm 5 หลายเดือนก่อน

    Let me get this straight sorry, the queryies inputed by the user will be embeded into vectors and be stored in the vextordb along with it, It rags through your original db for retrieving the answer to the inputed query?

    • @codingcrashcourses8533
      @codingcrashcourses8533  5 หลายเดือนก่อน +2

      No - the user queries are not stored. The queries are just executed as they are. Plain SQL against Postgres

    • @JoEl-jx7dm
      @JoEl-jx7dm 5 หลายเดือนก่อน

      just give me a simple walkthrough for this, suppose my store got a DB, I would like to retrieve basic existing general information from the db using natural language and i would also like to understand insights from my db to increase sales for my store , so basically I would need a live running db for my store along with a rag system to continuous query about insights from my db also an agent to retrieve some web information that could actually help me increase my sales
      Theme - Tshirt store
      Eg:
      Human: Hey db, what brand tshirts do we sell
      App: we sell x,y,z tshirts
      Human: what's the most sold tshirt this month? And what's the profit we generated?
      App: x tshirt and y profit
      Human: If I want to increase my sales by x %, what specific brand tshirts should i stock up for this month more than usual?
      ..... Also retrieve some trending print tshirt I could use to sell to attract more people?
      How would I achieve something like this, I just need a basic idea