# LangChain
LangChain is an open-source orchestration framework for building applications with [[Large Language Models (LLMs)]]. Available in both Python and JavaScript, it provides tools and APIs to simplify building LLM-driven applications like chatbots, [[AI Agents]], and [[Retrieval-Augmented Generation (RAG)]] systems.
The framework serves as a generic interface for nearly any LLM, providing a centralized development environment to build applications and integrate them with external data sources and software workflows.
## Key Features
- **Modular architecture**: Chain together interoperable components
- **Model agnostic**: Connect to [[OpenAI]], [[Anthropic]], Google, and other providers
- **Tool integration**: Built-in support for external tools and APIs
- **Memory systems**: Short-term and long-term conversation memory
- **Retrieval mechanisms**: Document loaders, text splitters, and [[Vector Store|Vector Stores]]
- **Prompt templates**: Reusable, parameterized prompts
## Core Components
LangChain's ecosystem includes several libraries:
| Component | Purpose |
|-----------|---------|
| LangChain-core | Fundamental abstractions for chat models |
| Integration packages | Provider-specific integrations (OpenAI, Anthropic, etc.) |
| Chains | Sequential processing pipelines |
| Agents | Autonomous decision-making components |
| Retrievers | Document retrieval mechanisms |
## Architecture
LangChain applications typically follow patterns:
- **Chains**: Linear sequences of operations (input → process → output)
- **[[AI Agents]]**: Dynamic decision-making with tool selection
- **[[RAG Pipelines]]**: Retrieve context → Augment prompt → Generate response
## Limitations
- Steep learning curve due to layered abstractions
- Overhead may be excessive for simple applications
- Rapid API changes between versions
## References
- https://www.langchain.com/
- https://docs.langchain.com/
- https://github.com/langchain-ai/langchain
## Related
- [[LangGraph]]
- [[AI Agents]]
- [[Large Language Models (LLMs)]]
- [[Mastra AI]]
- [[Directed Acyclic Graphs (DAG)]]
- [[Python]]
- [[TypeScript]]
- [[Retrieval-Augmented Generation (RAG)]]
- [[Vector Store]]
- [[RAG Pipelines]]