!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){var t=null;try{t=new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}return t}()||function(){var t=null;try{t=localStorage.getItem("theme")}catch(t){}return t}();t(null!==e?e:"light")}(),document.documentElement.setAttribute("data-announcement-bar-initially-dismissed",function(){try{return"true"===localStorage.getItem("docusaurus.announcement.dismiss")}catch(t){}return!1}())

[Skip to main content](#__docusaurus_skipToContent_fallback)

LangChain v0.2 is coming soon! Preview the new docs [here](/v0.2/docs/introduction/).

[

![🦜️🔗 Langchain](/v0.1/img/brand/wordmark.png)![🦜️🔗 Langchain](/v0.1/img/brand/wordmark-dark.png)

](/v0.1/)[Docs](/v0.1/docs/get_started/introduction/)[Use cases](/v0.1/docs/use_cases/)[Integrations](/v0.1/docs/integrations/platforms/)[API Reference](https://api.js.langchain.com)

[More](#)

*   [People](/v0.1/docs/people/)
*   [Community](/v0.1/docs/community/)
*   [Tutorials](/v0.1/docs/additional_resources/tutorials/)
*   [Contributing](/v0.1/docs/contributing/)

[v0.1](#)

*   [v0.2](https://js.langchain.com/v0.2/docs/introduction)
*   [v0.1](/v0.1/docs/get_started/introduction/)

[🦜🔗](#)

*   [LangSmith](https://smith.langchain.com)
*   [LangSmith Docs](https://docs.smith.langchain.com)
*   [LangChain Hub](https://smith.langchain.com/hub)
*   [LangServe](https://github.com/langchain-ai/langserve)
*   [Python Docs](https://python.langchain.com/)

[Chat](https://chatjs.langchain.com)[](https://github.com/langchain-ai/langchainjs)

Search

*   [Get started](/v0.1/docs/get_started/)
    
    *   [Introduction](/v0.1/docs/get_started/introduction/)
    *   [Installation](/v0.1/docs/get_started/installation/)
    *   [Quickstart](/v0.1/docs/get_started/quickstart/)
*   [LangChain Expression Language](/v0.1/docs/expression_language/)
    
    *   [Get started](/v0.1/docs/expression_language/get_started/)
    *   [Why use LCEL?](/v0.1/docs/expression_language/why/)
    *   [Interface](/v0.1/docs/expression_language/interface/)
    *   [Streaming](/v0.1/docs/expression_language/streaming/)
    *   [How to](/v0.1/docs/expression_language/how_to/routing/)
        
    *   [Cookbook](/v0.1/docs/expression_language/cookbook/)
        
    *   [LangChain Expression Language (LCEL)](/v0.1/docs/expression_language/)
*   [Modules](/v0.1/docs/modules/)
    
    *   [Model I/O](/v0.1/docs/modules/model_io/)
        
    *   [Retrieval](/v0.1/docs/modules/data_connection/)
        
    *   [Chains](/v0.1/docs/modules/chains/)
    *   [Agents](/v0.1/docs/modules/agents/)
        
    *   [More](/v0.1/docs/modules/memory/)
        
*   [Security](/v0.1/docs/security/)
*   [Guides](/v0.1/docs/guides/)
    
*   [Ecosystem](/v0.1/docs/ecosystem/)
    
*   [LangGraph](/v0.1/docs/langgraph/)
*   * * *
    

*   [](/v0.1/)
*   [Get started](/v0.1/docs/get_started/)
*   Introduction

On this page

Introduction
============

**LangChain** is a framework for developing applications powered by language models. It enables applications that:

*   **Are context-aware**: connect a language model to sources of context (prompt instructions, few shot examples, content to ground its response in, etc.)
*   **Reason**: rely on a language model to reason (about how to answer based on provided context, what actions to take, etc.)

This framework consists of several parts.

*   **LangChain Libraries**: The Python and JavaScript libraries. Contains interfaces and integrations for a myriad of components, a basic run time for combining these components into chains and agents, and off-the-shelf implementations of chains and agents.
*   **[LangChain Templates](https://python.langchain.com/docs/templates)**: A collection of easily deployable reference architectures for a wide variety of tasks. (_Python only_)
*   **[LangServe](https://python.langchain.com/docs/langserve)**: A library for deploying LangChain chains as a REST API. (_Python only_)
*   **[LangSmith](https://smith.langchain.com/)**: A developer platform that lets you debug, test, evaluate, and monitor chains built on any LLM framework and seamlessly integrates with LangChain.

![LangChain Diagram](/v0.1/assets/images/langchain_stack_feb_2024-101939844004a99c1b676723fc0ee5e9.webp)

Together, these products simplify the entire application lifecycle:

*   **Develop**: Write your applications in LangChain/LangChain.js. Hit the ground running using Templates for reference.
*   **Productionize**: Use LangSmith to inspect, test and monitor your chains, so that you can constantly improve and deploy with confidence.
*   **Deploy**: Turn any chain into an API with LangServe.

LangChain Libraries[​](#langchain-libraries "Direct link to LangChain Libraries")
---------------------------------------------------------------------------------

The main value props of the LangChain packages are:

1.  **Components**: composable tools and integrations for working with language models. Components are modular and easy-to-use, whether you are using the rest of the LangChain framework or not
2.  **Off-the-shelf chains**: built-in assemblages of components for accomplishing higher-level tasks

Off-the-shelf chains make it easy to get started. Components make it easy to customize existing chains and build new ones.

Get started[​](#get-started "Direct link to Get started")
---------------------------------------------------------

[Here's](/v0.1/docs/get_started/installation/) how to install LangChain, set up your environment, and start building.

We recommend following our [Quickstart](/v0.1/docs/get_started/quickstart/) guide to familiarize yourself with the framework by building your first LangChain application.

Read up on our [Security](/v0.1/docs/security/) best practices to make sure you're developing safely with LangChain.

note

These docs focus on the JS/TS LangChain library. [Head here](https://python.langchain.com) for docs on the Python LangChain library.

LangChain Expression Language (LCEL)[​](#langchain-expression-language-lcel "Direct link to LangChain Expression Language (LCEL)")
----------------------------------------------------------------------------------------------------------------------------------

LCEL 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.

*   **[Overview](/v0.1/docs/expression_language/)**: LCEL and its benefits
*   **[Interface](/v0.1/docs/expression_language/interface/)**: The standard interface for LCEL objects
*   **[How-to](/v0.1/docs/expression_language/how_to/routing/)**: Key features of LCEL
*   **[Cookbook](/v0.1/docs/expression_language/cookbook/)**: Example code for accomplishing common tasks

Modules[​](#modules "Direct link to Modules")
---------------------------------------------

LangChain provides standard, extendable interfaces and integrations for the following modules:

#### [Model I/O](/v0.1/docs/modules/model_io/)[​](#model-io "Direct link to model-io")

Interface with language models

#### [Retrieval](/v0.1/docs/modules/data_connection/)[​](#retrieval "Direct link to retrieval")

Interface with application-specific data

#### [Agents](/v0.1/docs/modules/agents/)[​](#agents "Direct link to agents")

Let models choose which tools to use given high-level directives

Examples, ecosystem, and resources[​](#examples-ecosystem-and-resources "Direct link to Examples, ecosystem, and resources")
----------------------------------------------------------------------------------------------------------------------------

### [Use cases](/v0.1/docs/use_cases/)[​](#use-cases "Direct link to use-cases")

Walkthroughs and techniques for common end-to-end use cases, like:

*   [Document question answering](/v0.1/docs/use_cases/question_answering/)
*   [RAG](/v0.1/docs/use_cases/question_answering/)
*   [Agents](/v0.1/docs/use_cases/autonomous_agents/)
*   and much more...

### [Integrations](/v0.1/docs/integrations/platforms/)[​](#integrations "Direct link to 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](/v0.1/docs/integrations/platforms/).

### [API reference](https://api.js.langchain.com)[​](#api-reference "Direct link to api-reference")

Head to the reference section for full documentation of all classes and methods in the LangChain and LangChain Experimental packages.

### [Developer's guide](/v0.1/docs/contributing/)[​](#developers-guide "Direct link to developers-guide")

Check out the developer's guide for guidelines on contributing and help getting your dev environment set up.

### [Community](/v0.1/docs/community/)[​](#community "Direct link to community")

Head to the [Community navigator](/v0.1/docs/community/) to find places to ask questions, share feedback, meet other developers, and dream about the future of LLM's.

* * *

#### Help us out by providing feedback on this documentation page:

[

Previous

Get started

](/v0.1/docs/get_started/)[

Next

Installation

](/v0.1/docs/get_started/installation/)

*   [LangChain Libraries](#langchain-libraries)
*   [Get started](#get-started)
*   [LangChain Expression Language (LCEL)](#langchain-expression-language-lcel)
*   [Modules](#modules)
*   [Examples, ecosystem, and resources](#examples-ecosystem-and-resources)
    *   [Use cases](#use-cases)
    *   [Integrations](#integrations)
    *   [API reference](#api-reference)
    *   [Developer's guide](#developers-guide)
    *   [Community](#community)

Community

*   [Discord](https://discord.gg/cU2adEyC7w)
*   [Twitter](https://twitter.com/LangChainAI)

GitHub

*   [Python](https://github.com/langchain-ai/langchain)
*   [JS/TS](https://github.com/langchain-ai/langchainjs)

More

*   [Homepage](https://langchain.com)
*   [Blog](https://blog.langchain.dev)

Copyright © 2024 LangChain, Inc.