Тёмный

RAG from Scratch in 10 lines Python - No Frameworks Needed! 

Prompt Engineering
Подписаться 161 тыс.
Просмотров 15 тыс.
50% 1

In this video, I'll show you how to create a fully functional chat system using your own documents with just 10 lines of Python code. We'll dive into Retrieval Augmented Generation (RAG) without relying on frameworks like LangChain, LamaIndex, or vector stores such as Chroma.
💻 RAG Beyond Basics Course:
prompt-s-site.thinkific.com/c...
LINKS:
Colab: tinyurl.com/cnufkeky
Ben's X account: x.com/bclavie
Ragatouille/ColBERT video: • Advanced RAG with ColB...
Let's Connect:
🦾 Discord: / discord
☕ Buy me a Coffee: ko-fi.com/promptengineering
|🔴 Patreon: / promptengineering
💼Consulting: calendly.com/engineerprompt/c...
📧 Business Contact: engineerprompt@gmail.com
Become Member: tinyurl.com/y5h28s6h
💻 Pre-configured localGPT VM: bit.ly/localGPT (use Code: PromptEngineering for 50% off).
Signup for Newsletter, localgpt:
tally.so/r/3y9bb0
00:00 Introduction to Building a Chat System without Frameworks
00:26 Understanding Retrieval Augmented Generation (RAG)
02:12 Setting Up the Python Environment
03:39 Data Preparation and Chunking
05:12 Embedding the Chunks
06:31 Retrieving Relevant Chunks
08:53 Generating Responses with LLM
09:50 Advanced Techniques and Recommendations
11:15 Conclusion and Further Learning
All Interesting Videos:
Everything LangChain: • LangChain
Everything LLM: • Large Language Models
Everything Midjourney: • MidJourney Tutorials
AI Image Generation: • AI Image Generation Tu...

Наука

Опубликовано:

 

29 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 47   
@madbike71
@madbike71 8 дней назад
Excelent and concise description. Thank you.
@michaelponce5965
@michaelponce5965 9 дней назад
This is exactly what I've been trying to find for the last couple of days. Simple instructions on how to do this with pure python and local LLM. Thank you!
@antonioalvarez3246
@antonioalvarez3246 8 дней назад
x2! thanks @prompt engineering!
@Connor51440
@Connor51440 9 дней назад
Great video, nice style and easy to listen to, subscribed 👍🏼
@nshettys
@nshettys 5 дней назад
Brilliant! Thanks for this one
@nmstoker
@nmstoker 6 дней назад
Brilliantly explained with clarity and insight, thank you! Also really pleased you point out that RAG emerged from IR ideas and wasn't brand new: when I saw it I was like, haven't people seen Facebook's DrQA from 2017?!? And even that wasn't out the blue, there's a long established history with IR 👍
@engineerprompt
@engineerprompt 3 дня назад
thank you. I agree, in most of the case, we are reinventing the wheel and giving old approaches with new names. Interestingly enough a simple keyword based search (BM-25) will still out perform dense embeddings in most cases!
@prathameshmandavkar7591
@prathameshmandavkar7591 11 дней назад
Great work 👍🏻 Thanks
@antonioalvarez3246
@antonioalvarez3246 8 дней назад
great work! thanks!
@vaishnokmr
@vaishnokmr 10 дней назад
yes! i did the same a year ago in research duration.. it works.
@TheCopernicus1
@TheCopernicus1 11 дней назад
Legend!
@Salionca
@Salionca 11 дней назад
Great! Thanks!
@vitalis
@vitalis 10 дней назад
Problem with RAG solutions is they don’t hold up with bigger amounts of unstructured data. I wish there was a solution that includes long term memory for chat agents so that they get smarter about your context as you chat with them
@engineerprompt
@engineerprompt 10 дней назад
Google released context caching for their long context models. This could be a solution
@Kishorekkube
@Kishorekkube 6 дней назад
​@@engineerpromptis there a way to save and load the vector store that you made here sir ?
@LEANSCH96
@LEANSCH96 8 дней назад
Can this also be implemented with a local model through Ollama?
@bastabey2652
@bastabey2652 10 дней назад
I never liked RAG frameworks .. thanks for the useful content
@user-sd3qe7qu9c
@user-sd3qe7qu9c 6 дней назад
500 likes, keep it up !
@aryandhakal3158
@aryandhakal3158 10 дней назад
could you please make a video on a a chatbot that can interact with pdf files and answer questions with recent tech ? I'm having the most difficulties with outdated tutorials. It would be a great help!
@ujjwalsrivastava6248
@ujjwalsrivastava6248 14 часов назад
Hello sir! I want to build a question answering chatbot which gives answer form provided knowledge base in pdf or text format with python language. I'm working on this since last 10 days but failed to do till now! Can you please guide me through this project sir?
@MoFields
@MoFields 11 дней назад
What are the best ways of importing documents into the RAG system From corporate systems, such as Google Docs or Confluence or Notion without asking your IT? I have actually done a few things manually, but they are very labour-intensive and manual for example using scraping tools and chrome extensions but is there something that is a bit more streamlined?
@MoFields
@MoFields 11 дней назад
Also - how to add indexing, link backs, more nuances chunking mechanisms (context and type of info aware)?
@engineerprompt
@engineerprompt 10 дней назад
You are looking for data connectors in this case. Each of these services will have their own APIs or you can use data loaders from langchain (python.langchain.com/v0.2/docs/integrations/document_loaders/). This is one aspect where i would recommend using a framework.
@Francotujk
@Francotujk 11 дней назад
Hello! I’ve a doubt. The similarities is a way to reduce the number of tokens that is sent to the openAi api? So basically when you make a query to the llm you are not sending the entire text of the wikipedia page? I ask it because of tokens cost, to know exactly what openai will charge us. Your content is probably the best on youtube! Really appreciate all your videos
@luizemanoel2588
@luizemanoel2588 11 дней назад
Probably. He used a Wiki page but you may have a 1000 pages pdf that will cost a lot to process and maybe most of it is irrelevant to what you want. When you break the text, and then get the 'n' most relevant chunks you get what you want faster and cheaper.
@luizemanoel2588
@luizemanoel2588 11 дней назад
And if you use a AI locally, the more info you use the slower it will be. So it can make a not so powerful PC do the job too.
@engineerprompt
@engineerprompt 10 дней назад
Yes, there are two parts as mentioned by @luizemanoel. First the document can contain a lot of irrelevant info. You only want to provide what is relevant to the query to the LLM. This will improve the responses. And the added benefit is reduced tokens which means less cost as well.
@Francotujk
@Francotujk 10 дней назад
@@engineerprompt @luizemanoel2588 Ok thanks to both!
@user-po9yn4ni4u
@user-po9yn4ni4u 9 дней назад
can u also show how to make structured output?
@ignaciopincheira23
@ignaciopincheira23 4 дня назад
Hi, could you convert complex PDF documents (with graphics and tables) into an easily readable text format, such as Markdown? The input file would be a PDF and the output file would be a text file (.txt).
@engineerprompt
@engineerprompt 3 дня назад
Yes, checkout this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-mdLBr9IMmgI.html
@drp111
@drp111 9 дней назад
Thanks for the video! However, RAG never convinced me. I'm looking for fine-tuning in 10 lines of code.
@MeinDeutschkurs
@MeinDeutschkurs 11 дней назад
No frameworks, but please install RAGatuille? WTF!
@Yocoda24
@Yocoda24 11 дней назад
Are you also mad he used numpy? Hahahahah wtf Framework: a collection of libraries to build applications Libraries: a tool to leverage functionality
@MeinDeutschkurs
@MeinDeutschkurs 11 дней назад
@@Yocoda24 , well: if the claim is pure python, no frameworks, yes. WTF.
@Yocoda24
@Yocoda24 11 дней назад
@@MeinDeutschkurs not sure where you’re pulling “pure python” from? Can you give me a timestamp to when it is said in the video?
@MeinDeutschkurs
@MeinDeutschkurs 10 дней назад
@@Yocoda24 Read the video title: “RAG from Scratch in 10 lines Python - No Frameworks Needed!”
@Yocoda24
@Yocoda24 10 дней назад
@@MeinDeutschkurs oh okay so it doesn’t say pure python, and he doesn’t use any frameworks. Glad we could come to an understanding
@crazytrain86
@crazytrain86 10 дней назад
"10 lines" 🤣
@lesteroliver911
@lesteroliver911 11 дней назад
Thankyou
@uwegenosdude
@uwegenosdude 8 дней назад
Thanks for this great video. I tried to run your juypter notebook. When calling the line "from google.colab import userdata" I get the error: ModuleNotFoundError: No module named 'google'. and somewhere I see pkg_resources is deprecated as an API Is python 3.12.3 too new? OK, I replaced the google part. There are other ways to create an OpenAI client ! Now it works !
Далее
Mesop - Google's New UI Maker
14:04
Просмотров 51 тыс.
I Trained an AI with 10,000 Memes
14:52
Просмотров 233 тыс.
How to Improve LLMs with RAG (Overview + Python Code)
21:41
Python RAG Tutorial (with Local LLMs): AI For Your PDFs
21:33
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
GraphRAG: LLM-Derived Knowledge Graphs for RAG
15:40
Просмотров 77 тыс.
YOTAPHONE 2 - СПУСТЯ 10 ЛЕТ
15:13
Просмотров 107 тыс.
Дорогие компы БЕСПОЛЕЗНЫ?
1:00
Просмотров 750 тыс.
SSD с кулером и скоростью 1 ГБ/с
0:47
Самый СТРАННЫЙ смартфон!
0:57
Просмотров 33 тыс.