# Table of Contents - [LangChain overview - Docs by LangChain](#langchain-overview-docs-by-langchain) - [Check Oauth Token Exists - Docs by LangChain](#check-oauth-token-exists-docs-by-langchain) - [Co-marketing - Docs by LangChain](#co-marketing-docs-by-langchain) - [](#-cdata-changelog-) - [Releases - Docs by LangChain](#releases-docs-by-langchain) - [Evaluate agent performance - Docs by LangChain](#evaluate-agent-performance-docs-by-langchain) - [Multi-agent - Docs by LangChain](#multi-agent-docs-by-langchain) --- # LangChain overview - Docs by LangChain [Skip to main content](https://docs.langchain.com/oss/python/langchain/overview#content-area) [Docs by LangChain home page![light logo](https://mintcdn.com/langchain-5e9cc07a/Xbr8HuVd9jPi6qTU/images/brand/langchain-docs-teal.svg?fit=max&auto=format&n=Xbr8HuVd9jPi6qTU&q=85&s=16111530672bf976cb54ef2143478342)![dark logo](https://mintcdn.com/langchain-5e9cc07a/Xbr8HuVd9jPi6qTU/images/brand/langchain-docs-lilac.svg?fit=max&auto=format&n=Xbr8HuVd9jPi6qTU&q=85&s=b70fb1a2208670492ef94aef14b680be)](https://docs.langchain.com/) LangChain + LangGraph Search... Ctrl K Search... Navigation LangChain overview [LangChain](https://docs.langchain.com/oss/python/langchain/overview) [LangGraph](https://docs.langchain.com/oss/python/langgraph/overview) [Deep Agents](https://docs.langchain.com/oss/python/deepagents/overview) [Integrations](https://docs.langchain.com/oss/python/integrations/providers/overview) [Learn](https://docs.langchain.com/oss/python/learn) [Reference](https://docs.langchain.com/oss/python/reference/overview) [Contribute](https://docs.langchain.com/oss/python/contributing/overview) Python * [Overview](https://docs.langchain.com/oss/python/langchain/overview) ##### Get started * [Install](https://docs.langchain.com/oss/python/langchain/install) * [Quickstart](https://docs.langchain.com/oss/python/langchain/quickstart) * [Changelog](https://docs.langchain.com/oss/python/releases/changelog) * [Philosophy](https://docs.langchain.com/oss/python/langchain/philosophy) ##### Core components * [Agents](https://docs.langchain.com/oss/python/langchain/agents) * [Models](https://docs.langchain.com/oss/python/langchain/models) * [Messages](https://docs.langchain.com/oss/python/langchain/messages) * [Tools](https://docs.langchain.com/oss/python/langchain/tools) * [Short-term memory](https://docs.langchain.com/oss/python/langchain/short-term-memory) * [Streaming](https://docs.langchain.com/oss/python/langchain/streaming) * [Structured output](https://docs.langchain.com/oss/python/langchain/structured-output) ##### Middleware * [Overview](https://docs.langchain.com/oss/python/langchain/middleware/overview) * [Built-in middleware](https://docs.langchain.com/oss/python/langchain/middleware/built-in) * [Custom middleware](https://docs.langchain.com/oss/python/langchain/middleware/custom) ##### Advanced usage * [Guardrails](https://docs.langchain.com/oss/python/langchain/guardrails) * [Runtime](https://docs.langchain.com/oss/python/langchain/runtime) * [Context engineering](https://docs.langchain.com/oss/python/langchain/context-engineering) * [Model Context Protocol (MCP)](https://docs.langchain.com/oss/python/langchain/mcp) * [Human-in-the-loop](https://docs.langchain.com/oss/python/langchain/human-in-the-loop) * Multi-agent * [Retrieval](https://docs.langchain.com/oss/python/langchain/retrieval) * [Long-term memory](https://docs.langchain.com/oss/python/langchain/long-term-memory) ##### Agent development * [LangSmith Studio](https://docs.langchain.com/oss/python/langchain/studio) * [Test](https://docs.langchain.com/oss/python/langchain/test) * [Agent Chat UI](https://docs.langchain.com/oss/python/langchain/ui) ##### Deploy with LangSmith * [Deployment](https://docs.langchain.com/oss/python/langchain/deploy) * [Observability](https://docs.langchain.com/oss/python/langchain/observability) On this page * [Create an agent](https://docs.langchain.com/oss/python/langchain/overview#create-an-agent) * [Core benefits](https://docs.langchain.com/oss/python/langchain/overview#core-benefits) LangChain is the easiest way to start building agents and applications powered by LLMs. With under 10 lines of code, you can connect to OpenAI, Anthropic, Google, and [more](https://docs.langchain.com/oss/python/integrations/providers/overview) . LangChain provides a pre-built agent architecture and model integrations to help you get started quickly and seamlessly incorporate LLMs into your agents and applications. We recommend you use LangChain if you want to quickly build agents and autonomous applications. Use [LangGraph](https://docs.langchain.com/oss/python/langgraph/overview) , our low-level agent orchestration framework and runtime, when you have more advanced needs that require a combination of deterministic and agentic workflows, heavy customization, and carefully controlled latency. LangChain [agents](https://docs.langchain.com/oss/python/langchain/agents) are built on top of LangGraph in order to provide durable execution, streaming, human-in-the-loop, persistence, and more. You do not need to know LangGraph for basic LangChain agent usage. [​](https://docs.langchain.com/oss/python/langchain/overview#create-an-agent) Create an agent ------------------------------------------------------------------------------------------------ Copy # pip install -qU langchain "langchain[anthropic]" from langchain.agents import create_agent def get_weather(city: str) -> str: """Get weather for a given city.""" return f"It's always sunny in {city}!" agent = create_agent( model="claude-sonnet-4-5-20250929", tools=[get_weather], system_prompt="You are a helpful assistant", ) # Run the agent agent.invoke( {"messages": [{"role": "user", "content": "what is the weather in sf"}]} ) See the [Installation instructions](https://docs.langchain.com/oss/python/langchain/install) and [Quickstart guide](https://docs.langchain.com/oss/python/langchain/quickstart) to get started building your own agents and applications with LangChain. [​](https://docs.langchain.com/oss/python/langchain/overview#core-benefits) Core benefits -------------------------------------------------------------------------------------------- [Standard model interface\ ------------------------\ \ Different providers have unique APIs for interacting with models, including the format of responses. LangChain standardizes how you interact with models so that you can seamlessly swap providers and avoid lock-in.\ \ Learn more](https://docs.langchain.com/oss/python/langchain/models) [Easy to use, highly flexible agent\ ----------------------------------\ \ LangChain’s agent abstraction is designed to be easy to get started with, letting you build a simple agent in under 10 lines of code. But it also provides enough flexibility to allow you to do all the context engineering your heart desires.\ \ Learn more](https://docs.langchain.com/oss/python/langchain/agents) [Built on top of LangGraph\ -------------------------\ \ LangChain’s agents are built on top of LangGraph. This allows us to take advantage of LangGraph’s durable execution, human-in-the-loop support, persistence, and more.\ \ Learn more](https://docs.langchain.com/oss/python/langgraph/overview) [Debug with LangSmith\ --------------------\ \ Gain deep visibility into complex agent behavior with visualization tools that trace execution paths, capture state transitions, and provide detailed runtime metrics.\ \ Learn more](https://docs.langchain.com/langsmith/home) * * * [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/langchain/overview.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose) . [Connect these docs](https://docs.langchain.com/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers. Was this page helpful? YesNo [Install LangChain\ \ Next](https://docs.langchain.com/oss/python/langchain/install) Ctrl+I Assistant Responses are generated using AI and may contain mistakes. --- # Check Oauth Token Exists - Docs by LangChain [Skip to main content](https://docs.langchain.com/api-reference/auth-service-v2/check-oauth-token-exists#content-area) [Docs by LangChain home page![light logo](https://mintcdn.com/langchain-5e9cc07a/Xbr8HuVd9jPi6qTU/images/brand/langchain-docs-teal.svg?fit=max&auto=format&n=Xbr8HuVd9jPi6qTU&q=85&s=16111530672bf976cb54ef2143478342)![dark logo](https://mintcdn.com/langchain-5e9cc07a/Xbr8HuVd9jPi6qTU/images/brand/langchain-docs-lilac.svg?fit=max&auto=format&n=Xbr8HuVd9jPi6qTU&q=85&s=b70fb1a2208670492ef94aef14b680be)](https://docs.langchain.com/) LangSmith Search... ⌘K Search... Navigation Auth Service (v2) Check Oauth Token Exists [Get started](https://docs.langchain.com/langsmith/home) [Observability](https://docs.langchain.com/langsmith/observability) [Evaluation](https://docs.langchain.com/langsmith/evaluation) [Prompt engineering](https://docs.langchain.com/langsmith/prompt-engineering) [Deployment](https://docs.langchain.com/langsmith/deployments) [Agent Builder](https://docs.langchain.com/langsmith/agent-builder) [Platform setup](https://docs.langchain.com/langsmith/platform-setup) [Reference](https://docs.langchain.com/langsmith/reference) * [Overview](https://docs.langchain.com/langsmith/reference) * [LangSmith Python SDK](https://reference.langchain.com/python/langsmith/observability/sdk/) * [LangSmith JS/TS SDK](https://reference.langchain.com/javascript/modules/langsmith.html) * [LangGraph Python SDK](https://reference.langchain.com/python/langgraph/) * [LangGraph JS/TS SDK](https://reference.langchain.com/javascript/modules/_langchain_langgraph-sdk.html) * [LangSmith API](https://api.smith.langchain.com/redoc) ##### LangSmith Deployment * Agent Server API * Control Plane API * [Overview](https://docs.langchain.com/langsmith/api-ref-control-plane) * Integrations (v1) * Deployments (v2) * Listeners (v2) * Auth Service (v2) * [GET\ \ List Oauth Providers](https://docs.langchain.com/api-reference/auth-service-v2/list-oauth-providers) * [POST\ \ Create Oauth Provider](https://docs.langchain.com/api-reference/auth-service-v2/create-oauth-provider) * [POST\ \ Oauth Callback](https://docs.langchain.com/api-reference/auth-service-v2/oauth-callback) * [POST\ \ Authenticate](https://docs.langchain.com/api-reference/auth-service-v2/authenticate) * [GET\ \ Wait For Auth Completion](https://docs.langchain.com/api-reference/auth-service-v2/wait-for-auth-completion) * [GET\ \ Get Oauth Provider](https://docs.langchain.com/api-reference/auth-service-v2/get-oauth-provider) * [DEL\ \ Delete Oauth Provider](https://docs.langchain.com/api-reference/auth-service-v2/delete-oauth-provider) * [PATCH\ \ Update Oauth Provider](https://docs.langchain.com/api-reference/auth-service-v2/update-oauth-provider) * [GET\ \ Check Oauth Token Exists](https://docs.langchain.com/api-reference/auth-service-v2/check-oauth-token-exists) * [DEL\ \ Delete Oauth Tokens For User](https://docs.langchain.com/api-reference/auth-service-v2/delete-oauth-tokens-for-user) * [LangGraph CLI](https://docs.langchain.com/langsmith/cli) * [RemoteGraph](https://reference.langchain.com/python/langsmith/deployment/remote_graph/) * [Agent Server environment variables](https://docs.langchain.com/langsmith/env-var) ##### Releases * [Agent Server changelog](https://docs.langchain.com/langsmith/agent-server-changelog) * [Self-hosted changelog](https://docs.langchain.com/langsmith/self-hosted-changelog) * [Release versions](https://docs.langchain.com/langsmith/release-versions) Check Oauth Token Exists cURL Copy curl --request GET \ --url https://api.example.com/v2/auth/tokens/exists 200 422 Copy { "has_token": true } GET / v2 / auth / tokens / exists Try it Check Oauth Token Exists cURL Copy curl --request GET \ --url https://api.example.com/v2/auth/tokens/exists 200 422 Copy { "has_token": true } #### Query Parameters [​](https://docs.langchain.com/api-reference/auth-service-v2/check-oauth-token-exists#parameter-provider-id) provider\_id string required OAuth provider ID #### Response 200 application/json Successful Response Simple status indicating if a user has a token for a provider/agent. [​](https://docs.langchain.com/api-reference/auth-service-v2/check-oauth-token-exists#response-has-token) has\_token boolean required Was this page helpful? YesNo [Update Oauth Provider\ \ Previous](https://docs.langchain.com/api-reference/auth-service-v2/update-oauth-provider) [Delete Oauth Tokens For User\ \ Next](https://docs.langchain.com/api-reference/auth-service-v2/delete-oauth-tokens-for-user) ⌘I --- # Co-marketing - Docs by LangChain [Skip to main content](https://docs.langchain.com/oss/python/contributing/comarketing#content-area) [Docs by LangChain home page![light logo](https://mintcdn.com/langchain-5e9cc07a/Xbr8HuVd9jPi6qTU/images/brand/langchain-docs-teal.svg?fit=max&auto=format&n=Xbr8HuVd9jPi6qTU&q=85&s=16111530672bf976cb54ef2143478342)![dark logo](https://mintcdn.com/langchain-5e9cc07a/Xbr8HuVd9jPi6qTU/images/brand/langchain-docs-lilac.svg?fit=max&auto=format&n=Xbr8HuVd9jPi6qTU&q=85&s=b70fb1a2208670492ef94aef14b680be)](https://docs.langchain.com/) LangChain + LangGraph Search... ⌘K Search... Navigation Integrations Co-marketing [LangChain](https://docs.langchain.com/oss/python/langchain/overview) [LangGraph](https://docs.langchain.com/oss/python/langgraph/overview) [Deep Agents](https://docs.langchain.com/oss/python/deepagents/overview) [Integrations](https://docs.langchain.com/oss/python/integrations/providers/overview) [Learn](https://docs.langchain.com/oss/python/learn) [Reference](https://docs.langchain.com/oss/python/reference/overview) [Contribute](https://docs.langchain.com/oss/python/contributing/overview) Python * [Overview](https://docs.langchain.com/oss/python/contributing/overview) ##### Contribute * [Documentation](https://docs.langchain.com/oss/python/contributing/documentation) * [Code](https://docs.langchain.com/oss/python/contributing/code) * Integrations * [Guide](https://docs.langchain.com/oss/python/contributing/integrations-langchain) * [Implement](https://docs.langchain.com/oss/python/contributing/implement-langchain) * [Standard tests](https://docs.langchain.com/oss/python/contributing/standard-tests-langchain) * [Publish](https://docs.langchain.com/oss/python/contributing/publish-langchain) * [Co-marketing](https://docs.langchain.com/oss/python/contributing/comarketing) On this page * [Content we’re excited to promote](https://docs.langchain.com/oss/python/contributing/comarketing#content-we%E2%80%99re-excited-to-promote) With over 60 million monthly downloads, LangChain has a large audience of developers building LLM applications. Beyond just listing integrations, we aim to highlight high-quality, educational examples that inspire developers and advance the ecosystem. While we occasionally share integrations, we prioritize content that provides meaningful insights and best practices. Our main social channels are [Twitter](https://x.com/LangChainAI) and [LinkedIn](https://www.linkedin.com/company/langchain/) , where we highlight the best examples. ### [​](https://docs.langchain.com/oss/python/contributing/comarketing#content-we%E2%80%99re-excited-to-promote) Content we’re excited to promote Educational content Blogs, YouTube videos and other media showcasing educational content. Note that we prefer content that is NOT framed as “here’s how to use integration XYZ”, but rather “here’s how to do ABC”, as we find that is more educational and helpful for developers. End-to-end applications End-to-end applications are great resources for developers looking to build. We prefer to highlight applications that are more complex/agentic in nature, and that use [LangGraph](https://github.com/langchain-ai/langgraph) as the orchestration framework. We get particularly excited about anything involving: * Long-term memory systems * Human-in-the-loop interaction patterns * Multi-agent architectures Research We love highlighting novel research! Whether it is research built on top of LangChain or that integrates with it. * * * [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/contributing/comarketing.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose) . [Connect these docs](https://docs.langchain.com/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers. Was this page helpful? YesNo [Publish an integration\ \ Previous](https://docs.langchain.com/oss/python/contributing/publish-langchain) ⌘I --- # https://docs.langchain.com Mintlify Wed, 07 Jan 2026 04:26:35 GMT https://docs.langchain.com https://docs.langchain.com/oss/python/releases/changelog#dec-15-2025 https://docs.langchain.com/oss/python/releases/changelog#dec-15-2025 Mon, 15 Dec 2025 16:33:34 GMT `langchain` v1.2.0 * [`create_agent`](https://docs.langchain.com/oss/python/langchain/agents) : Simplified support for provider-specific tool parameters and definitions via a new [`extras`](https://reference.langchain.com/python/langchain/tools/#langchain.tools.BaseTool.extras) attribute on [tools](https://docs.langchain.com/oss/python/langchain/tools) . Examples: * Provider-specific configuration such as Anthropic's [programmatic tool calling](https://docs.langchain.com/oss/python/integrations/chat/anthropic#programmatic-tool-calling) and [tool search](https://docs.langchain.com/oss/python/integrations/chat/anthropic#tool-search) . * Built-in tools that are executed client-side, as supported by [Anthropic](https://docs.langchain.com/oss/python/integrations/chat/anthropic#built-in-tools) , [OpenAI](https://docs.langchain.com/oss/python/integrations/chat/openai#responses-api) , and other providers. * Support for strict schema-adherence in agent `response_format` (see [`ProviderStrategy`](https://docs.langchain.com/oss/python/langchain/structured-output#provider-strategy) docs). \]\]> https://docs.langchain.com/oss/python/releases/changelog#dec-8-2025 https://docs.langchain.com/oss/python/releases/changelog#dec-8-2025 Mon, 08 Dec 2025 19:35:47 GMT `langchain-google-genai` v4.0.0 We've re-written the Google GenAI integration to use Google's consolidated Generative AI SDK, which provides access to the Gemini API and Vertex AI Platform under the same interface. This includes minimal breaking changes as well as deprecated packages in `langchain-google-vertexai`. See the full [release notes and migration guide](https://github.com/langchain-ai/langchain-google/discussions/1422) for details. \]\]> https://docs.langchain.com/oss/python/releases/changelog#nov-25-2025 https://docs.langchain.com/oss/python/releases/changelog#nov-25-2025 Mon, 24 Nov 2025 15:43:09 GMT `langchain` v1.1.0 * [Model profiles](https://docs.langchain.com/oss/python/langchain/models#model-profiles) : Chat models now expose supported features and capabilities through a `.profile` attribute. These data are derived from [models.dev](https://models.dev/) , an open source project providing model capability data. * [Summarization middleware](https://docs.langchain.com/oss/python/langchain/middleware/built-in#summarization) : Updated to support flexible trigger points using model profiles for context-aware summarization. * [Structured output](https://docs.langchain.com/oss/python/langchain/structured-output) : `ProviderStrategy` support (native structured output) can now be inferred from model profiles. * [`SystemMessage` for `create_agent`](https://docs.langchain.com/oss/python/langchain/middleware/custom#working-with-system-messages) : Support for passing `SystemMessage` instances directly to `create_agent`'s `system_prompt` parameter, enabling advanced features like cache control and structured content blocks. * [Model retry middleware](https://docs.langchain.com/oss/python/langchain/middleware/built-in#model-retry) : New middleware for automatically retrying failed model calls with configurable exponential backoff. * [Content moderation middleware](https://docs.langchain.com/oss/python/langchain/middleware/built-in#content-moderation) : OpenAI content moderation middleware for detecting and handling unsafe content in agent interactions. Supports checking user input, model output, and tool results. \]\]> https://docs.langchain.com/oss/python/releases/changelog#oct-20-2025 https://docs.langchain.com/oss/python/releases/changelog#oct-20-2025 Mon, 01 Dec 2025 21:38:10 GMT v1.0.0 ### `langchain` * [Release notes](https://docs.langchain.com/oss/python/releases/langchain-v1) * [Migration guide](https://docs.langchain.com/oss/python/migrate/langchain-v1) ### `langgraph` * [Release notes](https://docs.langchain.com/oss/python/releases/langgraph-v1) * [Migration guide](https://docs.langchain.com/oss/python/migrate/langgraph-v1) \]\]> --- # Releases - Docs by LangChain [Skip to main content](https://docs.langchain.com/oss/python/releases#content-area) [Docs by LangChain home page![light logo](https://mintcdn.com/langchain-5e9cc07a/Xbr8HuVd9jPi6qTU/images/brand/langchain-docs-teal.svg?fit=max&auto=format&n=Xbr8HuVd9jPi6qTU&q=85&s=16111530672bf976cb54ef2143478342)![dark logo](https://mintcdn.com/langchain-5e9cc07a/Xbr8HuVd9jPi6qTU/images/brand/langchain-docs-lilac.svg?fit=max&auto=format&n=Xbr8HuVd9jPi6qTU&q=85&s=b70fb1a2208670492ef94aef14b680be)](https://docs.langchain.com/) LangChain + LangGraph Search... ⌘K Search... Navigation Releases [LangChain](https://docs.langchain.com/oss/python/langchain/overview) [LangGraph](https://docs.langchain.com/oss/python/langgraph/overview) [Deep Agents](https://docs.langchain.com/oss/python/deepagents/overview) [Integrations](https://docs.langchain.com/oss/python/integrations/providers/overview) [Learn](https://docs.langchain.com/oss/python/learn) [Reference](https://docs.langchain.com/oss/python/reference/overview) [Contribute](https://docs.langchain.com/oss/python/contributing/overview) Python * [Overview](https://docs.langchain.com/oss/python/reference/overview) ##### Reference * [LangChain SDK](https://reference.langchain.com/python/langchain/) * [LangGraph SDK](https://reference.langchain.com/python/langgraph/) * [Integrations](https://reference.langchain.com/python/integrations/) * [Deep Agents](https://reference.langchain.com/python/deepagents/) ##### Errors * [Reference](https://docs.langchain.com/oss/python/common-errors) ##### Releases * [Versioning](https://docs.langchain.com/oss/python/versioning) * [Changelog](https://docs.langchain.com/oss/python/releases/changelog) * Releases * Migration guides ##### Policies * [Release policy](https://docs.langchain.com/oss/python/release-policy) * [Security](https://docs.langchain.com/oss/python/security-policy) On this page * [Latest release](https://docs.langchain.com/oss/python/releases#latest-release) * [Pre-release versions](https://docs.langchain.com/oss/python/releases#pre-release-versions) * [Support timeline](https://docs.langchain.com/oss/python/releases#support-timeline) * [See also](https://docs.langchain.com/oss/python/releases#see-also) This section contains release notes and migration guides for LangChain and LangGraph v1.[Migration Guide: Upgrading to LangChain 1.0\ -------------------------------------------\ \ **Upgrading from 0.x?** Follow our comprehensive migration guide with step-by-step instructions, breaking changes, deprecated features, and recommended patterns for LangChain 1.0.](https://docs.langchain.com/oss/python/migrate/langchain-v1) [​](https://docs.langchain.com/oss/python/releases#latest-release) Latest release ------------------------------------------------------------------------------------ The current stable version is v1.x. See the [versioning policy](https://docs.langchain.com/oss/python/versioning) for information about our release cycle. See the sidebar for links to release pages that include detailed release notes and migration guides. [​](https://docs.langchain.com/oss/python/releases#pre-release-versions) Pre-release versions ------------------------------------------------------------------------------------------------ Information about alpha, beta, and release candidate versions can be found in on GitHub: * [LangChain releases](https://github.com/langchain-ai/langchain/releases) * [LangGraph releases](https://github.com/langchain-ai/langgraph/releases) [​](https://docs.langchain.com/oss/python/releases#support-timeline) Support timeline ---------------------------------------------------------------------------------------- | Version | Status | Support Until | | --- | --- | --- | | v0.x.x | Current | TBD | | v1.x.x | Current | Active development | [​](https://docs.langchain.com/oss/python/releases#see-also) See also ------------------------------------------------------------------------ * [Versioning](https://docs.langchain.com/oss/python/versioning) – Understanding version numbers * [Release policy](https://docs.langchain.com/oss/python/release-policy) – Detailed release policies * * * [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/releases.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose) . [Connect these docs](https://docs.langchain.com/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers. Was this page helpful? YesNo ⌘I --- # Evaluate agent performance - Docs by LangChain [Skip to main content](https://docs.langchain.com/oss/python/langchain/evals#content-area) [Docs by LangChain home page![light logo](https://mintcdn.com/langchain-5e9cc07a/Xbr8HuVd9jPi6qTU/images/brand/langchain-docs-teal.svg?fit=max&auto=format&n=Xbr8HuVd9jPi6qTU&q=85&s=16111530672bf976cb54ef2143478342)![dark logo](https://mintcdn.com/langchain-5e9cc07a/Xbr8HuVd9jPi6qTU/images/brand/langchain-docs-lilac.svg?fit=max&auto=format&n=Xbr8HuVd9jPi6qTU&q=85&s=b70fb1a2208670492ef94aef14b680be)](https://docs.langchain.com/) LangChain + LangGraph Search... ⌘K Search... Navigation Evaluate agent performance [LangChain](https://docs.langchain.com/oss/python/langchain/overview) [LangGraph](https://docs.langchain.com/oss/python/langgraph/overview) [Deep Agents](https://docs.langchain.com/oss/python/deepagents/overview) [Integrations](https://docs.langchain.com/oss/python/integrations/providers/overview) [Learn](https://docs.langchain.com/oss/python/learn) [Reference](https://docs.langchain.com/oss/python/reference/overview) [Contribute](https://docs.langchain.com/oss/python/contributing/overview) Python * [Overview](https://docs.langchain.com/oss/python/langchain/overview) ##### Get started * [Install](https://docs.langchain.com/oss/python/langchain/install) * [Quickstart](https://docs.langchain.com/oss/python/langchain/quickstart) * [Changelog](https://docs.langchain.com/oss/python/releases/changelog) * [Philosophy](https://docs.langchain.com/oss/python/langchain/philosophy) ##### Core components * [Agents](https://docs.langchain.com/oss/python/langchain/agents) * [Models](https://docs.langchain.com/oss/python/langchain/models) * [Messages](https://docs.langchain.com/oss/python/langchain/messages) * [Tools](https://docs.langchain.com/oss/python/langchain/tools) * [Short-term memory](https://docs.langchain.com/oss/python/langchain/short-term-memory) * [Streaming](https://docs.langchain.com/oss/python/langchain/streaming) * [Structured output](https://docs.langchain.com/oss/python/langchain/structured-output) ##### Middleware * [Overview](https://docs.langchain.com/oss/python/langchain/middleware/overview) * [Built-in middleware](https://docs.langchain.com/oss/python/langchain/middleware/built-in) * [Custom middleware](https://docs.langchain.com/oss/python/langchain/middleware/custom) ##### Advanced usage * [Guardrails](https://docs.langchain.com/oss/python/langchain/guardrails) * [Runtime](https://docs.langchain.com/oss/python/langchain/runtime) * [Context engineering](https://docs.langchain.com/oss/python/langchain/context-engineering) * [Model Context Protocol (MCP)](https://docs.langchain.com/oss/python/langchain/mcp) * [Human-in-the-loop](https://docs.langchain.com/oss/python/langchain/human-in-the-loop) * Multi-agent * [Retrieval](https://docs.langchain.com/oss/python/langchain/retrieval) * [Long-term memory](https://docs.langchain.com/oss/python/langchain/long-term-memory) ##### Agent development * [LangSmith Studio](https://docs.langchain.com/oss/python/langchain/studio) * [Test](https://docs.langchain.com/oss/python/langchain/test) * [Agent Chat UI](https://docs.langchain.com/oss/python/langchain/ui) ##### Deploy with LangSmith * [Deployment](https://docs.langchain.com/oss/python/langchain/deploy) * [Observability](https://docs.langchain.com/oss/python/langchain/observability) On this page * [Create evaluator](https://docs.langchain.com/oss/python/langchain/evals#create-evaluator) * [LLM-as-a-judge](https://docs.langchain.com/oss/python/langchain/evals#llm-as-a-judge) * [Run evaluator](https://docs.langchain.com/oss/python/langchain/evals#run-evaluator) To evaluate your agent’s performance you can use `LangSmith` [evaluations](https://docs.langchain.com/langsmith/evaluation) . You would need to first define an evaluator function to judge the results from an agent, such as final outputs or trajectory. Depending on your evaluation technique, this may or may not involve a reference output: Copy def evaluator(*, outputs: dict, reference_outputs: dict): # compare agent outputs against reference outputs output_messages = outputs["messages"] reference_messages = reference_outputs["messages"] score = compare_messages(output_messages, reference_messages) return {"key": "evaluator_score", "score": score} To get started, you can use prebuilt evaluators from `AgentEvals` package: pip uv Copy pip install -U agentevals [​](https://docs.langchain.com/oss/python/langchain/evals#create-evaluator) Create evaluator ----------------------------------------------------------------------------------------------- A common way to evaluate agent performance is by comparing its trajectory (the order in which it calls its tools) against a reference trajectory: Copy import json from agentevals.trajectory.match import create_trajectory_match_evaluator outputs = [\ {\ "role": "assistant",\ "tool_calls": [\ {\ "function": {\ "name": "get_weather",\ "arguments": json.dumps({"city": "san francisco"}),\ }\ },\ {\ "function": {\ "name": "get_directions",\ "arguments": json.dumps({"destination": "presidio"}),\ }\ }\ ],\ }\ ] reference_outputs = [\ {\ "role": "assistant",\ "tool_calls": [\ {\ "function": {\ "name": "get_weather",\ "arguments": json.dumps({"city": "san francisco"}),\ }\ },\ ],\ }\ ] # Create the evaluator evaluator = create_trajectory_match_evaluator( trajectory_match_mode="superset", ) # Run the evaluator result = evaluator( outputs=outputs, reference_outputs=reference_outputs ) 1. Specify how the trajectories will be compared. `superset` will accept output trajectory as valid if it’s a superset of the reference one. Other options include: [strict](https://github.com/langchain-ai/agentevals?tab=readme-ov-file#strict-match) , [unordered](https://github.com/langchain-ai/agentevals?tab=readme-ov-file#unordered-match) and [subset](https://github.com/langchain-ai/agentevals?tab=readme-ov-file#subset-and-superset-match) As a next step, learn more about how to [customize trajectory match evaluator](https://github.com/langchain-ai/agentevals?tab=readme-ov-file#agent-trajectory-match) . ### [​](https://docs.langchain.com/oss/python/langchain/evals#llm-as-a-judge) LLM-as-a-judge You can use LLM-as-a-judge evaluator that uses an LLM to compare the trajectory against the reference outputs and output a score: Copy import json from agentevals.trajectory.llm import ( create_trajectory_llm_as_judge, TRAJECTORY_ACCURACY_PROMPT_WITH_REFERENCE ) evaluator = create_trajectory_llm_as_judge( prompt=TRAJECTORY_ACCURACY_PROMPT_WITH_REFERENCE, model="openai:o3-mini" ) [​](https://docs.langchain.com/oss/python/langchain/evals#run-evaluator) Run evaluator ----------------------------------------------------------------------------------------- To run an evaluator, you will first need to create a [LangSmith dataset](https://docs.langchain.com/langsmith/evaluation#datasets) . To use the prebuilt AgentEvals evaluators, you will need a dataset with the following schema: * **input**: `{"messages": [...]}` input messages to call the agent with. * **output**: `{"messages": [...]}` expected message history in the agent output. For trajectory evaluation, you can choose to keep only assistant messages. Copy from langsmith import Client from langchain.agents import create_agent from agentevals.trajectory.match import create_trajectory_match_evaluator client = Client() agent = create_agent(...) evaluator = create_trajectory_match_evaluator(...) experiment_results = client.evaluate( lambda inputs: agent.invoke(inputs), # replace with your dataset name data="", evaluators=[evaluator] ) * * * [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/langchain/evals.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose) . [Connect these docs](https://docs.langchain.com/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers. Was this page helpful? YesNo ⌘I --- # Multi-agent - Docs by LangChain [Skip to main content](https://docs.langchain.com/oss/python/langchain/multi-agent/index#content-area) [Docs by LangChain home page![light logo](https://mintcdn.com/langchain-5e9cc07a/Xbr8HuVd9jPi6qTU/images/brand/langchain-docs-teal.svg?fit=max&auto=format&n=Xbr8HuVd9jPi6qTU&q=85&s=16111530672bf976cb54ef2143478342)![dark logo](https://mintcdn.com/langchain-5e9cc07a/Xbr8HuVd9jPi6qTU/images/brand/langchain-docs-lilac.svg?fit=max&auto=format&n=Xbr8HuVd9jPi6qTU&q=85&s=b70fb1a2208670492ef94aef14b680be)](https://docs.langchain.com/) LangChain + LangGraph Search... ⌘K Search... Navigation Multi-agent Multi-agent [LangChain](https://docs.langchain.com/oss/python/langchain/overview) [LangGraph](https://docs.langchain.com/oss/python/langgraph/overview) [Deep Agents](https://docs.langchain.com/oss/python/deepagents/overview) [Integrations](https://docs.langchain.com/oss/python/integrations/providers/overview) [Learn](https://docs.langchain.com/oss/python/learn) [Reference](https://docs.langchain.com/oss/python/reference/overview) [Contribute](https://docs.langchain.com/oss/python/contributing/overview) Python * [Overview](https://docs.langchain.com/oss/python/langchain/overview) ##### Get started * [Install](https://docs.langchain.com/oss/python/langchain/install) * [Quickstart](https://docs.langchain.com/oss/python/langchain/quickstart) * [Changelog](https://docs.langchain.com/oss/python/releases/changelog) * [Philosophy](https://docs.langchain.com/oss/python/langchain/philosophy) ##### Core components * [Agents](https://docs.langchain.com/oss/python/langchain/agents) * [Models](https://docs.langchain.com/oss/python/langchain/models) * [Messages](https://docs.langchain.com/oss/python/langchain/messages) * [Tools](https://docs.langchain.com/oss/python/langchain/tools) * [Short-term memory](https://docs.langchain.com/oss/python/langchain/short-term-memory) * [Streaming](https://docs.langchain.com/oss/python/langchain/streaming) * [Structured output](https://docs.langchain.com/oss/python/langchain/structured-output) ##### Middleware * [Overview](https://docs.langchain.com/oss/python/langchain/middleware/overview) * [Built-in middleware](https://docs.langchain.com/oss/python/langchain/middleware/built-in) * [Custom middleware](https://docs.langchain.com/oss/python/langchain/middleware/custom) ##### Advanced usage * [Guardrails](https://docs.langchain.com/oss/python/langchain/guardrails) * [Runtime](https://docs.langchain.com/oss/python/langchain/runtime) * [Context engineering](https://docs.langchain.com/oss/python/langchain/context-engineering) * [Model Context Protocol (MCP)](https://docs.langchain.com/oss/python/langchain/mcp) * [Human-in-the-loop](https://docs.langchain.com/oss/python/langchain/human-in-the-loop) * Multi-agent * [Overview](https://docs.langchain.com/oss/python/langchain/multi-agent) * [Subagents](https://docs.langchain.com/oss/python/langchain/multi-agent/subagents) * [Handoffs](https://docs.langchain.com/oss/python/langchain/multi-agent/handoffs) * [Skills](https://docs.langchain.com/oss/python/langchain/multi-agent/skills) * [Router](https://docs.langchain.com/oss/python/langchain/multi-agent/router) * [Custom workflow](https://docs.langchain.com/oss/python/langchain/multi-agent/custom-workflow) * [Retrieval](https://docs.langchain.com/oss/python/langchain/retrieval) * [Long-term memory](https://docs.langchain.com/oss/python/langchain/long-term-memory) ##### Agent development * [LangSmith Studio](https://docs.langchain.com/oss/python/langchain/studio) * [Test](https://docs.langchain.com/oss/python/langchain/test) * [Agent Chat UI](https://docs.langchain.com/oss/python/langchain/ui) ##### Deploy with LangSmith * [Deployment](https://docs.langchain.com/oss/python/langchain/deploy) * [Observability](https://docs.langchain.com/oss/python/langchain/observability) On this page * [Why multi-agent?](https://docs.langchain.com/oss/python/langchain/multi-agent/index#why-multi-agent) * [Patterns](https://docs.langchain.com/oss/python/langchain/multi-agent/index#patterns) * [Choosing a pattern](https://docs.langchain.com/oss/python/langchain/multi-agent/index#choosing-a-pattern) * [Visual overview](https://docs.langchain.com/oss/python/langchain/multi-agent/index#visual-overview) * [Performance comparison](https://docs.langchain.com/oss/python/langchain/multi-agent/index#performance-comparison) * [One-shot request](https://docs.langchain.com/oss/python/langchain/multi-agent/index#one-shot-request) * [Repeat request](https://docs.langchain.com/oss/python/langchain/multi-agent/index#repeat-request) * [Multi-domain](https://docs.langchain.com/oss/python/langchain/multi-agent/index#multi-domain) * [Summary](https://docs.langchain.com/oss/python/langchain/multi-agent/index#summary) Multi-agent systems coordinate specialized components to tackle complex workflows. However, not every complex task requires this approach — a single agent with the right (sometimes dynamic) tools and prompt can often achieve similar results. [​](https://docs.langchain.com/oss/python/langchain/multi-agent/index#why-multi-agent) Why multi-agent? ---------------------------------------------------------------------------------------------------------- When developers say they need “multi-agent,” they’re usually looking for one or more of these capabilities: * **Context management**: Provide specialized knowledge without overwhelming the model’s context window. If context were infinite and latency zero, you could dump all knowledge into a single prompt — but since it’s not, you need patterns to selectively surface relevant information. * **Distributed development**: Allow different teams to develop and maintain capabilities independently, composing them into a larger system with clear boundaries. * **Parallelization**: Spawn specialized workers for subtasks and execute them concurrently for faster results. Multi-agent patterns are particularly valuable when a single agent has too many [tools](https://docs.langchain.com/oss/python/langchain/tools) and makes poor decisions about which to use, when tasks require specialized knowledge with extensive context (long prompts and domain-specific tools), or when you need to enforce sequential constraints that unlock capabilities only after certain conditions are met. At the center of multi-agent design is **[context engineering](https://docs.langchain.com/oss/python/langchain/context-engineering) **—deciding what information each agent sees. The quality of your system depends on ensuring each agent has access to the right data for its task. [​](https://docs.langchain.com/oss/python/langchain/multi-agent/index#patterns) Patterns ------------------------------------------------------------------------------------------- Here are the main patterns for building multi-agent systems, each suited to different use cases: | Pattern | How it works | | --- | --- | | [**Subagents**](https://docs.langchain.com/oss/python/langchain/multi-agent/subagents) | A main agent coordinates subagents as tools. All routing passes through the main agent, which decides when and how to invoke each subagent. | | [**Handoffs**](https://docs.langchain.com/oss/python/langchain/multi-agent/handoffs) | Behavior changes dynamically based on state. Tool calls update a state variable that triggers routing or configuration changes, switching agents or adjusting the current agent’s tools and prompt. | | [**Skills**](https://docs.langchain.com/oss/python/langchain/multi-agent/skills) | Specialized prompts and knowledge loaded on-demand. A single agent stays in control while loading context from skills as needed. | | [**Router**](https://docs.langchain.com/oss/python/langchain/multi-agent/router) | A routing step classifies input and directs it to one or more specialized agents. Results are synthesized into a combined response. | | [**Custom workflow**](https://docs.langchain.com/oss/python/langchain/multi-agent/custom-workflow) | Build bespoke execution flows with [LangGraph](https://docs.langchain.com/oss/python/langgraph/overview)
, mixing deterministic logic and agentic behavior. Embed other patterns as nodes in your workflow. | ### [​](https://docs.langchain.com/oss/python/langchain/multi-agent/index#choosing-a-pattern) Choosing a pattern Use this table to match your requirements to the right pattern: | Pattern | Distributed development | Parallelization | Multi-hop | Direct user interaction | | --- | --- | --- | --- | --- | | [**Subagents**](https://docs.langchain.com/oss/python/langchain/multi-agent/subagents) | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐ | | [**Handoffs**](https://docs.langchain.com/oss/python/langchain/multi-agent/handoffs) | — | — | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | | [**Skills**](https://docs.langchain.com/oss/python/langchain/multi-agent/skills) | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | | [**Router**](https://docs.langchain.com/oss/python/langchain/multi-agent/router) | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ | — | ⭐⭐⭐ | * **Distributed development**: Can different teams maintain components independently? * **Parallelization**: Can multiple agents execute concurrently? * **Multi-hop**: Does the pattern support calling multiple subagents in series? * **Direct user interaction**: Can subagents converse directly with the user? You can mix patterns! For example, a **subagents** architecture can invoke tools that invoke custom workflows or router agents. Subagents can even use the **skills** pattern to load context on-demand. The possibilities are endless! ### [​](https://docs.langchain.com/oss/python/langchain/multi-agent/index#visual-overview) Visual overview * Subagents * Handoffs * Skills * Router A main agent coordinates subagents as tools. All routing passes through the main agent. ![Subagents pattern: main agent coordinates subagents as tools](https://mintcdn.com/langchain-5e9cc07a/CRpSg52QqwDx49Bw/oss/langchain/multi-agent/images/pattern-subagents.png?w=2500&fit=max&auto=format&n=CRpSg52QqwDx49Bw&q=85&s=aed1142e36c9d14ad3112fb79b3bd5e7) Agents transfer control to each other via tool calls. Each agent can hand off to others or respond directly to the user. ![Handoffs pattern: agents transfer control via tool calls](https://mintcdn.com/langchain-5e9cc07a/CRpSg52QqwDx49Bw/oss/langchain/multi-agent/images/pattern-handoffs.png?w=2500&fit=max&auto=format&n=CRpSg52QqwDx49Bw&q=85&s=e10a8a34caedade736d649706421f45e) A single agent loads specialized prompts and knowledge on-demand while staying in control. ![Skills pattern: single agent loads specialized context on-demand](https://mintcdn.com/langchain-5e9cc07a/CRpSg52QqwDx49Bw/oss/langchain/multi-agent/images/pattern-skills.png?w=2500&fit=max&auto=format&n=CRpSg52QqwDx49Bw&q=85&s=39c6340df7aec5e939cee67d9ad98a40) A routing step classifies input and directs it to specialized agents. Results are synthesized. ![Router pattern: routing step classifies input to specialized agents](https://mintcdn.com/langchain-5e9cc07a/CRpSg52QqwDx49Bw/oss/langchain/multi-agent/images/pattern-router.png?w=2500&fit=max&auto=format&n=CRpSg52QqwDx49Bw&q=85&s=f82cee5c5666099a5a66b363d76362d8) [​](https://docs.langchain.com/oss/python/langchain/multi-agent/index#performance-comparison) Performance comparison ----------------------------------------------------------------------------------------------------------------------- Different patterns have different performance characteristics. Understanding these tradeoffs helps you choose the right pattern for your latency and cost requirements. **Key metrics:** * **Model calls**: Number of LLM invocations. More calls = higher latency (especially if sequential) and higher per-request API costs. * **Tokens processed**: Total [context window](https://docs.langchain.com/oss/python/langchain/context-engineering) usage across all calls. More tokens = higher processing costs and potential context limits. ### [​](https://docs.langchain.com/oss/python/langchain/multi-agent/index#one-shot-request) One-shot request > **User:** “Buy coffee” A specialized coffee agent/skill can call a `buy_coffee` tool. | Pattern | Model calls | Best fit | | --- | --- | --- | | [**Subagents**](https://docs.langchain.com/oss/python/langchain/multi-agent/subagents) | 4 | | | [**Handoffs**](https://docs.langchain.com/oss/python/langchain/multi-agent/handoffs) | 3 | ✅ | | [**Skills**](https://docs.langchain.com/oss/python/langchain/multi-agent/skills) | 3 | ✅ | | [**Router**](https://docs.langchain.com/oss/python/langchain/multi-agent/router) | 3 | ✅ | * Subagents * Handoffs * Skills * Router **4 model calls:** ![Subagents one-shot: 4 model calls for buy coffee request](https://mintcdn.com/langchain-5e9cc07a/CRpSg52QqwDx49Bw/oss/langchain/multi-agent/images/oneshot-subagents.png?w=2500&fit=max&auto=format&n=CRpSg52QqwDx49Bw&q=85&s=8976a6ec78331547b646dd15eb90f0a9) **3 model calls:** ![Handoffs one-shot: 3 model calls for buy coffee request](https://mintcdn.com/langchain-5e9cc07a/CRpSg52QqwDx49Bw/oss/langchain/multi-agent/images/oneshot-handoffs.png?w=2500&fit=max&auto=format&n=CRpSg52QqwDx49Bw&q=85&s=2a680c44fb25d22e6875ec3deab4e6e6) **3 model calls:** ![Skills one-shot: 3 model calls for buy coffee request](https://mintcdn.com/langchain-5e9cc07a/CRpSg52QqwDx49Bw/oss/langchain/multi-agent/images/oneshot-skills.png?w=2500&fit=max&auto=format&n=CRpSg52QqwDx49Bw&q=85&s=6347e03b16c67944960d58ae54238db0) **3 model calls:** ![Router one-shot: 3 model calls for buy coffee request](https://mintcdn.com/langchain-5e9cc07a/CRpSg52QqwDx49Bw/oss/langchain/multi-agent/images/oneshot-router.png?w=2500&fit=max&auto=format&n=CRpSg52QqwDx49Bw&q=85&s=ae9bc9a3ba4b2c83d1633008212109ef) **Key insight:** Handoffs, Skills, and Router are most efficient for single tasks (3 calls each). Subagents adds one extra call because results flow back through the main agent—this overhead provides centralized control. ### [​](https://docs.langchain.com/oss/python/langchain/multi-agent/index#repeat-request) Repeat request > **Turn 1:** “Buy coffee” **Turn 2:** “Buy coffee again” The user repeats the same request in the same conversation. | Pattern | Turn 2 calls | Total (both turns) | Best fit | | --- | --- | --- | --- | | [**Subagents**](https://docs.langchain.com/oss/python/langchain/multi-agent/subagents) | 4 | 8 | | | [**Handoffs**](https://docs.langchain.com/oss/python/langchain/multi-agent/handoffs) | 2 | 5 | ✅ | | [**Skills**](https://docs.langchain.com/oss/python/langchain/multi-agent/skills) | 2 | 5 | ✅ | | [**Router**](https://docs.langchain.com/oss/python/langchain/multi-agent/router) | 3 | 6 | | * Subagents * Handoffs * Skills * Router **4 calls again → 8 total** * Subagents are **stateless by design**—each invocation follows the same flow * The main agent maintains conversation context, but subagents start fresh each time * This provides strong context isolation but repeats the full flow **2 calls → 5 total** * The coffee agent is **still active** from turn 1 (state persists) * No handoff needed—agent directly calls `buy_coffee` tool (call 1) * Agent responds to user (call 2) * **Saves 1 call by skipping the handoff** **2 calls → 5 total** * The skill context is **already loaded** in conversation history * No need to reload—agent directly calls `buy_coffee` tool (call 1) * Agent responds to user (call 2) * **Saves 1 call by reusing loaded skill** **3 calls again → 6 total** * Routers are **stateless**—each request requires an LLM routing call * Turn 2: Router LLM call (1) → Milk agent calls buy\_coffee (2) → Milk agent responds (3) * Can be optimized by wrapping as a tool in a stateful agent **Key insight:** Stateful patterns (Handoffs, Skills) save 40-50% of calls on repeat requests. Subagents maintain consistent cost per request—this stateless design provides strong context isolation but at the cost of repeated model calls. ### [​](https://docs.langchain.com/oss/python/langchain/multi-agent/index#multi-domain) Multi-domain > **User:** “Compare Python, JavaScript, and Rust for web development” Each language agent/skill contains ~2000 tokens of documentation. All patterns can make parallel tool calls. | Pattern | Model calls | Total tokens | Best fit | | --- | --- | --- | --- | | [**Subagents**](https://docs.langchain.com/oss/python/langchain/multi-agent/subagents) | 5 | ~9K | ✅ | | [**Handoffs**](https://docs.langchain.com/oss/python/langchain/multi-agent/handoffs) | 7+ | ~14K+ | | | [**Skills**](https://docs.langchain.com/oss/python/langchain/multi-agent/skills) | 3 | ~15K | | | [**Router**](https://docs.langchain.com/oss/python/langchain/multi-agent/router) | 5 | ~9K | ✅ | * Subagents * Handoffs * Skills * Router **5 calls, ~9K tokens** ![Subagents multi-domain: 5 calls with parallel execution](https://mintcdn.com/langchain-5e9cc07a/CRpSg52QqwDx49Bw/oss/langchain/multi-agent/images/multidomain-subagents.png?w=2500&fit=max&auto=format&n=CRpSg52QqwDx49Bw&q=85&s=dd73db2d3a95b61932d245d8599d59ab) Each subagent works in **isolation** with only its relevant context. Total: **9K tokens**. **7+ calls, ~14K+ tokens** ![Handoffs multi-domain: 7+ sequential calls](https://mintcdn.com/langchain-5e9cc07a/CRpSg52QqwDx49Bw/oss/langchain/multi-agent/images/multidomain-handoffs.png?w=2500&fit=max&auto=format&n=CRpSg52QqwDx49Bw&q=85&s=07dfd7985275da31defbc8be51193f50) Handoffs executes **sequentially**—can’t research all three languages in parallel. Growing conversation history adds overhead. Total: **~14K+ tokens**. **3 calls, ~15K tokens** ![Skills multi-domain: 3 calls with accumulated context](https://mintcdn.com/langchain-5e9cc07a/CRpSg52QqwDx49Bw/oss/langchain/multi-agent/images/multidomain-skills.png?w=2500&fit=max&auto=format&n=CRpSg52QqwDx49Bw&q=85&s=a100546e4fac49bef2f44e09dc56cf01) After loading, **every subsequent call processes all 6K tokens of skill documentation**. Subagents processes 67% fewer tokens overall due to context isolation. Total: **15K tokens**. **5 calls, ~9K tokens** ![Router multi-domain: 5 calls with parallel execution](https://mintcdn.com/langchain-5e9cc07a/CRpSg52QqwDx49Bw/oss/langchain/multi-agent/images/multidomain-router.png?w=2500&fit=max&auto=format&n=CRpSg52QqwDx49Bw&q=85&s=d00dccb3ad36508a4a50d52f093b3e10) Router uses an **LLM for routing**, then invokes agents in parallel. Similar to Subagents but with explicit routing step. Total: **9K tokens**. **Key insight:** For multi-domain tasks, patterns with parallel execution (Subagents, Router) are most efficient. Skills has fewer calls but high token usage due to context accumulation. Handoffs is inefficient here—it must execute sequentially and can’t leverage parallel tool calling for consulting multiple domains simultaneously. ### [​](https://docs.langchain.com/oss/python/langchain/multi-agent/index#summary) Summary Here’s how patterns compare across all three scenarios: | Pattern | One-shot | Repeat request | Multi-domain | | --- | --- | --- | --- | | [**Subagents**](https://docs.langchain.com/oss/python/langchain/multi-agent/subagents) | 4 calls | 8 calls (4+4) | 5 calls, 9K tokens | | [**Handoffs**](https://docs.langchain.com/oss/python/langchain/multi-agent/handoffs) | 3 calls | 5 calls (3+2) | 7+ calls, 14K+ tokens | | [**Skills**](https://docs.langchain.com/oss/python/langchain/multi-agent/skills) | 3 calls | 5 calls (3+2) | 3 calls, 15K tokens | | [**Router**](https://docs.langchain.com/oss/python/langchain/multi-agent/router) | 3 calls | 6 calls (3+3) | 5 calls, 9K tokens | **Choosing a pattern:** | Optimize for | [Subagents](https://docs.langchain.com/oss/python/langchain/multi-agent/subagents) | [Handoffs](https://docs.langchain.com/oss/python/langchain/multi-agent/handoffs) | [Skills](https://docs.langchain.com/oss/python/langchain/multi-agent/skills) | [Router](https://docs.langchain.com/oss/python/langchain/multi-agent/router) | | --- | --- | --- | --- | --- | | Single requests | | ✅ | ✅ | ✅ | | Repeat requests | | ✅ | ✅ | | | Parallel execution | ✅ | | | ✅ | | Large-context domains | ✅ | | | ✅ | | Simple, focused tasks | | | ✅ | | * * * [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/langchain/multi-agent/index.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose) . [Connect these docs](https://docs.langchain.com/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers. Was this page helpful? YesNo [Human-in-the-loop\ \ Previous](https://docs.langchain.com/oss/python/langchain/human-in-the-loop) [Subagents\ \ Next](https://docs.langchain.com/oss/python/langchain/multi-agent/subagents) ⌘I ---