LangChain

Key Components of LangChain

Building Blocks of LangChain

Previously, we provided an overview of LangChain. In this article, we’ll dive into LangChain’s architecture and explore its six core building blocks. Acting as middleware, LangChain connects your application to Large Language Models (LLMs), vector stores, embedding models, and other data sources—providing abstractions that simplify integration and accelerate development.

Below is a high-level diagram illustrating these components:

The image illustrates the building blocks of LangChain, including components like Model I/O, Memory, Retrieval, and Agents, along with elements such as Language Models, Vector Databases, Embeddings, and External Data.

ComponentPurposeExamples
Model I/OManages prompt formatting, response parsing, and streamingOpenAI, Anthropic, Hugging Face
MemoryPersists conversational context or stateRedis, in-memory cache
RetrievalRetrieves relevant documents or embeddingsPinecone, FAISS, Weaviate
AgentsOrchestrates decision-making across tools and APIsCustom toolkits, action chains
EmbeddingsConverts text into vectors for similarity searchOpenAI Embeddings, Cohere
External DataIntegrates external knowledge sources (databases, APIs)SQL/NoSQL, RESTful APIs

Each building block plays a vital role in crafting production-grade applications with LangChain. In the sections that follow, we’ll examine each component in detail and show you how to leverage them effectively.

Watch Video

Watch video content

Previous
Key Use Cases