LangChain is an open-source framework, a code library, for building AI agents and applications powered by large language models (LLMs). It is made by the company LangChain, which also sells LangSmith, a platform for observing, evaluating and deploying agents. The main library is for Python, and LangChain.js is the equivalent library for JavaScript and TypeScript.
It gives one standard interface for models, embeddings, vector stores (databases that find text by meaning) and other components, with more than 1,000 integrations, so an application can swap one model provider or database for another without a rewrite. A developer chains these components together; for example, an application retrieves matching documents from a vector store and passes them to the model with the question. The create_agent function builds a ReAct agent, which alternates between reasoning and calling tools. It runs on LangGraph, a related framework that adds persistence, checkpointing and human-in-the-loop approval.
LangChain is free and open source under the MIT license. LangSmith, the company's hosted platform, has its own pricing.