LangChain
A Python/JavaScript framework for building LLM applications. LangChain provides chains (sequences of LLM calls), agents (LLMs with tools), memory, and integrations (databases, APIs, vector stores). The most popular LLM app framework, though criticized for abstraction overhead.
- Complex LLM apps (agents, chains, RAG pipelines).
- When you want a framework for LLM logic.
- Prototyping LLM apps quickly.
- Simple LLM calls (use the SDK directly).
- When abstraction overhead hurts.
- When you need full control.
Definition
LangChain is a framework for LLM apps. Chains: pipe LLM calls together. Agents: LLMs that use tools (function calling). Memory: conversation history. Retrievers: vector store integration. Integrations: OpenAI, Anthropic, databases, APIs, vector DBs.
Why it exists
Building LLM apps involves repetitive plumbing — chaining calls, managing memory, integrating tools, handling output. LangChain abstracts this into reusable components.
How it works
Chains: LLMChain, SequentialChain pipe calls. Agents: ReAct, OpenAI functions. Memory: ConversationBufferMemory, etc. Retrievers: wrap vector DBs. LangSmith for observability. LangGraph for complex agent graphs.
Scaling limits
Heavy abstraction (hard to debug). Over-engineering for simple apps. Version churn (API changes often). Performance overhead. Learning curve for the framework itself.
Cost shape
Free and open source. LangSmith (observability) has free + paid tiers.
Alternatives
- Raw SDK (OpenAI/Anthropic) — Direct, no abstraction, more code.
- LlamaIndex — RAG-focused, less general.
- Haystack — NLP-focused, more mature.
Failure modes
- Abstraction complexity.
- API churn.
- Debugging difficulty.
- Over-engineering.
Related terms
LLM (Large Language Model), AI agent, RAG (Retrieval-Augmented Generation), Vector database, Function calling