Introduction
LangChain is a framework for developing applications powered by large language models (LLMs).
LangChain simplifies every stage of the LLM application lifecycle:
- Development: Build your applications using LangChain's open-source building blocks and components. Hit the ground running using third-party integrations and Templates.
- Productionization: Use LangSmith to inspect, monitor and evaluate your chains, so that you can continuously optimize and deploy with confidence.
- Deployment: Turn any chain into an API with LangServe.
Concretely, the framework consists of the following open-source libraries:
langchain-core
: Base abstractions and LangChain Expression Language.langchain-community
: Third party integrations.- Partner packages (e.g.
langchain-openai
,langchain-anthropic
, etc.): Some integrations have been further split into their own lightweight packages that only depend onlangchain-core
.
- Partner packages (e.g.
langchain
: Chains, agents, and retrieval strategies that make up an application's cognitive architecture.- langgraph: Build robust and stateful multi-actor applications with LLMs by modeling steps as edges and nodes in a graph.
- langserve: Deploy LangChain chains as REST APIs.
The broader ecosystem includes:
- LangSmith: A developer platform that lets you debug, test, evaluate, and monitor LLM applications and seamlessly integrates with LangChain.
Get startedβ
We recommend following our Quickstart guide to familiarize yourself with the framework by building your first LangChain application.
See here for instructions on how to install LangChain, set up your environment, and start building.
These docs focus on the Python LangChain library. Head here for docs on the JavaScript LangChain library.
Use casesβ
If you're looking to build something specific or are more of a hands-on learner, check out our use-cases. They're walkthroughs and techniques for common end-to-end tasks, such as:
Expression Languageβ
LangChain Expression Language (LCEL) is the foundation of many of LangChain's components, and is a declarative way to compose chains. LCEL was designed from day 1 to support putting prototypes in production, with no code changes, from the simplest βprompt + LLMβ chain to the most complex chains.
- Get started: LCEL and its benefits
- Runnable interface: The standard interface for LCEL objects
- Primitives: More on the primitives LCEL includes
- and more!
Ecosystemβ
π¦π οΈ LangSmithβ
Trace and evaluate your language model applications and intelligent agents to help you move from prototype to production.
π¦πΈοΈ LangGraphβ
Build stateful, multi-actor applications with LLMs, built on top of (and intended to be used with) LangChain primitives.
π¦π LangServeβ
Deploy LangChain runnables and chains as REST APIs.
Securityβ
Read up on our Security best practices to make sure you're developing safely with LangChain.
Additional resourcesβ
Componentsβ
LangChain provides standard, extendable interfaces and integrations for many different components, including:
Integrationsβ
LangChain is part of a rich ecosystem of tools that integrate with our framework and build on top of it. Check out our growing list of integrations.
Guidesβ
Best practices for developing with LangChain.
API referenceβ
Head to the reference section for full documentation of all classes and methods in the LangChain and LangChain Experimental Python packages.
Contributingβ
Check out the developer's guide for guidelines on contributing and help getting your dev environment set up.