Routing with LangChain - Basics - Semantic Routing vs. LLM Classifier
ฝัง
- เผยแพร่เมื่อ 4 ก.ค. 2024
- In this Video I will show you why you want to perform routing in langchain and how you can do routing. We will explore Semantic Routing (cosine similarty) vs LLM based Classifier as Router.
Timestamps
0:00 Intro to routing
0:18 Semantic Routing
4:13 LLM based Classifier
Short, crisp and clear! Another amazing video
thank you! Follow up video about routing DBs will be released on thursday.
Please continue uploading these. I was following your old LangChain videos before LCEL and now I still find LCEL a bit confusing. Can you make a video on what exactly is runnable and the differences? RunnableLamda, RunnablePassthrough and any other runnables etc...
Yes :). Will so that
This is the clearest video out there about routing with LangChain. Amazing, thank you!
Would you say it is possible to fine-tune a model to become better at classifying so that I can use your second method (LLM-based classification) on top of that fine-tuned model?
Yes, finally, thank you marcus
Amazing! Thanks📍
Follow up Video is released today
this is awsome how can we add vectorstore to it? and can you modify this according to this output code "self_query_retrieval_chain = (
{"context": itemgetter("question") | self_query_retriever, "question": itemgetter("question")}
| RunnablePassthrough.assign(context=itemgetter("context"))
| {"response": rag_prompt | chat_model, "context": itemgetter("context")}
)"
Please check out my follow up video. Everything is explained there :)
Can I request a video about Embeddings..? Without using OpenAi embeddings but with others free APIs like huggingface etc..
I am really struggling with embeddings these days.
Hoping to see it.❤🤗
Currently not planned, sorry. My embeddings related videos hardly got any views in the past.
How do you think this pairs up against something like Langgraph?
Will have to dive into langgraph first:)
In the part about cosine similarity, I have 2 questions:
1) Why did you use cosine similarity and not dot product for instance or any other method?
2) Shouldn't be there a certain threshold value that u can put to determine how close are they?
1. Cosine similarity seems to be best suited as far as I know. This is what I read in multiple papers and is my default.
2. Thresholds are hard to define since values depend on what you ask. A better approach is to perform some kind of reranking
Since langchain is alwyas changing, can you please show us at the start of every video what version you're using? Thanks
There is a requirements file in my repo
@@codingcrashcourses8533 Can you please share repo/code link?