LangChain 101: A Framework for Building AI-Powered Applications
This newsletter breaks down LangChain’s architecture, key components, and how it simplifies building AI-powered applications with LLMs.
👋 Hey! This is Manisha Arora from PrepVector. Welcome to the Tech Growth Series, a newsletter that aims to bridge the gap between academic knowledge and practical aspects of data science. My goal is to simplify complicated data concepts, share my perspectives on the latest trends, and share my learnings from building and leading data teams.
If you’ve been following the AI space, you already know how rapidly things are changing. One day it’s just LLMs, the next we’re talking about embeddings, vector stores, and AI agents running workflows on autopilot. It’s an exciting but overwhelming time!
Imagine you want to build an AI-powered chatbot. You’d need to stitch together multiple components:
LLMs
prompts, embeddings
retrieval mechanisms, and
Integrations
That’s where LangChain comes in.
Technically, LangChain is an open-source framework designed to simplify the entire LLM application lifecycle, from development to production. It provides a standard interface for LLMs, embedding models, vector stores, and integrations with hundreds of providers, making it easy to develop, scale, and maintain AI-powered applications.
In simple terms, it gives you Lego-like building blocks to connect LLMs, vector databases, and APIs—without having to reinvent the wheel.
In this blog, we try to break down its main components.
About the Authors:
Arun Subramanian: Arun is an Associate Principal of Analytics & Insights at Amazon Ads, where he leads development and deployment of innovative insights to optimize advertising performance at scale. He has over 12 years of experience and is skilled in crafting strategic analytics roadmap, nurturing talent, collaborating with cross-functional teams, and communicating complex insights to diverse stakeholders.
Manisha Arora: Manisha is a Data Science Lead at Google Ads, where she leads the Measurement & Incrementality vertical across Search, YouTube, and Shopping. She has 12 years experience in enabling data-driven decision making for product growth.
LangChain Architecture
LangChain is built on a modular framework, ensuring flexibility and scalability. Here’s a breakdown of its core components:
langchain-core
This package contains base abstractions for different components and ways to compose them together. The interfaces for core components like chat models, vector stores, tools and more are defined here. The dependencies are very lightweight, without third-party integrations.
langchain
The main `langchain` package contains chains and retrieval strategies that make up an application's cognitive architecture. These are NOT third-party integrations. All chains, agents, and retrieval strategies here are NOT specific to any one integration, but rather generic across all integrations.
Integration packages
Popular integrations have their own packages (e.g. langchain-openai, langchain-anthropic, etc) so that they can be properly versioned and appropriately lightweight. For more information see: integrations packages. The API Reference where you can find detailed information about each of the integration packages.
langchain-community
This package contains third-party integrations that are maintained by the LangChain community. This contains integrations for various components (chat models, vector stores, document loaders, embeddings, output parsers, agents, etc).
langgraph
LangGraph provides low-level supporting infrastructure that sits underneath any workflow or agent. It provides three central benefits:
✅ Persistence (memory, human-in-the-loop interactions)
✅ Streaming for real-time LLM applications
✅ Debugging & Deployment tools for better reliability
langserve
A package to deploy LangChain chains as REST APIs. Makes it easy to get a production ready API up and running.
LangSmith
A developer platform that lets you debug, test, evaluate, and monitor LLM applications, ensuring robustness and performance at scale.
Reference Image : https://python.langchain.com/svg/langchain_stack_112024.svg
Final Thoughts
LangChain streamlines AI application development, making it easier to integrate LLMs, manage complex workflows, and scale applications efficiently. Whether you're an ML engineer, data scientist, or developer, LangChain provides the building blocks for creating powerful AI-driven solutions.
In the next edition, we will go through a practical example of how to use LangChain for building an LLM application. Stay tuned and subscribe to the newsletter.
🚀 Join Our Data Science Community!
Become a part of the Learn Data Science with Me community and connect with fellow professionals on the same journey. Get access to exclusive content, participate in interactive discussions, and stay updated on challenges, speaker events, and more. Join us today and accelerate your learning with a supportive network of data science enthusiasts!
Check out my upcoming courses:
Master Product Sense and AB Testing, and learn to use statistical methods to drive product growth. I focus on inculcating a problem-solving mindset, and application of data-driven strategies, including A/B Testing, ML, and Causal Inference, to drive product growth.
AI/ML Projects for Data Professionals
Gain hands-on experience and build a portfolio of industry AI/ML projects. Scope ML Projects, get stakeholder buy-in, and execute the workflow from data exploration to model deployment. You will learn to use coding best practices to solve end-to-end AI/ML Projects to showcase to the employer or clients.
Not sure which course aligns with your goals? Send me a message on LinkedIn with your background and aspirations, and I'll help you find the best fit for your journey.