Advanced RAG with Self-Correction | LangGraph | No Hallucination | Agents | LangChain | GROQ | AI

  Рет қаралды 4,190

Eduardo Vasquez

Eduardo Vasquez

Күн бұрын

In this video, I'll guide you through building an advanced Retrieval-Augmented Generation (RAG) application using LangGraph. You'll learn step by step how to create an adaptive and self-reflective RAG system, and how to effectively prevent hallucination in your language models.
🔍 Key Topics Covered:
- Adaptive and Self-Reflective RAG: Learn how to design a RAG system that self-corrects to improve its responses.
- Preventing Hallucinations: Discover techniques to ensure your language model provides accurate and reliable information.
- Agents: See how to integrate an agent that uses a search browser to find information when the LLM doesn't have the answer.
- GROQ for LLM inference: Explore how to utilize GROQ to speed-up your LLM responses.
💡 Tools and Technologies:
- LangGraph: The framework I used for building the advanced RAG application.
- Tavily: For agent-based browsing and information retrieval.
- GROQ: To reduce latency on LLM inference.
- Google: To generate text embeddings.
- Chroma: Vector store database.
🔥 Don't forget to 𝘀𝘂𝗯𝘀𝗰𝗿𝗶𝗯𝗲, 𝐬𝐦𝐚𝐬𝐡 the 𝗹𝗶𝗸𝗲 𝐛𝐮𝐭𝐭𝐨𝐧, and 𝐭𝐮𝐫𝐧 𝐨𝐧 the 𝐧𝐨𝐭𝐢𝐟𝐢𝐜𝐚𝐭𝐢𝐨𝐧 𝐛𝐞𝐥𝐥 for more 𝗲𝘅𝗰𝗶𝘁𝗶𝗻𝗴 𝗽𝗿𝗼𝗷𝗲𝗰𝘁𝘀 and 𝘁𝘂𝘁𝗼𝗿𝗶𝗮𝗹𝘀.
🚀 Timestamps:
0:00 Introduction
0:21 Workflow - Flow Diagram of Self-Corrective RAG
03:55 Setup Environment
04:09 Load Credentials
04:22 Routing Node
06:06 Retriever from Chroma Vector Store Database
06:47 Node to Grade Retrieved Documents
07:58 Node to Generate LLM response
08:28 Node to Prevent Hallucination
09:20 Node to Grade Final Answer
09:58 Integrate Agent
10:10 LangGraph for the Flow Diagram
11:28 Test RAG
13:08 Conclusion
Links:
💻 Code: github.com/Eduardovasquezn/ad...
☕️ Buy me a coffee... or an iced tea: www.buymeacoffee.com/eduardov
👔 LinkedIn: / eduardo-vasquez-n
#RAG #LangGraph #AI #LLM #Agents #ArtificialIntelligence #Data #Hallucination #AdaptiveRAG #SelfReflectiveAI #InformationRetrieval #Tavily #GROQ #LLM #Google #Programming #Tutorial #DataScience #Embeddings #AIResearch #Tutorial #MachineLearning #Database #Python

Пікірлер: 19
@ramakanaveen
@ramakanaveen 6 сағат бұрын
Nice one. Question : what if all the docs are marked as irrelevant chunks by the model , do you need to query the vector db again ? I guess an improvement may be to include a Hyde model in between to improve the questions and keep trying to get a different chunks from DB ?
@vasudevanvijayaragavan3186
@vasudevanvijayaragavan3186 10 сағат бұрын
Very nice, the only challenge with this approach is the total cost of answering each query, and it could run forever in some cases till both llms agree or till you get thr eight relevant information from the search. I think of customers want 100% gurantee and are not worried about latency, this will work really well.
@eduardov01
@eduardov01 9 сағат бұрын
Indeed, it'll depend on the usecase that you have because for some cases you wouldn't sacrifice the quality of the responses for the speed.
@jayden_finaughty
@jayden_finaughty 8 сағат бұрын
Surely this approach becomes more and more viable as the cost of newly released models keep on decreasing by 5x, 10x est as we are currently seeing? So the cost of this multi-shot RAG approach with a new model 5x cheaper is still less expensive than a single-shot of its more expensive predecessor?
@eduardov01
@eduardov01 7 сағат бұрын
Exactly!
@keilavasquez728
@keilavasquez728 Ай бұрын
I've been searching for a self-correcting system because sometimes the responses I receive from LLMs aren't precise. Thank you so much for your help.
@eduardov01
@eduardov01 Ай бұрын
I'm glad it was helpful!
@marcoaerlic2576
@marcoaerlic2576 9 күн бұрын
Awesome video. Thank you.
@eduardov01
@eduardov01 8 күн бұрын
Glad you liked it!
@chikosan99
@chikosan99 12 күн бұрын
Great video, very nice
@eduardov01
@eduardov01 12 күн бұрын
Thank you very much!
@SonGoku-pc7jl
@SonGoku-pc7jl 15 күн бұрын
thanks, good flow between rag and web search, thanks!!1 :)
@eduardov01
@eduardov01 15 күн бұрын
Thank you. I'm glad you found it interesting!
@keila9874
@keila9874 Ай бұрын
Is the Tavily API for free? Can I use the Google Search Engine instead?
@eduardov01
@eduardov01 Ай бұрын
Yes, you can make 1,000 API calls for free every month. It's also possible to use Google Search as an agent for this. I have a video explaining step-by-step how to use it: kzfaq.info/get/bejne/ptZ3hbOI1dydh5c.html
@amacegamer
@amacegamer 17 күн бұрын
Great video! But I have a question I hope you can answer and help me. Why is so slowly answering? that's normal for the architecture or there is other reason, and can we do something to fix that?
@eduardov01
@eduardov01 16 күн бұрын
The fact that we have 5 LLMs to generate answers + retriever + a websearch is performed when the question is not in the vector store database + we also store the web search results in the database and all these steps can take some time. To make it faster, you can use fewer LLMs and maybe skip the web search, depending on your usecase.
@eyalfrish
@eyalfrish 29 күн бұрын
Nice video! Any chance to get access to the excalidraw version of the diagram?
@eduardov01
@eduardov01 28 күн бұрын
Thanks! I have a free account in Excalidraw and just have 1 session with all my diagrams. But you can get access to the flowchart using this link: github.com/Eduardovasquezn/advanced-rag-app/blob/main/images/rag.png
Introduction to LangGraph: A Quick Dive into Core Concepts
21:54
Coding Crashcourses
Рет қаралды 4,8 М.
LangChain + RAG Fusion + GPT-4o Python Project: Easy AI/Chat for your Docs
9:27
Gao Dalie (高達烈)
Рет қаралды 2,4 М.
The Noodle Picture Secret 😱 #shorts
00:35
Mr DegrEE
Рет қаралды 30 МЛН
IS THIS REAL FOOD OR NOT?🤔 PIKACHU AND SONIC CONFUSE THE CAT! 😺🍫
00:41
🍕Пиццерия FNAF в реальной жизни #shorts
00:41
Introducing the MLFlow plugin for Hamilton
30:05
DAGWorks-Inc
Рет қаралды 55
LangGraph 101: it's better than LangChain
32:26
James Briggs
Рет қаралды 50 М.
Mesop - Google's New UI Maker
14:04
Sam Witteveen
Рет қаралды 35 М.
I wish every AI Engineer could watch this.
33:49
1littlecoder
Рет қаралды 53 М.
LangGraph Simplified: Master Custom AI Agent Creation
43:51
Data Centric
Рет қаралды 13 М.
Mesop - Python-based UI framework from Google!
16:20
Harshit Tyagi
Рет қаралды 44 М.
What is LangChain?
8:08
IBM Technology
Рет қаралды 151 М.
The Noodle Picture Secret 😱 #shorts
00:35
Mr DegrEE
Рет қаралды 30 МЛН