Using LangChain to Get More from RAG
We have mentioned LangChain several times already, and we have shown you a lot of LangChain code, including code that implements the LangChain-specific language: LangChain Expression Language (LCEL). Now that you are familiar with different ways to implement retrieval-augmented generation (RAG) with LangChain, we thought now would be a good time to dive more into the various capabilities of LangChain that you can use to make your RAG pipeline better.
In this chapter, we explore lesser-known but highly important components in LangChain that can enhance a RAG application. We will cover the following:
- Document loaders for loading and processing documents from different sources
- Text splitters for dividing documents into chunks suitable for retrieval
- Output parsers for structuring the responses from the language model
We will use different code labs to step through examples of each type of component, starting with document loaders...