Check out a free preview of the full First Look: ChatGPT API for Web Developers course

The "Langchain" Lesson is part of the full, First Look: ChatGPT API for Web Developers course featured in this preview video. Here's what you'd learn in this lesson:

Maximiliano discusses utilizing the Langchain framework to continue to learn about developing LLM applications.


Transcript from the "Langchain" Lesson

>> If you wanna get further into this, I encourage you to learn about Langchain. Langchain is a framework for developing applications powered by LLMs. And Langchain has libraries for Python, and no JS and JavaScript. And it's multi-vendor, so it's not just for open AI. You can connect also with other models, other AI models.

It includes prompt tools, so the prompt, the string you know it has a lot of places there so you can create templates. So you can say well here it will go the example, this is what I need if something's wrong. It include, this is the part where you can use embeddings.

It includes document loaders, so you can upload a PDF with this and he will do that chunk part of it with a slice your document, and he will start your vectors. It does include text splitters that will split your document in chunks. By the way, long chain will use your open AI key.

Because they are not doing that for you. They have memory. So they support the idea of memory between calls. So instead of using directly the OpenAPI as we were using, you can use Langchain and then Langchain will have memory, and we remember the history chat. And it will inject that into the prompt for all their requests.

And the name lang from LLMs, language models, and chain. Chain, it's an interface included in this library that will let you connect different AI calls. So you can say, I want to make this call. Then Dolly, then after Dolly, I want to go to another model, then I want to use church CBT for something else, and you can express all that chain and then execute the chain.

And finally, it includes an idea known as agents. An agent is to make decisions on actions to take based on JPT then the agent will take the action. It can be sent an email. It can be called an API, copy a folder. It can be something on your computer, open software, used the software, click here or there and it can even observe.

For that action to control that happen or not he will retry. And for that it uses a lot of calls to open AIs, APIs. So that's long chain, the website is That's the one that goes directly to the JavaScript API. And here you have all the documentation on how to start using LLMs.

And here you can see how to use the chat models from open AI and other providers in the future. How to all the tools for prompts. So output parser, for example, it will check that the format that the LLM is returning is exactly the one you were expecting.

So it's a body data of the output. Indexes is where you have document loaders. Vector stores that will help you with that part to split the document and then create the embedding for you. So, Langchain is like the next step. So, after you learn the basics of OpenAI, the next step is probably use a framework such as Langchain.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now