LangChain
ActiveDescription
LangChain is the open-source agent engineering platform that unifies model IO, tool calling, RAG, memory and observability under one composable framework.
Key Features
- Unified model abstraction — ChatModel interface covers OpenAI, Anthropic, Bedrock, Vertex and 100+ providers
- Tool calling & agents — tool calling, ReAct, OpenAI Tools, Plan-and-Execute agent paradigms
- RAG as a first-class citizen — Document Loader, Text Splitter, Retriever and Index abstractions
- LangSmith observability — deep integration with LangSmith for tracing, evaluation and monitoring
- LangServe deployment — turn Chains and Agents into REST APIs with one command
- Dual-language SDKs — Python and TypeScript SDKs evolve together
Use Cases
Categories
Quick Start
# Install dependencies
pip install langchain langchain-openai langchain-community
# Build a minimal LCEL chain
from langchain_openai import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.output_parsers import StrOutputParser
prompt = ChatPromptTemplate.from_messages([
('system', 'You are a helpful assistant.'),
('user', '{input}')
])
model = ChatOpenAI(model='gpt-4o-mini')
chain = prompt | model | StrOutputParser()
print(chain.invoke({'input': 'Describe LangChain in one sentence.'}))