Generative AI","metadata":{}},{"id":"faq-hub#faq-type#what-is","name":"what-is","namespaceId":"faq-hub#faq-type","description":"
what-is","metadata":{}}]}}]},"metadata":{"auth":{},"testAttributes":{}},"context":{"page":{"locale":null,"site":null,"pageUrl":"https://aws.amazon.com/what-is/langchain/","targetName":null,"pageSlotId":null,"organizationId":null,"availableLocales":null},"environment":{"stage":"prod","region":"us-east-1"},"sdkVersion":"1.0.115"},"refMap":{"manifest.js":"289765ed09","what-is-header.js":"251923df8a","what-is-header.rtl.css":"ccf4035484","what-is-header.css":"ce47058367","what-is-header.css.js":"004a4704e8","what-is-header.rtl.css.js":"f687973e4f"},"settings":{"templateMappings":{"category":"category","headline":"headline","primaryCTA":"primaryCTA","primaryCTAText":"primaryCTAText","primaryBreadcrumbText":"primaryBreadcrumbText","primaryBreadcrumbURL":"primaryBreadcrumbURL"}}}
LangChain is an open source framework for building applications based on large language models (LLMs). LLMs are large deep-learning models pre-trained on large amounts of data that can generate responses to user queries—for example, answering questions or creating images from text-based prompts. LangChain provides tools and abstractions to improve the customization, accuracy, and relevancy of the information the models generate. For example, developers can use LangChain components to build new prompt chains or customize existing templates. LangChain also includes components that allow LLMs to access new data sets without retraining. \n
Read about Large Language Models (LLMs)","id":"seo-faq-pairs#what-is-langchain","customSort":"1"},"metadata":{"tags":[{"id":"seo-faq-pairs#faq-collections#langchain","name":"langchain","namespaceId":"seo-faq-pairs#faq-collections","description":" langchain","metadata":{}}]}},{"fields":{"faqQuestion":"Why is LangChain important? ","faqAnswer":" LLMs excel at responding to prompts in a general context, but struggle in a specific domain they were never trained on. Prompts are queries people use to seek responses from an LLM. For example, an LLM can provide an answer to how much a computer costs by providing an estimate. However, it can't list the price of a specific computer model that your company sells. \n To do that, machine learning engineers must integrate the LLM with the organization’s internal data sources and apply prompt engineering—a practice where a data scientist refines inputs to a generative model with a specific structure and context. \n LangChain streamlines intermediate steps to develop such data-responsive applications, making prompt engineering more efficient. It is designed to develop diverse applications powered by language models more effortlessly, including chatbots, question-answering, content generation, summarizers, and more. \n The following sections describe benefits of LangChain. \n With LangChain, organizations can repurpose LLMs for domain-specific applications without retraining or fine-tuning. Development teams can build complex applications referencing proprietary information to augment model responses. For example, you can use LangChain to build applications that read data from stored internal documents and summarize them into conversational responses. You can create a Retrieval Augmented Generation (RAG) workflow that introduces new information to the language model during prompting. Implementing context-aware workflows like RAG reduces model hallucination and improves response accuracy. \n LangChain simplifies artificial intelligence (AI) development by abstracting the complexity of data source integrations and prompt refining. Developers can customize sequences to build complex applications quickly. Instead of programming business logic, software teams can modify templates and libraries that LangChain provides to reduce development time. \n LangChain provides AI developers with tools to connect language models with external data sources. It is open-source and supported by an active community. Organizations can use LangChain for free and receive support from other developers proficient in the framework.","id":"seo-faq-pairs#why-is-langchain-important","customSort":"2"},"metadata":{"tags":[{"id":"seo-faq-pairs#faq-collections#langchain","name":"langchain","namespaceId":"seo-faq-pairs#faq-collections","description":" langchain","metadata":{}}]}},{"fields":{"faqQuestion":"How does LangChain work? ","faqAnswer":" With LangChain, developers can adapt a language model flexibly to specific business contexts by designating steps required to produce the desired outcome. \n Chains are the fundamental principle that holds various AI components in LangChain to provide context-aware responses. A chain is a series of automated actions from the user's query to the model's output. For example, developers can use a chain for: \n Chains are made of links. Each action that developers string together to form a chained sequence is called a link. With links, developers can divide complex tasks into multiple, smaller tasks. Examples of links include: \n In the LangChain framework, a link accepts input from the user and passes it to the LangChain libraries for processing. LangChain also allows link reordering to create different AI workflows. \n To use LangChain, developers install the framework in Python with the following command: \n pip install langchain \n Developers then use the chain building blocks or LangChain Expression Language (LCEL) to compose chains with simple programming commands. The chain() function passes a link's arguments to the libraries. The execute() command retrieves the results. Developers can pass the current link result to the following link or return it as the final output. \n Below is an example of a chatbot chain function that returns product details in multiple languages. \n chain([ \n retrieve_data_from_product_database(). \n send_data_to_language_model(). \n format_output_in_a_list(). \n translate_output_in_target_language() \n ]) \n ","id":"seo-faq-pairs#how-does-langchain-work","customSort":"3"},"metadata":{"tags":[{"id":"seo-faq-pairs#faq-collections#langchain","name":"langchain","namespaceId":"seo-faq-pairs#faq-collections","description":" langchain","metadata":{}}]}},{"fields":{"faqQuestion":"What are the core components of LangChain? ","faqAnswer":" Using LangChain, software teams can build context-aware language model systems with the following modules. \n LangChain provides APIs with which developers can connect and query LLMs from their code. Developers can interface with public and proprietary models like GPT, Bard, and PaLM with LangChain by making simple API calls instead of writing complex code. \n Prompt templates are pre-built structures developers use to consistently and precisely format queries for AI models. Developers can create a prompt template for chatbot applications, few-shot learning, or deliver specific instructions to the language models. Moreover, they can reuse the templates across different applications and language models. \n Developers use tools and libraries that LangChain provides to compose and customize existing chains for complex applications. An agent is a special chain that prompts the language model to decide the best sequence in response to a query. When using an agent, developers provide the user's input, available tools, and possible intermediate steps to achieve the desired results. Then, the language model returns a viable sequence of actions the application can take. \n LangChain enables the architecting of RAG systems with numerous tools to transform, store, search, and retrieve information that refine language model responses. Developers can create semantic representations of information with word embeddings and store them in local or cloud vector databases. \n Some conversational language model applications refine their responses with information recalled from past interactions. LangChain allows developers to include memory capabilities in their systems. It supports: \n Callbacks are codes that developers place in their applications to log, monitor, and stream specific events in LangChain operations. For example, developers can track when a chain was first called and errors encountered with callbacks. ","id":"seo-faq-pairs#what-are-the-core-components-of-langchain","customSort":"4"},"metadata":{"tags":[{"id":"seo-faq-pairs#faq-collections#langchain","name":"langchain","namespaceId":"seo-faq-pairs#faq-collections","description":" langchain","metadata":{}}]}},{"fields":{"faqQuestion":"How can AWS help with your LangChain requirements? ","faqAnswer":" Using Amazon Bedrock, Amazon Kendra, Amazon SageMaker JumpStart, LangChain, and your LLMs, you can build highly-accurate generative artificial intelligence (generative AI) applications on enterprise data. LangChain is the interface that ties these components together: \n Get started with LangChain on AWS by creating an account today.","id":"seo-faq-pairs#how-can-aws-help-with-your-langchain-requirements","customSort":"5"},"metadata":{"tags":[{"id":"seo-faq-pairs#faq-collections#langchain","name":"langchain","namespaceId":"seo-faq-pairs#faq-collections","description":" langchain","metadata":{}}]}}]},"metadata":{"auth":{},"pagination":{"empty":false,"present":true},"testAttributes":{}},"context":{"page":{"locale":null,"site":null,"pageUrl":"https://aws.amazon.com/what-is/langchain/","targetName":null,"pageSlotId":null,"organizationId":null,"availableLocales":null},"environment":{"stage":"prod","region":"us-east-1"},"sdkVersion":"1.0.115"},"refMap":{"manifest.js":"3dea65b485","rt-faq.rtl.css":"75bc12ff4b","rt-faq.css":"b00bda11a1","rt-faq.css.js":"0af1d62724","rt-faq.js":"da177bdd5f","rt-faq.rtl.css.js":"a89cd83194"},"settings":{"templateMappings":{"question":"faqQuestion","answer":"faqAnswer"}}}
LangChain is an open source framework for building applications based on large language models (LLMs). LLMs are large deep-learning models pre-trained on large amounts of data that can generate responses to user queries—for example, answering questions or creating images from text-based prompts. LangChain provides tools and abstractions to improve the customization, accuracy, and relevancy of the information the models generate. For example, developers can use LangChain components to build new prompt chains or customize existing templates. LangChain also includes components that allow LLMs to access new data sets without retraining. LLMs excel at responding to prompts in a general context, but struggle in a specific domain they were never trained on. Prompts are queries people use to seek responses from an LLM. For example, an LLM can provide an answer to how much a computer costs by providing an estimate. However, it can't list the price of a specific computer model that your company sells. To do that, machine learning engineers must integrate the LLM with the organization’s internal data sources and apply prompt engineering—a practice where a data scientist refines inputs to a generative model with a specific structure and context. LangChain streamlines intermediate steps to develop such data-responsive applications, making prompt engineering more efficient. It is designed to develop diverse applications powered by language models more effortlessly, including chatbots, question-answering, content generation, summarizers, and more. The following sections describe benefits of LangChain. With LangChain, organizations can repurpose LLMs for domain-specific applications without retraining or fine-tuning. Development teams can build complex applications referencing proprietary information to augment model responses. For example, you can use LangChain to build applications that read data from stored internal documents and summarize them into conversational responses. You can create a Retrieval Augmented Generation (RAG) workflow that introduces new information to the language model during prompting. Implementing context-aware workflows like RAG reduces model hallucination and improves response accuracy. LangChain simplifies artificial intelligence (AI) development by abstracting the complexity of data source integrations and prompt refining. Developers can customize sequences to build complex applications quickly. Instead of programming business logic, software teams can modify templates and libraries that LangChain provides to reduce development time. LangChain provides AI developers with tools to connect language models with external data sources. It is open-source and supported by an active community. Organizations can use LangChain for free and receive support from other developers proficient in the framework. With LangChain, developers can adapt a language model flexibly to specific business contexts by designating steps required to produce the desired outcome. Chains are the fundamental principle that holds various AI components in LangChain to provide context-aware responses. A chain is a series of automated actions from the user's query to the model's output. For example, developers can use a chain for: Chains are made of links. Each action that developers string together to form a chained sequence is called a link. With links, developers can divide complex tasks into multiple, smaller tasks. Examples of links include: In the LangChain framework, a link accepts input from the user and passes it to the LangChain libraries for processing. LangChain also allows link reordering to create different AI workflows. To use LangChain, developers install the framework in Python with the following command: pip install langchain Developers then use the chain building blocks or LangChain Expression Language (LCEL) to compose chains with simple programming commands. The chain() function passes a link's arguments to the libraries. The execute() command retrieves the results. Developers can pass the current link result to the following link or return it as the final output. Below is an example of a chatbot chain function that returns product details in multiple languages. chain([ retrieve_data_from_product_database(). send_data_to_language_model(). format_output_in_a_list(). translate_output_in_target_language() ]) Using LangChain, software teams can build context-aware language model systems with the following modules. LangChain provides APIs with which developers can connect and query LLMs from their code. Developers can interface with public and proprietary models like GPT, Bard, and PaLM with LangChain by making simple API calls instead of writing complex code. Prompt templates are pre-built structures developers use to consistently and precisely format queries for AI models. Developers can create a prompt template for chatbot applications, few-shot learning, or deliver specific instructions to the language models. Moreover, they can reuse the templates across different applications and language models. Developers use tools and libraries that LangChain provides to compose and customize existing chains for complex applications. An agent is a special chain that prompts the language model to decide the best sequence in response to a query. When using an agent, developers provide the user's input, available tools, and possible intermediate steps to achieve the desired results. Then, the language model returns a viable sequence of actions the application can take. LangChain enables the architecting of RAG systems with numerous tools to transform, store, search, and retrieve information that refine language model responses. Developers can create semantic representations of information with word embeddings and store them in local or cloud vector databases. Some conversational language model applications refine their responses with information recalled from past interactions. LangChain allows developers to include memory capabilities in their systems. It supports: Callbacks are codes that developers place in their applications to log, monitor, and stream specific events in LangChain operations. For example, developers can track when a chain was first called and errors encountered with callbacks. Using Amazon Bedrock, Amazon Kendra, Amazon SageMaker JumpStart, LangChain, and your LLMs, you can build highly-accurate generative artificial intelligence (generative AI) applications on enterprise data. LangChain is the interface that ties these components together: Get started with LangChain on AWS by creating an account today.Repurpose language models \n
Simplify AI development \n
Developer support \n
Chains \n
\n
Links \n
\n
Overview \n
LLM interface \n
Prompt templates \n
Agents \n
Retrieval modules \n
Memory \n
\n
Callbacks \n
\n
What is LangChain?
Why is LangChain important?
Repurpose language models
Simplify AI development
Developer support
How does LangChain work?
Chains
Links
Overview
What are the core components of LangChain?
LLM interface
Prompt templates
Agents
Retrieval modules
Memory
Callbacks
How can AWS help with your LangChain requirements?