ModelRefs / LangChain — AI Glossary
LangChain — AI Glossary
An open-source Python and JavaScript framework for building LLM-powered applications with chains, agents, and retrieval components.
Overview
LangChain provides abstractions for model I/O, retrieval, memory, agents, and callbacks. Its composable chain interface became the dominant pattern for LLM app development. LangSmith is its evaluation and observability companion. LangGraph adds stateful graph-based agent orchestration.
Reference details
| Topic | frameworks |
|---|---|
| Last reviewed | 2026-06-24 |
Related terms
How it works
- Model calls, retrievers, parsers and tools are wrapped in a common interface so they compose into a pipeline.
- A chain declares that composition, and the framework handles passing values between steps and parsing between formats.
- Callbacks fire around each step, which is where tracing, logging and streaming hook in without the chain knowing.
- Retrieval, memory and agent loops are provided as built components rather than written, which is the speed benefit and the lock-in in the same sentence.
- Because the abstraction spans many providers, provider-specific capabilities tend to be normalised away or exposed through escape hatches.
Example: What the abstraction costs when you need to debug
A pipeline returns a bad answer. Written directly, the stack is a retrieval call and a model call — two places to inspect and the exact prompt in view. Through a framework the same pipeline is a chain whose prompt was assembled by a template inside a component, so finding what the model actually received means tracing through the abstraction first. The framework saved writing perhaps fifty lines; the debugging cost is paid every time, which is the trade to make deliberately rather than by default.
Commonly confused with
Treated as the way to build with models, when it is one layer of several and often not the one needed. A provider SDK is the thin typed client for one API; a gateway normalises several providers with routing and fallback; a framework like this structures the application itself. For a single model call with a template, the SDK is less code and less indirection. The framework earns its place when the application genuinely needs composed retrievers, memory and agent loops, and it is routinely adopted before that point.
When to use it
Reach for it when:
- An application needs composed retrieval, memory and agent loops rather than single calls.
- Swapping components — retriever, vector store, model — should be a configuration change.
- Built integrations save meaningful work over writing them.
Reach for something else when:
- A single call with a prompt template, where an SDK is less code and more transparent.
- Provider-specific features matter, which the abstraction tends to flatten.
- The team cannot afford the debugging indirection on the critical path.
Continue your research
Use these connected ModelRefs sections to compare alternatives, inspect implementation paths, and review the evidence and governance boundaries relevant to LangChain — AI Glossary.
Frequently asked questions
What is LangChain?
An open-source Python and JavaScript framework for building LLM-powered applications with chains, agents, and retrieval components.
What concepts are related to LangChain?
Closely related concepts include langgraph, llamaindex, agent, rag.