# LangChain: features, protocols, quickstart

## TL;DR

LangChain is LangChain Inc.'s MIT-licensed Python framework for LLM applications and agents. Version 1 centers on `create_agent`, a tool-calling agent built on LangGraph and extended with middleware, plus provider integrations for models, tools and vector stores. It suits developers who want a standard agent loop with many ready integrations.

## Key facts

| Field | Value |
| --- | --- |
| Type | Framework |
| Languages / SDKs | Python |
| License | MIT |
| Pricing model | [Open core](https://www.langchain.com/pricing) |
| Orchestration pattern | Supervisor |
| GitHub stars | 147,295 (as of 2026-09-30) |
| GitHub forks | 24,662 |
| Last push | 2026-09-30 |
| Latest release | langchain-core==1.6.6 |
| Repository | [langchain-ai/langchain](https://github.com/langchain-ai/langchain) |
| Website | [www.langchain.com](https://www.langchain.com) |
| Documentation | [docs.langchain.com](https://docs.langchain.com/oss/python/langchain/overview) |
| Last verified | 2026-09-30 |

## Key features

- `create_agent`: a configurable tool-calling agent assembled from a model, tools, a system prompt and middleware. ([source](https://docs.langchain.com/oss/python/langchain/agents))
- Prebuilt middleware such as human-in-the-loop, summarization, PII handling, call limits, model fallback and to-do lists. ([source](https://docs.langchain.com/oss/python/langchain/middleware/built-in))
- Documented multi-agent patterns: subagents as tools, handoffs, on-demand skills, routers and custom LangGraph workflows. ([source](https://docs.langchain.com/oss/python/langchain/multi-agent/index))
- Short-term memory through LangGraph checkpointers keyed by thread ID. ([source](https://docs.langchain.com/oss/python/langchain/short-term-memory))
- Long-term memory through LangGraph stores that persist across threads. ([source](https://docs.langchain.com/oss/python/langchain/long-term-memory))
- Built-in MCP client (`langchain.mcp.MCPAdapter`, built on FastMCP) for loading MCP server tools. ([source](https://docs.langchain.com/oss/python/langchain/mcp/index))
- Provider integrations shipped as separate packages, for example `langchain-openai` and `langchain-anthropic`. ([source](https://docs.langchain.com/oss/python/langchain/install))

## Architecture and orchestration pattern

Pattern: Supervisor.

In v1 the `langchain` package was trimmed to agent building blocks, with older chains, retrievers and the indexing API moved to `langchain-classic`. The central API is `create_agent`, which returns a LangGraph graph that loops between the model and tools. Middleware hooks into that loop to change prompts, filter tools, summarize history, enforce limits or pause for approval.

Multi-agent systems are built from these agents. The docs list five patterns: subagents (a main agent calls other agents wrapped as tools and keeps control), handoffs (tool calls change state that switches the active agent or its configuration), skills loaded on demand, routers that classify and dispatch, and custom workflows written directly in LangGraph. For a batteries-included option the docs point to Deep Agents, which is built on LangChain.

State comes from LangGraph: a checkpointer gives thread-level short-term memory and makes interrupts possible, and a store provides long-term memory across threads.

### Human in the loop

`HumanInTheLoopMiddleware` checks each proposed tool call against an `interrupt_on` policy. When a call needs review, the middleware raises a LangGraph interrupt and the agent state is saved by the checkpointer. A person then answers each pending action with `approve`, `edit` (change the arguments), `reject` (skip with feedback) or `respond` (reply in place of an ask-the-user tool), and the run resumes with those decisions in order. A checkpointer and thread ID are required. The docs also cover rendering these approvals in a frontend.

## Protocols

| Protocol | Support | Evidence | Note |
| --- | --- | --- | --- |
| MCP | Yes (checked 2026-09-30) | [link](https://docs.langchain.com/oss/python/langchain/mcp/index) | Client: `MCPAdapter` in the `langchain.mcp` namespace (`langchain[mcp]>=1.4.0`, marked beta) loads MCP server tools; it replaces the standalone `langchain-mcp-adapters` package. |
| A2A | Yes (checked 2026-09-30) | [link](https://docs.langchain.com/langsmith/server-a2a) | Server side via Agent Server: a deployed LangChain or LangGraph agent is reachable at `/a2a/{assistant_id}`; the docs' examples include a LangChain agent talking to a Google ADK agent. |
| AG-UI | Partial (checked 2026-09-30) | [link](https://docs.langchain.com/oss/python/langchain/frontend/integrations/copilotkit) | LangChain docs show `CopilotKitMiddleware` plus the external `ag-ui-langgraph` bridge exposing a `create_agent` graph over AG-UI; AG-UI is not built into LangChain itself. |

## Best for

- Tool-calling agents that need many ready-made model, tool and vector store integrations
- Research and retrieval assistants that combine search tools with subagents
- Agents whose sensitive tool calls must be approved, edited or rejected by a person
- Support assistants that switch between specialist configurations with handoffs

## Not for

- Code that still depends on legacy chains or retrievers without adding `langchain-classic`
- Workflows needing fine-grained control of every step, where the docs point to LangGraph instead
- TypeScript projects, which use the separate LangChain.js library

## Quickstart

```sh
pip install -U langchain
```

Install not yet verified by this site.

```python
from langchain.agents import create_agent
from langchain.tools import tool

researcher = create_agent(model="openai:gpt-5.5",
                          system_prompt="Answer with three short factual bullet points.")

@tool
def research(question: str) -> str:
    """Ask the research subagent a factual question."""
    result = researcher.invoke({"messages": [{"role": "user", "content": question}]})
    return result["messages"][-1].content

writer = create_agent(model="openai:gpt-5.5", tools=[research],
                      system_prompt="Call research() for facts, then write one paragraph.")

# needs OPENAI_API_KEY and `pip install "langchain[openai]"`
out = writer.invoke({"messages": [{"role": "user", "content": "Explain the A2A protocol."}]})
print(out["messages"][-1].content)
```

### Common pitfalls

- Requires Python 3.10+; v1 dropped Python 3.9.
- Model providers are separate packages or extras (`langchain-openai`, `langchain[openai]`) and need their API key, for example `OPENAI_API_KEY`.
- Legacy chains, retrievers, the indexing API and `langchain-community` exports moved to `langchain-classic` in v1.
- `langgraph.prebuilt.create_react_agent` is superseded by `create_agent`; follow the v1 migration guide.
- The built-in `langchain.mcp` namespace is beta and emits a `LangChainBetaWarning`; code on `langchain-mcp-adapters` has a migration guide.
- Human-in-the-loop middleware needs a checkpointer and a thread ID to pause and resume.

Official quickstart: https://docs.langchain.com/oss/python/langchain/install

## Pros

- A single `create_agent` entry point, customised through middleware rather than subclassing. ([source](https://docs.langchain.com/oss/python/langchain/overview))
- Human review supports approve, edit, reject and respond decisions per tool call. ([source](https://docs.langchain.com/oss/python/langchain/human-in-the-loop))
- The docs compare five multi-agent patterns and say when a single agent is enough. ([source](https://docs.langchain.com/oss/python/langchain/multi-agent/index))
- Many prebuilt middleware components cover summarization, PII, limits and fallbacks. ([source](https://docs.langchain.com/oss/python/langchain/middleware/built-in))
- Agents run on LangGraph, so a checkpointer gives thread-level memory and resumable interrupts. ([source](https://docs.langchain.com/oss/python/langchain/short-term-memory))

## Cons

- v1 moved legacy chains, retrievers and the indexing API into `langchain-classic`, so older code needs an extra package or a rewrite. ([source](https://docs.langchain.com/oss/python/releases/langchain-v1))
- v1 dropped Python 3.9 and changed several APIs, documented in a long migration guide. ([source](https://docs.langchain.com/oss/python/migrate/langchain-v1))
- The new built-in MCP namespace is beta and may change. ([source](https://docs.langchain.com/oss/python/langchain/mcp/index))
- AG-UI support relies on CopilotKit's middleware and a separate bridge package. ([source](https://docs.langchain.com/oss/python/langchain/frontend/integrations/copilotkit))
- Managed deployment and team tracing are LangSmith features, with deployment access starting on a paid plan. ([source](https://www.langchain.com/pricing))

## Alternatives

- [LangGraph](https://multiagentguide.top/tools/langgraph.md)
- [Deep Agents](https://multiagentguide.top/tools/deepagents.md)
- [Pydantic AI](https://multiagentguide.top/tools/pydantic-ai.md)
- [OpenAI Agents SDK (Python)](https://multiagentguide.top/tools/openai-agents-sdk.md)
- [LlamaIndex](https://multiagentguide.top/tools/llamaindex.md)

## FAQ

### Does LangChain support MCP?

Yes. `MCPAdapter` in `langchain.mcp` (beta, `langchain[mcp]>=1.4.0`) loads tools from MCP servers into agents; it replaces the older `langchain-mcp-adapters` package.

### How is LangChain different from LangGraph?

LangChain's `create_agent` is a ready-made agent loop built on LangGraph, customised with middleware. LangGraph is the lower-level runtime for writing your own graphs.

### Is LangChain free?

The library is MIT-licensed. LangChain Inc. sells LangSmith for tracing, evaluation and deployment, with a free developer tier and paid plans.

### Is there a JavaScript version?

Yes. LangChain.js is a separate repository (langchain-ai/langchainjs); this record covers the Python package.

### Where did chains and retrievers go in v1?

Into `langchain-classic`, which holds legacy chains, retrievers, the indexing API, the hub module and `langchain-community` exports.

## Sources

- [LangChain GitHub repository](https://github.com/langchain-ai/langchain)
- [LangChain README](https://github.com/langchain-ai/langchain/blob/master/README.md)
- [LangChain homepage](https://www.langchain.com)
- [LangChain overview (docs)](https://docs.langchain.com/oss/python/langchain/overview)
- [Install LangChain (docs)](https://docs.langchain.com/oss/python/langchain/install)
- [Agents: create_agent (docs)](https://docs.langchain.com/oss/python/langchain/agents)
- [Prebuilt middleware (docs)](https://docs.langchain.com/oss/python/langchain/middleware/built-in)
- [Human-in-the-loop middleware (docs)](https://docs.langchain.com/oss/python/langchain/human-in-the-loop)
- [Multi-agent patterns (docs)](https://docs.langchain.com/oss/python/langchain/multi-agent/index)
- [Subagents pattern (docs)](https://docs.langchain.com/oss/python/langchain/multi-agent/subagents)
- [Short-term memory (docs)](https://docs.langchain.com/oss/python/langchain/short-term-memory)
- [Long-term memory (docs)](https://docs.langchain.com/oss/python/langchain/long-term-memory)
- [Model Context Protocol in LangChain (docs)](https://docs.langchain.com/oss/python/langchain/mcp/index)
- [Migrate from langchain-mcp-adapters (docs)](https://docs.langchain.com/oss/python/migrate/langchain-mcp-adapters)
- [What's new in LangChain v1](https://docs.langchain.com/oss/python/releases/langchain-v1)
- [LangChain v1 migration guide](https://docs.langchain.com/oss/python/migrate/langchain-v1)
- [A2A endpoint in Agent Server](https://docs.langchain.com/langsmith/server-a2a)
- [CopilotKit integration (LangChain docs, AG-UI bridge)](https://docs.langchain.com/oss/python/langchain/frontend/integrations/copilotkit)
- [LangChain / LangSmith pricing](https://www.langchain.com/pricing)
- [LangChain.js repository](https://github.com/langchain-ai/langchainjs)
- [AG-UI README, supported integrations](https://github.com/ag-ui-protocol/ag-ui/blob/main/README.md)

---

Data as of 2026-09-30. Not affiliated with listed projects. HTML version: https://multiagentguide.top/tools/langchain
