5-Langchain Series-Advanced RAG Q&A Chatbot With Chain And Retrievers Using Langchain
HTML-код
- Опубликовано: 18 июн 2024
- github: github.com/krishnaik06/Update...
In this video we will be building advanced RAG Q&A chatbot with chain and retrievers using langchain
A retriever is an interface that returns documents given an unstructured query. It is more general than a vector store. A retriever does not need to be able to store documents, only to return (or retrieve) them. Vector stores can be used as the backbone of a retriever, but there are other types of retrievers as well.
Chains refer to sequences of calls - whether to an LLM, a tool, or a data preprocessing step. The primary supported way to do this is with LCEL.
---------------------------------------------------------------------------------------------
Support me by joining membership so that I can upload these kind of videos
/ @krishnaik06
-----------------------------------------------------------------------------------
Fresh Langchain Playlist: • Fresh And Updated Lang...
►LLM Fine Tuning Playlist: • Steps By Step Tutorial...
►AWS Bedrock Playlist: • Generative AI In AWS-A...
►Llamindex Playlist: • Announcing LlamaIndex ...
►Google Gemini Playlist: • Google Is On Another L...
►Langchain Playlist: • Amazing Langchain Seri...
►Data Science Projects:
• Now you Can Crack Any ...
►Learn In One Tutorials
Statistics in 6 hours: • Complete Statistics Fo...
End To End RAG LLM APP Using LlamaIndex And OpenAI- Indexing And Querying Multiple Pdf's
Machine Learning In 6 Hours: • Complete Machine Learn...
Deep Learning 5 hours : • Deep Learning Indepth ...
►Learn In a Week Playlist
Statistics: • Live Day 1- Introducti...
Machine Learning : • Announcing 7 Days Live...
Deep Learning: • 5 Days Live Deep Learn...
NLP : • Announcing NLP Live co...
---------------------------------------------------------------------------------------------------
My Recording Gear
Laptop: amzn.to/4886inY
Office Desk : amzn.to/48nAWcO
Camera: amzn.to/3vcEIHS
Writing Pad:amzn.to/3OuXq41
Monitor: amzn.to/3vcEIHS
Audio Accessories: amzn.to/48nbgxD
Audio Mic: amzn.to/48nbgxD
Suggestion : It would be really helpful for viewers and Data Science communities : if next you can make a video on chatbot(maybe chainlit ui) to chat with pdf using langchain any llm(openai/ollama) as a next step, only thing is chatbot should remember chat history(maybe use langchain memories component) so if my first question is : Who is Sachin Tendulkar? and the next follow up question is What is his place of birth? so chatbot should automatically infer that his -> means Sachin Tendulkar. Thanks in Advance.
i already thought this 💯
hey sks, for that you have this concept called as memory buffer in langchain. You can look to it in LangChain Docs ;)
your videos are too good Krish. If some points are not understood and when I again check back I can get and relate what you are explaining. Thanks for all these very useful videos
followed all the 5 videos in less than 24 hrs. Now gotta looks at the documentation for retrieving from multiple documents.
Your new look reminds me of 70's bollywood villain called 'Shetty' (Rohit Shetty's father) LOL 🤣😛😁 . But in real life you are a hero !!! 🙏
You are a gem @krishnaik Sir, i read langchain from multiple platforms but u made it so simple. Now I have more interest on this topic🙂
Great hair cut! It suits you! Absolutely love your videos -- they have been very helpful so far! You're an outstanding teacher!
Just an awesome explanation. Love you bro. Make more videos for us.
I love this seires. Please dont stop!
If I could I would have liked this series 1000s time, you are awsome person man, I wish you all the very best for the kind work you are doing, Just love you man, big fan
you could have liked it 1000 times bcz you are fool.
Loved it!
Hi Krish. Thank you so much for your amazing content. These videos have really been helping me in my GenAI journey.
I am stuck in one place though
I want to use an output parser -(eg a on the output. But I am not able to do that. Tried a lot of different methods to solve this, but , but not able to debug .
If possible, could you please guide how this may be done?
Thank you so much in advance.
Super cool!
Krish ji , you are looking like Sakal...jokes apart great video and good learning content ..
Will check for different document loaders, mainly the microsoft one :)
I am with your look.
Feels like a Shoulin Monk😀 nice
awesome. You are Good
tanks krish !
looking Good sir 😃
Great
Thanks for the video, could you also please add some topics for RAG -> Qdrant, LLamaindex Parser, Nomic-embeding text
You look sharp Mr Naik
Very helpful Video , can you make a video on how to load multiple pdf files to create RAG pipeline and connect with azure openai,its will be very useful,currently you are handling with only file.
Hi krish, can you run the same with gpu cuda what are the changes need to apply. Before running llms, how to confirm cuda activated or not. I just checked with tensorflow and pytorch it is detecting xuda version, but this is enough or need to test some more tests. Please reply. Thanks.
Waiting for next video
Thanks, please teach us to deploy using Docker as well with the help of a server like triton inference server
Waiting
Can we use LECL to implement these? It would be helpful if you could show how to use LECL in your future videos also.
The chains seems to be using LCEL
Looking funny man. Love from Lahore Pakistan
Gr8 videoo
Hey bro whatsup with your hair style man, it's really cool man, nice
Hi krish, will you create a new episode on usage of various types of retrieval chains? You used retrievalqa in your earlier episode, then bappy did use different retrievar in his episode. Could you provide us a list of scenarios to use specific functions? 😅
Sure
Thanks for video, I had question, retrieval_chain.invoke() in this function you are passing only query, where is context, is that optional ?
The retrieval_chain is taking care of getting the context.
response = retrieval_chain.invoke({"input": "what is attention"})
response
when executed above code, the response is:
{'input': 'what is attention',
'context': [Document(page_content='3.2 Attention
An attention function can be described as mapping a query and a set of key-value pairs to an output,
where the query, keys, values, and output are all vectors. The output is computed as a weighted sum
3', metadata={'source': 'attention.pdf', 'page': 2})],
'answer': 'Based on the provided context from the paper "Attention Is All You Need" by Ashish Vaswani et al., I can answer your question.
According to the text, an attention function can be described as mapping a query and a set of key-value pairs to an output, where the query, keys, values, and output are all vectors. The output is computed as a weighted sum.
In simpler terms, attention refers to a mechanism that allows a model to focus on specific parts of an input sequence (or key-value pairs) based on their relevance or importance. This process involves comparing the input sequence with the query vector and computing weights for each position in the input sequence. The output is then computed by taking a weighted sum of the values, where the weights are learned during training.
Attention has been used successfully in various tasks such as reading comprehension, abstractive summarization, textual entailment, and learning task-independent sentence representations.
Please let me know if you find this answer helpful!'}
It has your input,context and answer fields
will this video be available to all in your RUclips channel
Please tell the minimum config. of laptop to run this project, and also for 7b model.
Are laptops capable of running it if yes recommend future proof ones
I am not an expert but I think you could buy a laptop which has rtx 3060 graphics card or above it would pretty fast when running 7b model. I am using 2018 acer nitro 5. It has gtx 1050ti graphics and 16 gb ram. I use ollam to run open-source quantized models. It's is slow but it accomplish the task. Either buy a laptop which has graphic rtx 3060 or above. Or buy a mac. Also you could fine tune the models if you have mac or rtx 3060
can you create an API with streamlit UI where user can upload a pdf documents and chat with it .....API and Streamline can do the work..I liked your video
❤
Hi,
when I run :
retrieval_chain = create_retrieval_chain(retriever,document_chain), I keep on getting this error:
AttributeError: 'function' object has no attribute 'with_config'
Does anyone know how to fix it?
🙏
Hi Krish...
Actually I was developing an end-to-end chatbot application for multiple PDF upload from UI with the help of streamlit framework.
I used Recursive text splitter and chunking, then huggigface embeddings and chromadb vextorstore. also used Conversational Retrieval Chain.
LLM used gpt-3.5-turbo
But i am facing issues to get response like repetitive response sometimes, or last query's response if i ask irrelevant questions, sometimes correct response, Can you guide me please
Could you provide me your github? I aint Krish but i might know how to help
Please make videos of RAFT also.
Hi, where to find these RAG Q&A Chatbot With Chain And Retrievers JOBS ONLINE ?? does it require prior building experience ??
@krish why this is advanced rag concepts, yiu have already explained the retrieverQA concepts right.....i dint get what is tge difference
Krish u look handsome now !!!
It is true! Hehe
Kindly create an API on RAG with PDF documents rather than just Notebooks
waited for a lifetime to get a response.....
my specs are 8gb ram
i5 12th
will i get some output
When I run:
response=retrieval_chain.invoke({"input":"Scaled Dot-Product Attention"})
I am getting this error:
TypeError: can only concatenate str (not "ChatPromptValue") to str
What to do???
reddy garo😝🔥🔥
First comment ❤
First like
You just tell how to use tools but not why to use . It's a very bad approach whether you like it or not, but that's the truth and try to improve it.
Krish Sir I am getting this error:
ValueError: Error raised by inference endpoint: HTTPConnectionPool(host='localhost', port=11434): Max retries exceeded with url: /api/embeddings (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))
Please help me out!
I am also getting same error from "retrieval_chain.invoke" method. Please help us with the solution @Krish Ji
@@jayaprakash7348 I also got the same error, downloading ollama and running llama2 model locally will fix this!
@@jayaprakash7348 I also got the same error. downloading ollama and running llama model locally would fix this.