AI/TLDR

LangChain

Build agents and LLM apps from interoperable, swappable components

Overview

LangChain is an open-source framework for building agents and applications powered by large language models. It gives you a standard interface over models, embeddings, vector stores, retrievers, and tools, so you can wire these pieces together into chains and agents instead of writing provider-specific glue code for each one.

It is aimed at developers who want to connect an LLM to their own data and external systems without locking into a single model vendor. Because the abstractions are consistent across providers, you can swap one model for another as your needs change, and you can work at a high level for a quick start or drop down to lower-level components for fine-grained control.

As an app framework in the LLM orchestration space, LangChain sits at the center of a wider ecosystem: LangGraph for controllable agent workflows, Deep Agents for higher-level agent patterns, LangSmith for evaluation and debugging, and LangChain.js for JavaScript and TypeScript projects.

What it does

  • Standard interface across chat models, embeddings, vector stores, and retrievers, so you can swap providers without rewriting your app
  • A large library of third-party integrations for model providers, tools, vector stores, and retrievers
  • Real-time data augmentation: connect LLMs to internal and external data sources
  • Modular, component-based design for rapid prototyping and iteration
  • Flexible abstraction layers, from high-level chains to low-level components
  • Pairs with LangGraph for agent orchestration and LangSmith for evals, observability, and debugging

Getting started

Install the package, then initialize a chat model and call it. The README's example targets a hosted model, so you will need that provider's API key set in your environment.

Install LangChain

Add the package to your Python project. The README uses uv.

bashbash
uv add langchain

Initialize a model and invoke it

Use init_chat_model to load a model by its provider:name string, then call invoke with your prompt.

pythonpython
from langchain.chat_models import init_chat_model

model = init_chat_model("openai:gpt-5.5")
result = model.invoke("Hello, world!")

Go further with agents

For agent orchestration and controllable workflows, look at LangGraph; for developing, debugging, and deploying agents, see LangSmith. A JS/TS equivalent is available as LangChain.js.

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Build a retrieval-augmented chatbot that answers from your own documents using LangChain's retrievers and vector store integrations
  • Prototype and compare different model providers behind a single interface to find the best fit for a task
  • Connect an LLM to external tools and data sources to build an agent that takes actions
  • Stand up a production LLM app with evaluation and observability via the LangSmith integration

How LangChain compares

LangChain alongside other open-source app frameworks tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
LangChain★ 140kBuild agents and LLM apps from interoperable, swappable components
LlamaIndex★ 50.2kA data framework for connecting language models to your own documents and data sources, with built-in agent and retrieval (RAG) tooling.
Haystack★ 25.6kAn orchestration framework from deepset for building modular LLM pipelines and agents for search, RAG, and question answering.
Jina★ 21.9kJina-serve is a Python framework for building, scaling, and deploying AI services and multi-step pipelines that communicate over gRPC, HTTP, and WebSockets.
Prompt Flow★ 11.2kMicrosoft's toolkit for building LLM apps as executable flows that link prompts, Python code, and tools, with tracing, batch evaluation, and deployment.