From the course: OpenAI API for Python Developers
Getting started with LangChain
- [Instructor] A typical business use case is to implement a customer support chatbot trained on custom knowledge in order to provide a tailored user experience. For the upcoming projects, we're going to use the OpenAI APIs and the LangChain framework. The LangChain framework is a web development toolkit designed for building applications powered by the language models. And it is particularly useful for developers who want to easily integrate an intelligence layer into their web projects. And it supports several programming languages, including Python. And so LangChain comes with plenty of benefits. It is flexible. It allows an easy integration with a high degree of control over the language model's behavior with many options for fine-tuning and customizations to fit specific application needs. In the next example, we're going to build a custom chatbot trained on custom knowledge for a fictitious shoe company called ABC shoes. And so we're going to use the OpenAI language models that are the core components of the LangChain framework with the standard interface for an easy integration of multiple providers, including OpenAI. We're going to use the OpenAI embeddings to create numerical references and allow search by text similarities. And for that, we're going to integrate a vector store. So we're going to use the Chroma DB as a vector store database to store and retrieve the embeddings. And so the embeddings are used to measure the relatedness with text strings. We also defined the prompts to create, format, and send instructions to the language models. And then we learn to set up chains. We're going to learn to set up chain with the built-in LangChain Expression Language in order to chain components and functionalities. And finally, we're going to use Streamlit, a Python library, to build the user interface of our custom chatbots. At a very high level, we're going to combine LangChain with Chroma DB in order to apply Retrieval-Augmented Generation and expand the capabilities of the language model. The goal is to give the language models access to custom knowledge. And so the retrieval augmented technique is a methodology that combines knowledge retrieval and text generation. Up next, we build an AI agents trained and fine-tuned to assist your customers with general inquiries and technical issues. The goal is to make the chatbot knowledgeable about your specific domain. So that seems like a lot, but lucky for us, LangChain makes it a super easy integration process.