LangChain is the most-used open-source framework for building LLM applications. It provides abstractions for prompts, chains (sequences of operations), agents (LLMs that can use tools), memory, retrievers, output parsers, and callbacks. The companion library LangGraph handles stateful multi-agent workflows, while LangSmith provides observability and evals.
LangChain wraps LLM calls and tool usage in composable Python/JS primitives. A typical RAG pipeline looks like: load documents, split into chunks, embed and store in a vector DB, retrieve for a query, format into a prompt, call the LLM, parse output. Each step is a LangChain primitive you can swap. For agents, you define tools (Python functions with descriptions) and let the LLM decide which to call. LangGraph extends this with explicit state machines for more complex flows like multi-agent collaboration.
Open source: free. LangSmith observability: free tier (5,000 traces/month), Plus $39/month, Enterprise custom. LangGraph is part of the open source package.
Morgan Stanley, C3.ai, MongoDB, Klarna, and tens of thousands of developers. It's the most-imported LLM framework on PyPI and npm.