LangChain: Framework for LLM Apps and Agents
LangChain is a Python framework, with a parallel LangChain.js port, for chaining LLM calls, retrieval, and tool use into working applications instead of writing that glue code from scratch. Reach for it when you're juggling multiple model providers or data sources and want one interface to swap between them. Skip it if you just need a single prompt-response call: that's an SDK call, not a framework problem.
What is LangChain?
LangChain is an open source Python framework (MIT-licensed) for building LLM-powered applications and agents out of interoperable pieces: model wrappers, prompt templates, retrievers, tool definitions, and chains or graphs that string them together. You compose these instead of hand-writing API glue for every provider you touch. For deeper agent orchestration, LangChain hands off to a companion project, LangGraph.
Key Features for LLM Application Development
- โStandard interfaces for chat models, embeddings, and vector stores, so swapping OpenAI for another provider means changing a config string, not rewriting call sites
- โA large catalog of third-party integrations covering model providers, tools, retrievers, and vector stores
- โChain and graph composition for multi-step LLM workflows, with LangGraph handling the lower-level orchestration when workflows get complex
- โDeep Agents, a higher-level package built on LangChain, ships built-in patterns for planning, subagents, and file system access
- โPython and JavaScript/TypeScript implementations, maintained as separate repositories
- โMIT license, so there's no proprietary lock-in on the framework code itself
Getting Started with LangChain
LangChain's README documents installing with the uv package manager: `uv add langchain`. The JS/TS equivalent, LangChain.js, lives in its own repository with its own install path not detailed here. Beyond the package add command, the README points to the docs site rather than spelling out further setup in-repo.
Basic LangChain Usage Example
The quickstart is a model call, not a chain: import `init_chat_model` from `langchain.chat_models`, point it at a provider string like `"openai:gpt-5.5"`, and call `.invoke()` with a prompt. Composing that into retrieval, tools, or multi-step agent behavior is where LangChain's other pieces (and LangGraph, for orchestration) come in. The README doesn't include a full chain example beyond this single call.
Strengths
- โOne interface for models, embeddings, and vector stores means switching providers is a config change, not a rewrite
- โThe integration catalog spans model providers, tools, retrievers, and vector stores, per the README, so most common LLM plumbing already has a wrapper
- โDeep Agents gives you planning, subagents, and file system access as a pre-built pattern instead of assembling that yourself
- โMIT license on the core framework
When to Consider LangGraph or Deep Agents
- โณThe quickstart only shows a single `.invoke()` call; the README doesn't include a worked chain or agent example in-repo, so you'll be reading the separate docs site to see the pieces combined
- โณAgent orchestration isn't native to this package: the README itself redirects you to LangGraph for controllable, complex agent workflows
- โณThe integration catalog is wide, which means picking the right retriever or vector store integration for your stack is its own research task before you write code
- โณModel identifiers like `"openai:gpt-5.5"` in the quickstart tie you to whatever provider naming LangChain currently supports, and that surface changes as providers ship new models
LangChain.js and Other Related Tools
Frequently Asked Questions
LangChain is MIT-licensed, per the repository's license file, so there are no usage restrictions or paid tiers on the core framework code.
The core LangChain framework covered here is Python. A separate implementation, LangChain.js, covers JavaScript and TypeScript in its own repository.
LangChain integrates through its catalog of third-party integrations: standard interfaces for chat models, embeddings, tools, and vector stores that let you plug in a provider without rewriting your application code.
LangChain provides the components (model wrappers, prompts, retrieval, tools), while LangGraph is the README's recommended framework for controllable, lower-level agent orchestration when workflows get complex.
The README points to LangSmith for the observability, evaluation, and debugging piece of production use; LangChain itself doesn't document deployment tooling directly in this repo.
Deep Agents is a higher-level package built on top of LangChain, per the README, adding built-in patterns like planning, subagents, and file system usage for common agent tasks.
The problem it solves
Building an LLM app means touching several moving parts at once: a model provider's API, a retrieval step, tool-calling, and often a multi-step agent loop, each with its own SDK shape. LangChain's README frames this as chaining together interoperable components and third-party integrations so a provider swap or a new tool doesn't mean rewriting your application's glue code.
Best use cases
- โขRetrieval-augmented generation apps that pull from your own data through a vector store integration
- โขMulti-step agents that call tools and reason across several turns, especially once you bring in LangGraph for the orchestration layer or Deep Agents for the built-in planning and subagent patterns
- โขProjects that need to swap model providers mid-development without rewriting the calling code each time
- โขFast prototypes where you'd rather compose existing model, retriever, and tool wrappers than write provider-specific glue for a proof of concept
Who should try it โ and who should skip
Try LangChain if you're building an app that touches more than one model provider, or that needs retrieval plus tool use plus multi-step reasoning, and you'd rather compose that from documented pieces than write it from scratch. Skip it if your app is one prompt hitting one model: install the provider's own SDK and call it directly.
Related repositories
Is LangChain worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of LangChain.
