WEBVTT

00:00.000 --> 00:01.230
-: Let me try to explain

00:01.230 --> 00:03.813
what is LangChain under six minutes.

00:04.950 --> 00:07.470
LangChain is an open source framework

00:07.470 --> 00:09.270
that simplifies the process

00:09.270 --> 00:12.420
of building LLM-powered applications.

00:12.420 --> 00:15.900
It provides us with a set of tools and abstractions

00:15.900 --> 00:17.610
that make it easier for us

00:17.610 --> 00:21.690
to create complex LLM-powered applications.

00:21.690 --> 00:26.130
And LangChain was massively adopted by the industry,

00:26.130 --> 00:27.930
mostly by developers who want

00:27.930 --> 00:31.980
to build LLM-based applications without really understanding

00:31.980 --> 00:34.950
how machine learning works or how to train models,

00:34.950 --> 00:37.920
but rather to use models as a black box.

00:37.920 --> 00:40.800
And it's currently one of the most popular frameworks,

00:40.800 --> 00:42.960
if not the most popular frameworks

00:42.960 --> 00:46.710
when developing LLM-powered apps like agents

00:46.710 --> 00:49.080
and rag applications, which we're going

00:49.080 --> 00:51.390
to cover in depth in this course.

00:51.390 --> 00:52.860
It's an open source framework,

00:52.860 --> 00:55.140
so the code is available on GitHub

00:55.140 --> 00:56.850
and we can create pull requests

00:56.850 --> 00:59.100
and we can really see what LangChain

00:59.100 --> 01:01.470
is doing for us under the hood.

01:01.470 --> 01:05.700
It has a thriving community of contributors and creators,

01:05.700 --> 01:09.180
building some amazing stuff with LangChain.

01:09.180 --> 01:11.580
All right, so up until now, I have shown you

01:11.580 --> 01:12.900
that LangChain is cool,

01:12.900 --> 01:15.360
that it's widely adopted in the industry

01:15.360 --> 01:18.690
and that it helps us build LLM applications,

01:18.690 --> 01:22.080
but I haven't really showed you how it does it,

01:22.080 --> 01:25.110
and which tools and which abstractions help us

01:25.110 --> 01:28.350
to implement those LLM applications.

01:28.350 --> 01:32.250
So imagine you wanna build an app on top of a powerful,

01:32.250 --> 01:35.310
large language model like Claude Sonnet

01:35.310 --> 01:37.680
or any other LLM you would like,

01:37.680 --> 01:41.880
and that you want to combine it with your own personal data

01:41.880 --> 01:46.530
that the LLM was not trained on, so it's not aware of.

01:46.530 --> 01:47.790
Maybe you want to connect it

01:47.790 --> 01:51.600
to your personal PDF files or maybe to your emails

01:51.600 --> 01:53.910
or your Notion database.

01:53.910 --> 01:56.700
And you also want to construct prompts dynamically

01:56.700 --> 01:58.980
according to some user input.

01:58.980 --> 02:01.470
And of course, you would also want to save the history

02:01.470 --> 02:04.410
of the messages between the user and the AI.

02:04.410 --> 02:06.540
And let's say you want to switch an LLM now

02:06.540 --> 02:08.463
and now you want to use Mistral.

02:09.540 --> 02:11.730
And what if you want to connect the LLM

02:11.730 --> 02:14.430
into a tool like Google Search

02:14.430 --> 02:18.390
or to make an API call according to the user's input.

02:18.390 --> 02:21.480
So this would make your application super powerful

02:21.480 --> 02:24.900
and I can go on and on on more requirements

02:24.900 --> 02:28.230
and more functionality and you can pretty much understand

02:28.230 --> 02:30.030
that building an LLM application

02:30.030 --> 02:33.600
isn't that straightforward if we want to do it ourselves.

02:33.600 --> 02:36.240
It involves with a lot of moving parts

02:36.240 --> 02:39.270
that we need to stitch up together and synchronize.

02:39.270 --> 02:42.540
And luckily for us, LangChain is going to help us do

02:42.540 --> 02:44.190
all of these heavy lifting.

02:44.190 --> 02:47.070
And the craft of building an LLM application

02:47.070 --> 02:50.190
is a whole lot easier when we use LangChain.

02:50.190 --> 02:52.950
It provides a bunch of key different functionalities

02:52.950 --> 02:55.950
divided into modules which help us achieve this.

02:55.950 --> 02:57.840
So let's review some of them.

02:57.840 --> 03:01.020
It abstracts the concept of interacting with the LLM

03:01.020 --> 03:02.400
and through chat models,

03:02.400 --> 03:05.550
we can switch models like we switch our socks.

03:05.550 --> 03:06.960
So we would simply need

03:06.960 --> 03:09.813
to import the correct model we would like to use.

03:10.740 --> 03:13.470
And the beauty of it is that we have the same interface

03:13.470 --> 03:15.570
for all the LLM vendors

03:15.570 --> 03:18.180
and this really gives us freedom as developers

03:18.180 --> 03:20.700
and decouples us from the LLM vendor

03:20.700 --> 03:22.860
and gives us the possibility

03:22.860 --> 03:25.650
to switch between vendors anytime we'd like.

03:25.650 --> 03:28.803
So we won't be vendor-locked to a certain LLM.

03:30.420 --> 03:33.240
Another module of LangChain is prompts, which helps us

03:33.240 --> 03:35.670
with prompt management, optimization,

03:35.670 --> 03:37.830
and prompt serialization.

03:37.830 --> 03:40.110
You can create a template for your prompt

03:40.110 --> 03:44.070
and dynamically inject user input into your template.

03:44.070 --> 03:46.950
making an instance of this prompt template

03:46.950 --> 03:48.780
with your user input.

03:48.780 --> 03:50.550
And that's the final prompt that is going

03:50.550 --> 03:52.110
to be sent to the LLM.

03:52.110 --> 03:54.960
So this helps us a lot with composability

03:54.960 --> 03:57.030
and really gives us a lot of flexibility

03:57.030 --> 03:59.850
of building those kind of LLM applications.

03:59.850 --> 04:03.120
It also have document loaders which help us load

04:03.120 --> 04:05.190
different types of data sources,

04:05.190 --> 04:08.670
for example, our Notion database, some PDF files,

04:08.670 --> 04:12.240
our emails, and thousands of more data sources.

04:12.240 --> 04:14.820
And when we load them, we get a single interface

04:14.820 --> 04:17.790
of a LangChain document, which makes it super easy

04:17.790 --> 04:22.140
to process this data before we streamline it to our LLM.

04:22.140 --> 04:24.450
And another important part of LangChain

04:24.450 --> 04:28.350
is its entire support for the agent ecosystem.

04:28.350 --> 04:31.170
So if you want to build an application which is a gentech,

04:31.170 --> 04:34.620
so to leverage the reasoning capabilities of an LLM

04:34.620 --> 04:37.650
to equip it with tools that it can invoke,

04:37.650 --> 04:40.740
like searching in the internet, querying a database,

04:40.740 --> 04:44.730
or sending an email, basically giving your LLM superpowers,

04:44.730 --> 04:48.450
giving us the ability of implementing some complex logic,

04:48.450 --> 04:50.910
then all of this we can easily integrate

04:50.910 --> 04:52.950
and implement with LangChain

04:52.950 --> 04:56.550
with abstractions of tools, of agent executor,

04:56.550 --> 04:58.440
and LangGraph implementations,

04:58.440 --> 05:00.420
and a lot of cool new concepts

05:00.420 --> 05:02.580
and terminologies that we're all going

05:02.580 --> 05:04.980
to cover elaborately in this course.

05:04.980 --> 05:06.810
Now, don't be afraid of this code snippet.

05:06.810 --> 05:09.720
I promise you, by the end of the first couple of sections,

05:09.720 --> 05:13.170
you'll be competent to create some agentic applications.

05:13.170 --> 05:15.390
So this was just the tip of the iceberg

05:15.390 --> 05:17.730
of what LangChain offers when it comes

05:17.730 --> 05:20.430
for developing an LLM-based application.

05:20.430 --> 05:22.590
It has much more features

05:22.590 --> 05:25.320
and we're going to cover a lot of them in this course,

05:25.320 --> 05:27.060
and we're going to cover them in depth,

05:27.060 --> 05:30.120
including diving into their implementation.

05:30.120 --> 05:32.820
We're going to cover the entire LangChain ecosystem

05:32.820 --> 05:36.150
in stack, and we'll talk about bringing LLM applications

05:36.150 --> 05:39.360
to production, which will involve tracing and monitoring,

05:39.360 --> 05:41.160
which we're going to leverage in this course.

05:41.160 --> 05:44.400
LangSmith, a super convenient tool for debugging

05:44.400 --> 05:46.590
and tracing LLM applications.

05:46.590 --> 05:47.790
So in this course,

05:47.790 --> 05:51.330
we'll be building a real-world AI-based application

05:51.330 --> 05:54.120
that is going to introduce us with all the concepts,

05:54.120 --> 05:55.740
with all the terminology we need to know

05:55.740 --> 05:57.090
when it comes to LangChain.

05:57.090 --> 05:58.440
And at the end, we'll be able

05:58.440 --> 06:00.543
to build ourselves some new applications.
