LangChain Advanced RAG - Two-Stage Retrieval with Cross Encoder (BERT)

preview_player
Показать описание
In this Video we discuss advanced retrieval techniques from Vector Databases with Query Expansion and Two-Stage Retrieval with a Cross Encoder. We use another Reranker on top to take the famous "lost in the middle" problem into consideration.

Timestamps:
0:00 Two-Stage Retrieval in theory
2:44 RAG and it´s issues
9:31 Query Expansion
11:50 Cross Encoder Reranking
13:50 LongContext Reorder

#openai #langchain
Рекомендации по теме
Комментарии
Автор

Best 15 mins of my day! You explained every single component in the code clear and crisp! Excited to check the other videos of yours. Thanks a bunch

sivi
Автор

Very informative.👍 Love the umap visualization 2 see the query and the embeddings.

henkhbit
Автор

Thanks for the video. Perfect timing…. Need this for tomorrow.

Canna_Science_and_Technology
Автор

UniqueList = list(set(ListWithDuplicates)) to replace those nested for loops. Love your content!

fuba
Автор

I don't know the umap library, its very interesting. Good explanation about RAG advanced techniques, sucess for you!

felipecordeiro
Автор

The most productive 14 minutes of my day watching and learning from this video :)

zehehwd
Автор

This video is terrific, I'll give it a try!

kenchang
Автор

Youre vids are insanely good. I doubt there is a better ai-prog-tuber

samyio
Автор

Awesome video. So I glad I found this channel. Long shot question:

After testing several chunk/overlaps, my experimentation indicates an optimal chunk_size=1000 and overlap=200. My RAG contains about 10 medical textbooks (~50, 000 pages). However, every video I see on RAG nobody uses chunks anywhere near that large. Does it seem improbable that my ideal chunk size is 1, 000, or is there likely another variable at play?

austinpatrick
Автор

Thank, always nice videos!
Do you have a favorite german cross-encoder?

maxlgemeinderat
Автор

Can u please make a video on retrieving data from SQL using SQL agents & Runnable using LCEL. If not possible here, if you can update the same in the udemy course. It helps alot

prnmdid
Автор

Thanks for the video..

But while genering queries using llm_chain.invoke(query), facing exception related to output parser.
OutputParserException: Invalid json output:

vinaychitturi
Автор

How much computation resource (specifically GPU) required in running this cross encoder model?

verybigwoods
Автор

What's the best way to evaluate this RAG?

erenbagc
Автор

LLMChain() is deprecated and the output_parser in the examples also cause json output error.
Would be nice, if you could update the github code. Thank you
If anyone having issue with json output, here is a fix:

from langchain_core.output_parsers import BaseOutputParser

class LineList(BaseModel):
lines: list[str] = Field(description="Lines of text")

class
def __init__(self) -> None:


def parse(self, text: str) -> list[str]:
lines = text.strip().split("\n")
return lines

sumangautam