mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-26 09:32:25 +02:00
docs: expose supervisor, swarm & MCP in the API reference (#4446)
This commit is contained in:
@@ -22,6 +22,12 @@ MANUAL_API_REFERENCES_LANGGRAPH = [
|
||||
"create_react_agent",
|
||||
"prebuilt",
|
||||
),
|
||||
(
|
||||
[],
|
||||
"langgraph.prebuilt.chat_agent_executor",
|
||||
"AgentState",
|
||||
"prebuilt",
|
||||
),
|
||||
(["langgraph.prebuilt"], "langgraph.prebuilt.tool_node", "ToolNode", "prebuilt"),
|
||||
(
|
||||
["langgraph.prebuilt"],
|
||||
@@ -63,6 +69,18 @@ MANUAL_API_REFERENCES_LANGGRAPH = [
|
||||
([], "langgraph.checkpoint.sqlite", "SqliteSaver", "checkpoints"),
|
||||
([], "langgraph.checkpoint.postgres.aio", "AsyncPostgresSaver", "checkpoints"),
|
||||
([], "langgraph.checkpoint.postgres", "PostgresSaver", "checkpoints"),
|
||||
# other prebuilts
|
||||
(["langgraph_supervisor"], "langgraph_supervisor.supervisor", "create_supervisor", "supervisor"),
|
||||
(["langgraph_supervisor"], "langgraph_supervisor.handoff", "create_handoff_tool", "supervisor"),
|
||||
([], "langgraph_supervisor.handoff", "create_forward_message_tool", "supervisor"),
|
||||
(["langgraph_swarm"], "langgraph_swarm.swarm", "create_swarm", "swarm"),
|
||||
(["langgraph_swarm"], "langgraph_swarm.swarm", "add_active_agent_router", "swarm"),
|
||||
(["langgraph_swarm"], "langgraph_swarm.swarm", "SwarmState", "swarm"),
|
||||
(["langgraph_swarm"], "langgraph_swarm.handoff", "create_handoff_tool", "swarm"),
|
||||
([], "langchain_mcp_adapters.client", "MultiServerMCPClient", "mcp"),
|
||||
([], "langchain_mcp_adapters.tools", "load_mcp_tools", "mcp"),
|
||||
([], "langchain_mcp_adapters.prompts", "load_mcp_prompt", "mcp"),
|
||||
([], "langchain_mcp_adapters.resources", "load_mcp_resources", "mcp"),
|
||||
]
|
||||
|
||||
WELL_KNOWN_LANGGRAPH_OBJECTS = {
|
||||
@@ -144,7 +162,9 @@ def get_imports(code: str, path: str) -> List[ImportInformation]:
|
||||
for found_import in found_imports:
|
||||
module = found_import["source"]
|
||||
|
||||
if module.startswith("langchain"):
|
||||
if module.startswith("langchain_mcp_adapters"):
|
||||
package_ecosystem = "langgraph"
|
||||
elif module.startswith("langchain"):
|
||||
# Handles things like `langchain` or `langchain_anthropic`
|
||||
package_ecosystem = "langchain"
|
||||
elif module.startswith("langgraph"):
|
||||
|
||||
@@ -32,7 +32,8 @@ REDIRECT_MAP = {
|
||||
"cloud/concepts/cloud.md": "concepts/langgraph_cloud.md",
|
||||
"cloud/faq/studio.md": "concepts/langgraph_studio.md#studio-faqs",
|
||||
# misc
|
||||
"prebuilt.md": "agents/prebuilt.md"
|
||||
"prebuilt.md": "agents/prebuilt.md",
|
||||
"reference/prebuilt.md": "reference/agents.md"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ See the below guide for how to integrate with other frameworks using the [Functi
|
||||
|
||||
### Prebuilt ReAct Agent
|
||||
|
||||
The LangGraph [prebuilt ReAct agent](../reference/prebuilt.md#langgraph.prebuilt.chat_agent_executor.create_react_agent) is pre-built implementation of a [tool calling agent](../concepts/agentic_concepts.md#tool-calling-agent).
|
||||
The LangGraph [prebuilt ReAct agent](../reference/agents.md#langgraph.prebuilt.chat_agent_executor.create_react_agent) is pre-built implementation of a [tool calling agent](../concepts/agentic_concepts.md#tool-calling-agent).
|
||||
|
||||
One of the big benefits of LangGraph is that you can easily create your own agent architectures. So while it's fine to start here to build an agent quickly, we would strongly recommend learning how to build your own agent so that you can take full advantage of LangGraph.
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
# Prebuilt
|
||||
# Agents
|
||||
|
||||
::: langgraph.prebuilt.chat_agent_executor
|
||||
options:
|
||||
members:
|
||||
- AgentState
|
||||
- create_react_agent
|
||||
|
||||
::: langgraph.prebuilt.tool_node
|
||||
@@ -0,0 +1,21 @@
|
||||
# LangChain Model Context Protocol (MCP) Adapters
|
||||
|
||||
::: langchain_mcp_adapters.client
|
||||
options:
|
||||
members:
|
||||
- MultiServerMCPClient
|
||||
|
||||
::: langchain_mcp_adapters.tools
|
||||
options:
|
||||
members:
|
||||
- load_mcp_tools
|
||||
|
||||
::: langchain_mcp_adapters.prompts
|
||||
options:
|
||||
members:
|
||||
- load_mcp_prompt
|
||||
|
||||
::: langchain_mcp_adapters.resources
|
||||
options:
|
||||
members:
|
||||
- load_mcp_resources
|
||||
@@ -0,0 +1,12 @@
|
||||
# LangGraph Supervisor
|
||||
|
||||
::: langgraph_supervisor.supervisor
|
||||
options:
|
||||
members:
|
||||
- create_supervisor
|
||||
|
||||
::: langgraph_supervisor.handoff
|
||||
options:
|
||||
members:
|
||||
- create_handoff_tool
|
||||
- create_forward_message_tool
|
||||
@@ -0,0 +1,13 @@
|
||||
# LangGraph Swarm
|
||||
|
||||
::: langgraph_swarm.swarm
|
||||
options:
|
||||
members:
|
||||
- SwarmState
|
||||
- create_swarm
|
||||
- add_active_agent_router
|
||||
|
||||
::: langgraph_swarm.handoff
|
||||
options:
|
||||
members:
|
||||
- create_handoff_tool
|
||||
+7
-3
@@ -384,13 +384,12 @@ nav:
|
||||
- Resources:
|
||||
# NOTE: prebuilt.md is auto-generated by `make build-prebuilt`
|
||||
- agents/prebuilt.md
|
||||
- API reference:
|
||||
- Reference:
|
||||
- reference/index.md
|
||||
- Library:
|
||||
- LangGraph:
|
||||
- Graphs: reference/graphs.md
|
||||
- Checkpointing: reference/checkpoints.md
|
||||
- Storage: reference/store.md
|
||||
- Prebuilt components: reference/prebuilt.md
|
||||
- Channels: reference/channels.md
|
||||
- Errors: reference/errors.md
|
||||
- Types: reference/types.md
|
||||
@@ -398,6 +397,11 @@ nav:
|
||||
- Pregel: reference/pregel.md
|
||||
- Config: reference/config.md
|
||||
- Functional API: reference/func.md
|
||||
- Prebuilt:
|
||||
- Agents: reference/agents.md
|
||||
- Supervisor: reference/supervisor.md
|
||||
- Swarm: reference/swarm.md
|
||||
- MCP Adapters: reference/mcp.md
|
||||
- LangGraph Platform:
|
||||
- Server API: "cloud/reference/api/api_ref.md"
|
||||
- CLI: "cloud/reference/cli.md"
|
||||
|
||||
Generated
+111
-4
@@ -3473,6 +3473,26 @@ langchain-core = ">=0.3.49,<1.0.0"
|
||||
openai = ">=1.10.0,<2.0.0"
|
||||
requests = ">=2,<3"
|
||||
|
||||
[[package]]
|
||||
name = "langchain-mcp-adapters"
|
||||
version = "0.0.9"
|
||||
description = "Make Anthropic Model Context Protocol (MCP) tools compatible with LangChain and LangGraph agents."
|
||||
optional = false
|
||||
python-versions = ">=3.10"
|
||||
groups = ["docs"]
|
||||
files = []
|
||||
develop = false
|
||||
|
||||
[package.dependencies]
|
||||
langchain-core = ">=0.3.36,<0.4"
|
||||
mcp = ">=1.4.1,<1.7"
|
||||
|
||||
[package.source]
|
||||
type = "git"
|
||||
url = "https://github.com/langchain-ai/langchain-mcp-adapters"
|
||||
reference = "HEAD"
|
||||
resolved_reference = "85eb1dcb4c5c86008feca287d9195e67861ad2d7"
|
||||
|
||||
[[package]]
|
||||
name = "langchain-mistralai"
|
||||
version = "0.2.10"
|
||||
@@ -3705,6 +3725,47 @@ orjson = ">=3.10.1"
|
||||
type = "directory"
|
||||
url = "../libs/sdk-py"
|
||||
|
||||
[[package]]
|
||||
name = "langgraph-supervisor"
|
||||
version = "0.0.18"
|
||||
description = "An implementation of a supervisor multi-agent architecture using LangGraph"
|
||||
optional = false
|
||||
python-versions = ">=3.10"
|
||||
groups = ["docs"]
|
||||
files = []
|
||||
develop = false
|
||||
|
||||
[package.dependencies]
|
||||
langchain-core = ">=0.3.40,<0.4.0"
|
||||
langgraph = ">=0.3.5,<0.4.0"
|
||||
langgraph-prebuilt = ">=0.1.7,<0.2.0"
|
||||
|
||||
[package.source]
|
||||
type = "git"
|
||||
url = "https://github.com/langchain-ai/langgraph-supervisor-py"
|
||||
reference = "HEAD"
|
||||
resolved_reference = "18c8e7b7ca67828de6b71a83d7393ecb3c0372b0"
|
||||
|
||||
[[package]]
|
||||
name = "langgraph-swarm"
|
||||
version = "0.0.10"
|
||||
description = "An implementation of a multi-agent swarm using LangGraph"
|
||||
optional = false
|
||||
python-versions = ">=3.10"
|
||||
groups = ["docs"]
|
||||
files = []
|
||||
develop = false
|
||||
|
||||
[package.dependencies]
|
||||
langchain-core = ">=0.3.40,<0.4.0"
|
||||
langgraph = ">=0.3.5,<0.4.0"
|
||||
|
||||
[package.source]
|
||||
type = "git"
|
||||
url = "https://github.com/langchain-ai/langgraph-swarm-py"
|
||||
reference = "HEAD"
|
||||
resolved_reference = "aa56a3935b41adc265239c014b1d341f9bbee4ba"
|
||||
|
||||
[[package]]
|
||||
name = "langmem"
|
||||
version = "0.0.19"
|
||||
@@ -4014,6 +4075,33 @@ files = [
|
||||
[package.dependencies]
|
||||
traitlets = "*"
|
||||
|
||||
[[package]]
|
||||
name = "mcp"
|
||||
version = "1.6.0"
|
||||
description = "Model Context Protocol SDK"
|
||||
optional = false
|
||||
python-versions = ">=3.10"
|
||||
groups = ["docs"]
|
||||
files = [
|
||||
{file = "mcp-1.6.0-py3-none-any.whl", hash = "sha256:7bd24c6ea042dbec44c754f100984d186620d8b841ec30f1b19eda9b93a634d0"},
|
||||
{file = "mcp-1.6.0.tar.gz", hash = "sha256:d9324876de2c5637369f43161cd71eebfd803df5a95e46225cab8d280e366723"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
anyio = ">=4.5"
|
||||
httpx = ">=0.27"
|
||||
httpx-sse = ">=0.4"
|
||||
pydantic = ">=2.7.2,<3.0.0"
|
||||
pydantic-settings = ">=2.5.2"
|
||||
sse-starlette = ">=1.6.1"
|
||||
starlette = ">=0.27"
|
||||
uvicorn = ">=0.23.1"
|
||||
|
||||
[package.extras]
|
||||
cli = ["python-dotenv (>=1.0.0)", "typer (>=0.12.4)"]
|
||||
rich = ["rich (>=13.9.4)"]
|
||||
ws = ["websockets (>=15.0.1)"]
|
||||
|
||||
[[package]]
|
||||
name = "mdurl"
|
||||
version = "0.1.2"
|
||||
@@ -6103,7 +6191,6 @@ optional = false
|
||||
python-versions = ">=3.8"
|
||||
groups = ["test"]
|
||||
files = [
|
||||
{file = "pyasn1-0.6.1-py3-none-any.whl", hash = "sha256:0d632f46f2ba09143da3a8afe9e33fb6f92fa2320ab7e886e2d0f7672af84629"},
|
||||
{file = "pyasn1-0.6.1.tar.gz", hash = "sha256:6f580d2bdd84365380830acf45550f2511469f673cb4a5ae3857a3170128b034"},
|
||||
]
|
||||
|
||||
@@ -7589,6 +7676,26 @@ postgresql-psycopgbinary = ["psycopg[binary] (>=3.0.7)"]
|
||||
pymysql = ["pymysql"]
|
||||
sqlcipher = ["sqlcipher3_binary"]
|
||||
|
||||
[[package]]
|
||||
name = "sse-starlette"
|
||||
version = "2.3.3"
|
||||
description = "SSE plugin for Starlette"
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["docs"]
|
||||
files = [
|
||||
{file = "sse_starlette-2.3.3-py3-none-any.whl", hash = "sha256:8b0a0ced04a329ff7341b01007580dd8cf71331cc21c0ccea677d500618da1e0"},
|
||||
{file = "sse_starlette-2.3.3.tar.gz", hash = "sha256:fdd47c254aad42907cfd5c5b83e2282be15be6c51197bf1a9b70b8e990522072"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
anyio = ">=4.7.0"
|
||||
starlette = ">=0.41.3"
|
||||
|
||||
[package.extras]
|
||||
examples = ["fastapi"]
|
||||
uvicorn = ["uvicorn (>=0.34.0)"]
|
||||
|
||||
[[package]]
|
||||
name = "stack-data"
|
||||
version = "0.6.3"
|
||||
@@ -7615,7 +7722,7 @@ version = "0.46.2"
|
||||
description = "The little ASGI library that shines."
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["test"]
|
||||
groups = ["docs", "test"]
|
||||
files = [
|
||||
{file = "starlette-0.46.2-py3-none-any.whl", hash = "sha256:595633ce89f8ffa71a015caed34a5b2dc1c0cdb3f0f1fbd1e69339cf2abeec35"},
|
||||
{file = "starlette-0.46.2.tar.gz", hash = "sha256:7f7361f34eed179294600af672f565727419830b54b7b084efe44bb82d2fccd5"},
|
||||
@@ -8191,7 +8298,7 @@ version = "0.34.2"
|
||||
description = "The lightning-fast ASGI server."
|
||||
optional = false
|
||||
python-versions = ">=3.9"
|
||||
groups = ["test"]
|
||||
groups = ["docs", "test"]
|
||||
files = [
|
||||
{file = "uvicorn-0.34.2-py3-none-any.whl", hash = "sha256:deb49af569084536d269fe0a6d67e3754f104cf03aba7c11c40f01aadf33c403"},
|
||||
{file = "uvicorn-0.34.2.tar.gz", hash = "sha256:0e929828f6186353a80b58ea719861d2629d766293b6d19baf086ba31d4f3328"},
|
||||
@@ -9068,4 +9175,4 @@ cffi = ["cffi (>=1.11)"]
|
||||
[metadata]
|
||||
lock-version = "2.1"
|
||||
python-versions = "^3.10"
|
||||
content-hash = "4ea147f5c9060b856ea0a450ea78bb6666778d222dac2c3a3cf781b61f140bb6"
|
||||
content-hash = "aed7bb5f851ee6aaf2ec175ca5eddb94d21e62c8142035f7552bc92e85db8293"
|
||||
|
||||
@@ -20,6 +20,10 @@ langgraph-checkpoint = { path = "../libs/checkpoint/", develop = true }
|
||||
langgraph-checkpoint-sqlite = { path = "../libs/checkpoint-sqlite", develop = true }
|
||||
langgraph-checkpoint-postgres = { path = "../libs/checkpoint-postgres", develop = true }
|
||||
langgraph-sdk = {path = "../libs/sdk-py", develop = true}
|
||||
# TODO: switch these to published versions
|
||||
langgraph-supervisor = { git = "https://github.com/langchain-ai/langgraph-supervisor-py" }
|
||||
langgraph-swarm = { git = "https://github.com/langchain-ai/langgraph-swarm-py" }
|
||||
langchain-mcp-adapters = { git = "https://github.com/langchain-ai/langchain-mcp-adapters" }
|
||||
langchain-ollama = "^0.2.3"
|
||||
mkdocs = "*"
|
||||
mkdocs-autorefs = "*"
|
||||
|
||||
Reference in New Issue
Block a user