Fantastic walkthrough! I was wondering if you could create a tutorial on how to build a custom Knowledge Retrieval service using Langchain. The idea behind this service is to allow users (multi tenancy) to chat with their uploaded documents in different formats like PDF, CSV, and Text, while ensuring that the data remains accessible only to the user/owner who uploaded the file.
Very clear and great content to follow along! I am able to build a chat app with multiple pdfs with ConversationalRetrievalChain, but not sure how to implement streaming with that. Hope I will see one soon!
hey there. yeah, you can totally implement streaming with conversational retrieval chain. but you would probably need to use the latest version of it. i think that the class-based chains (like the one you mentioned) are not compatible with LCEL but I am not certain. try creating your chain like this: python.langchain.com/docs/expression_language/cookbook/retrieval
This is an amazing video. Extremely helpful. How would you go about sequential chains with this? I have been picking up errors and not sure where to read into this more.
How can we generate an assistant that can provide code after uploading documentation of frame work . Please make something related to this . Thank in advance
that's a bit more tricky since we usually need a lot of context to write good code. gemini 1.5 is capable of doing this afaik. i'll make some videos about this!
How can we do the same streaming with Mixtral LLM? I'm using Mixtral (huggining face inferecing) + Langchain + Streamlit. LLM is used as pandas agent and I want to stream the response.
After watching this video, I am thinking of updating the code for your Multiple PDF Chat Tutorial that I have followed fw months ago. I am considering replacing the existing ConversationalRetrievalChain and BufferMemory with LCEL as demonstrated in the video.
Hey! Really awesome tutorial! Just a bit confused with how the template and the invoke method work together. The user question: {user question} in the template and then {user question: query} in the invoke method. How do they correlate please. Thanks
hey there, great question. the variables in the template are in between curly braces, like {user_question}. these values will be replaced later, when you "invoke" it. and when you run the invoke method on a prompt (or a chain that starts with a prompt), you pass an object that looks like this: { variable_to_replace: "my value" } this will replace all the {variable_to_replace} in your prompt with "my value". so if your prompt looks like this: prompt = PromptTemplate.from_template("this is the user question: {user_question}") and query = "what is love?" then when you run prompt.inovoke({ user_question: query }) will return this: "this is the user question: what is love?"
@@alejandro_ao thank you! So helpful. Can’t wait to start playing with langchain and crewai. Just finishing off a deep learning (tensorflow) course and some projects then I’ll get into it. I’m a data analyst trying to transition into data science/ML engineering btw 😊
@@cheybrown2076 you are on the right path! actually, i am opening a cohort in a couple of weeks precisely about building AI apps. if you would like to join: course.alejandro-ao.com let me know if you're interested or have any questions!
hey! you can do that too. that was mostly to show how to use the output parsers. but usually you would use the output parser within a chain rather than at the end. inside a chain, if your next step in the chain requires a string input, using an output parser will make sure that it works regardless of what the intermediate step returns 👍
Great Tutorials...... Can you tell me what I need to know to build an RAG application like webpage query bot without using streamlit (python based web developemnt will be very useful for me)... I am trying to build an project for my Placement drives. Plz help me through this!! Thank you!!
is there any way to incorporate streamlit button inputs and llm to answer from that like i ask give menu options and it shows options as buttons and when i click one the llm knows what i selected
I like your so helpful videos so much. Recently, with the help of your videos, I created a customized Rag chatbot with nice avatars and customized HTML. So with the langchain chat message function and the chat history. Text streaming using chat message instead simple langchain message as add on is not possible, is it?
How to stream responses of the previous chatbot you made where you used create_retrieval_chain I'm getting an error: return conversational_rag_chain.stream({ TypeError: 'generator' object is not subscriptable
not very different. this tutorial is mostly for creating your own version of chatgpt or your own implementation of a LLM-chatbot for a "chat over your data" kind of application. arguably, you could also use this app instead of chatgpt if you wanted to have access to GPT-4 at a fraction of the price, but chatgpt has more features (like storing your conversations, voice-to-text, multimodal input) that you would have to code yourself. on the other hand, coding those features yourself might be a great learning experience!
This is really excellent video It’s exactly what I have been looking for Would you please tell me how to use it with RAG applications please make video about that because it’s a game changer in python chat bots 🤖 I tried but failed I need your assistance 😊
hey there! glad to hear this! sure thing. i have been covering RAG quite a bit. even though i have much more content about this coming :) - my most recent video about it is this one, which shows how to do RAG on a web page's contents: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-bupx08ZgSFg.htmlsi=A8fPDeepjKuPe2oP - this one is a more detailed and is about PDF files, but with a slightly older version of langchain: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-dXxQ0LR-3Hg.htmlsi=FnULh8P7fn4Iq7df
@@alejandro_ao Off course I am keen follower of yours I’ve seen them but I mean how to integrate the message streaming with RAG app ? In the retrieval chain ? and how exactly to achieve it ?
@@alejandro_ao pretty sure retriever objects don't support streaming, I know it's possible to have some elements in your chain that don't support streaming though
hey there, if you don't want to use openai, you can always use a free model. Groq has a free API (for now) and they allow you to try out Mistral, Gema and Llama2 for free. check them out and the just implement them like this: python.langchain.com/docs/integrations/chat/groq (it should be about a couple lines of code!)
I think passing chat history like that is not optimized way ..what if we use langchainMeomryBuffer wo summarize previous chat and give back to llm so that I doesn't increase input token size as every llm has fixed input token size , moving beyond that token size can produce not desirable output because it will miss some parts from input
Many users end up clicking enter while they are still typing the query. In the chat GPT we have the stop button to cancel the request. How can this be achieved in langChain or Streamlit?
Thanks for this great video I wonder how to integrate the streaming method in my RAG application, how to stream the response in RAG based app that uses Qdrant database would you explain it for me ❤❤
How can we do the streaming if the backend chain logic is exposed as REST API? In this example, both backend and frontend logic is there in the same file.