-: In this video, we're gonna cover a concept
inside of LangSmith called LangChain Hub.
LangChain Hub is a prompt resource
which allows you to explore different types of prompts
that other prompt engineers have made.
Let's have a look at some of the different types
of things you can do inside of LangChain Hub.
One thing, for example,
is to browse the hubs by a point of interest.
Another thing that you might decide
to do is try out specific prompts
in the playground inside of LangSmith.
Let's have a look in LangSmith
at all these types of use cases.
If you go into LangSmith, and then as well as that,
what we're gonna do is click on the world symbol,
which then takes us into LangChain Hub.
Now inside LangChain Hub, there's a range
of different types of prompts and use cases.
So if you're interested in, for example,
chatbots and code understanding,
we can see that these are the types of prompts
that have seen a lot of resurgence in those.
Now, I can click on a prompt.
Now, I can see this is the Readme of the prompt,
and like how you would potentially use this.
We can also have a look at
how regularly they commit their prompt.
Things you can do is if you go into the top right,
we can say try it,
and then we can also then do a run
by entering in some variables.
So you can, you know, put in some variables here
and you could run specific types of prompts
by clicking start.
And you'll see it's asking for an OpenAI key.
So obviously then you would need to set your secret key
up in the OpenAI key in the top right.
So this is a way where you can see the template,
you can see what is being sent.
You can also edit the template.
So as we scroll down here,
you can see these are the variables
and we can also edit the template in real-time.
You've got other things like being able
to copy the clipboard, delete messages.
We can also move messages around.
So it's possible for us to really play around
inside this little prompt playground.
And we can also save our own prompts
and give it a repository name.
So you can play a lot around in the prompt playground.
Let's actually switch gears
and have a look inside of a Jupyter Notebook.
So what we're gonna do is install Faiss and LangChain Hub.
And then I'm just gonna go and connect to LangChain Hub.
And I'm gonna pull down several different prompts.
If you're looking specifically for the prompts,
if you go on a prompt
and you scroll right down to the bottom,
you'll see this is how you import it.
So it shows you exactly how to import that specific prompt.
Now, we can have a look at some of these prompts.
The one that I'm specifically
interested in is this RAG prompt,
which RAG stands for Retrieval Augmented Generation.
So what we're gonna do is we're gonna follow along
with the example that it's given us.
And just to highlight this,
depending upon the different types of prompts you get.
So I'm gonna go into RAG prompt LangChain Hub.
And then what I'm gonna do is look at this prompt.
And this person's given a common usage
for this specific type of prompt,
which is really, really nice.
So just straight from their repo,
we can already start to get a lot of information.
So we're gonna use a web-based loader, get that webpage,
split the document into individual small documents,
make embeddings from those,
and store those in a vector store.
Then we're gonna pull the RAG prompt.
And then we're gonna set up a retrieval Q&A chain
with a chat OpenAI.
And then we're gonna pass at the LLM, the retriever,
and the chain type args passing in the prompt.
And then we're gonna say,
what are the approaches to task decomposition?
And then we're gonna pass that chain in with the query
and the question and then return the result.
So I think the important thing is LangChain Hub gives you
a lot of flexibility in seeing
what other prompt engineers have created
to solve similar types of problems.
You can easily pull down their prompts using
the LangChain Hub package.
Hopefully, this gives you a good insight
and introduction into using LangChain Hub.