What it is
LangChain is an open-source (MIT) framework for building applications on top of language models. It standardizes the tedious parts: prompt templates, model abstraction across providers, output parsing, retrieval over your documents, tool calling, memory and agent loops. LangGraph, a separate package from the same team, handles stateful, cyclic agent workflows — the part plain chains can’t express.
It’s the biggest name in the LLM-framework space, for better and for worse, and it moved fast enough that old tutorials rot within months. Check the current docs before trusting any code snippet, including this one.
What it actually does
You wire a prompt to a model to a parser in a Runnable chain, add retrievers for RAG, add tools for agents, add memory for conversations. LangSmith (the commercial sibling) traces and evaluates runs. The integration catalogue covers OpenAI, Anthropic, Google, local Ollama, vector stores (Pinecone, Chroma, pgvector), loaders for PDFs/HTML/Notion/Slack, and structured-output helpers.
pip install langchain langchain-openai
from langchain_openai import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
prompt = ChatPromptTemplate.from_template("Explain {topic} in three bullet points.")
chain = prompt | ChatOpenAI(model="gpt-5")
print(chain.invoke({"topic": "utility-first CSS"}).content)
How it compares to alternatives
vs LlamaIndex. The classic pair. LangChain is a general orchestration framework — chains, agents, tools, memory, model abstraction. LlamaIndex is laser-focused on the data side: ingestion, indexing, retrieval and query engines for RAG. If your app is 70% retrieval, start with LlamaIndex; if it’s agents, tools and provider gymnastics, start with LangChain. Many stacks use both.
vs raw provider SDKs. For a single prompt-to-completion call, the OpenAI SDK alone is simpler and has fewer abstraction leaks. LangChain pays off when you need provider-agnostic wiring, retrievers and reusable chains — otherwise you’re adopting a framework to avoid ten lines of code.
Pricing and free tier
The framework is free and open source. LangSmith (tracing, evals, monitoring) has a free developer tier and paid team/enterprise plans; LangGraph Platform for deployed agents is likewise commercial. The framework itself never bills you — only your model API usage does. Check langchain.com for LangSmith pricing.
Where it shines / where it doesn’t
Shines: provider-agnostic prototyping, agent and tool-calling loops via LangGraph, RAG pipelines with swappable retrievers, structured output parsing, and ecosystem breadth — whatever loader or vector store you want probably exists.
Doesn’t: hide API quirks (models still behave differently), stay stable — breaking changes and deprecation churn are real, add runtime overhead you may not feel but will pay in debugging, and suit tiny single-call apps where plain SDKs are cleaner.
Getting started in 3 minutes
pip install langchain langchain-openai
export OPENAI_API_KEY=sk-...
python
>>> from langchain_openai import ChatOpenAI
>>> ChatOpenAI().invoke("One sentence on why diagrams-as-code wins.").content
Then swap the model string for ChatAnthropic or a local ChatOllama — the chain code doesn’t change. That portability is the actual product.
60-second verdict checklist
- Do you actually need orchestration, or just one good model call?
- Are your versions pinned, and do you read deprecation warnings?
- Is LangSmith (or another tracer) wired before you debug agent loops by print?
A note on team adoption
Framework sprawl kills LLM teams. Agree on one orchestration surface, one tracing tool and one deployment target, document the decision, and ruthlessly delete side projects. LangChain rewards teams that wrap it in their own thin, tested helpers instead of sprinkling chains across the codebase. Half a day of internal conventions beats a quarter of integration archaeology.
Three mistakes teams make
First, copy-pasting a three-year-old LangChain tutorial and wondering why half the imports are gone — this ecosystem churns, so pin versions and read current docs. Second, wrapping everything in chains when a plain function with one model call is clearer; abstraction should earn its keep. Third, skipping LangSmith traces and debugging agent loops by print statements — the trace view is how you spot the tool call that went sideways. Keep your business logic in plain Python, use LangChain at the edges, and treat deprecation warnings as homework.
PeaBox fit
PeaBox prototypes LLM features fast and deletes them faster if they don’t earn their keep. LangChain is the scaffolding for those prototypes: swap providers freely, wire retrieval against our own docs, trace with LangSmith before shipping. For the retrieval-heavy side we reach for LlamaIndex; for TypeScript web apps, Vercel AI SDK is usually the leaner choice.
The honest practitioner take
LangChain is a power tool with exposed blades. In expert hands it collapses weeks of integration work into afternoons. In untrained hands it produces unreadable 400-line chains that leak abstraction everywhere and break on the next minor release. My rule: use LangChain/LangGraph for orchestration and integrations, but keep your prompts, your evals and your data layer in plain, testable code you own. And pin your versions — this ecosystem moves.
APIs and pricing approximate as of Nov 2026; check langchain.com for current docs.