![]() |
VOOZH | about |
LangChain is a modular framework designed to build applications powered by large language models (LLMs). Its architecture allows developers to integrate LLMs with external data, prompt engineering, retrieval-augmented generation (RAG), semantic search, and agent workflows. Below is a detailed walkthrough of LangChainโs main modules, their roles, and code examples, following the latest practices and your provided context.
LangChainโs modularity enables:
Purpose : Structure and format user input into prompts that LLMs can interpret, supporting both plain text and chat-based roles.
Types:
Output
Purpose : Interface with LLMs for text or chat completion. Supports providers like OpenAI, Anthropic, Gemini, etc.
Example (Gemini 2.0 Flash):
Output
Purpose : Parse and structure the raw output from LLMs into usable formats (e.g., extracting values, JSON, or structured text).
Output
Purpose : Augment LLM outputs by retrieving relevant data from external sources (HTML, DOC, S3, web buckets, etc.) and injecting it into prompts.
Components:
Output
Purpose:
Purpose : Store and manage unstructured data for retrieval. LangChain supports loading documents from HTML, DOC, S3, and web buckets, which are then embedded and stored in a vector DB(database) for RAG.
Purpose : Enable autonomous, multi-step reasoning by chaining LLM calls with tool use (calculators, web search, database queries, etc).
Example:
Output
Colab link:Modules of LangChain