Main LangChain building blocks
Let’s have a high-level look at key LangChain building blocks. If you need a refresher on terms such as vectorstore, or embeddings are new to you, feel free to check the Index where you can find more details and links to relevant chapters with more detailed explanations.
Data structures
First, let’s explore some key data structures that you might encounter while developing applications. LangChain uses Pydantic, a Python data validation library; therefore, almost all LangChain data structures are Pydantic base models [7]. For those of you who are new to Pydantic, it’s a data validation Python library that allows you to define your data schemas, and if you haven’t heard about it, then you probably used an alternative schema definition library – dataclasses
.
Note that LangChain has also its own langchain_core.load.Serializable
class that inherits from Basemodel
and adds additional control over serialization of...