How to Build a RAG System That Actually Works

Better Stack Better Stack

18,099
10 tháng trước
RAG can be effective, but careless setups create misleading outputs. This video explains where retrieval and evaluation usually go wrong and why the answers drift. It’s a practical guide to building RAG systems you can actually trust.

🔗 Relevant Links
The Star Wars Expert Project: https://github.com/andrisgauracs/Star-Wars-Movie-Expert
LangChain: https://www.langchain.com/

❤️ More about us
Radically better observability stack: https://betterstack.com/
Written tutorials: https://betterstack.com/community/
Example projects: https://github.com/BetterStackHQ

📱 Socials
Twitter: https://twitter.com/betterstackhq
Instagram: https://www.instagram.com/betterstackhq/
TikTok: https://www.tiktok.com/@betterstack
LinkedIn: https://www.linkedin.com/company/betterstack

📌 Chapters:
00:00 Intro
00:38 What exactly is RAG?
01:46 Setting up LangChain & Dependencies
02:23 Data Ingestion: Scraping the Star Wars Script
03:23 The Importance of Chunking Strategy
04:34 Implementing Scene-based Text Splitting
06:01 Embeddings & Qdrant Vector Database
07:07 Implementing Database Logic & Indexing
07:36 Building the Q&A Loop & Prompt Template
08:40 Running the Application
09:04 Demo: Testing the Star Wars Expert
09:27 Refining the Prompt for Better Accuracy
10:03 Security: Handling Prompt Injection Attacks
11:56 Conclusion & Final Summary