LangChain (framework)
LangChain is the open-source agent framework from LangChain Inc, available in Python and TypeScript. Its documentation centres on create_agent, a minimal and highly configurable agent harness: the prompt, the tools and any middleware that shapes behaviour around the model loop.
- Basic use: import
create_agentfromlangchain.agents, pass a model string, a list of tools and a system prompt, then callagent.invokewith a messages list. - Middleware: capabilities such as guardrails, retries, routing and custom tool policies are added as middleware.
- Built on LangGraph:
create_agentreturns a compiled LangGraph graph, so agents inherit durable execution, human-in-the-loop support and persistence, and can be embedded in a larger graph. - Three layers: the docs position LangChain as the quick-start harness, Deep Agents as the batteries-included option, and LangGraph as the low-level tool for mixing deterministic and agentic workflows. The layers nest rather than compete.
- Versions: LangChain 1.0 and LangGraph 1.0 reached GA together on 2025-10-22 (see LangGraph). Legacy features moved to
langchain-classic, and olderpython.langchain.comlinks point to the new docs site. - Ecosystem: LangSmith for tracing, evals and deployment.
- Protocols: AG-UI grew out of a LangChain and CopilotKit partnership (ag-ui). LangChain is one of the frameworks CopilotKit’s OpenDuet can drive.
- Compare crewai, mastra, microsoft-agent-framework, google-adk.