Middleware for async subagents running on remote Agent Protocol servers.
Async subagents use the LangGraph SDK to launch background runs on remote Agent Protocol servers. Unlike synchronous subagents (which block until completion), async subagents return a task ID immediately, allowing the main agent to monitor progress and send updates while the subagent works.
Compatible with LangGraph Platform (managed) and self-hosted servers.
Append text to a system message.
Specification for an async subagent running on a remote Agent Protocol server.
Async subagents connect to any Agent Protocol-compliant server via the LangGraph SDK. They run as background tasks that the main agent can monitor and update.
Compatible with LangGraph Platform (managed) and self-hosted servers.
Authentication for LangGraph Platform is handled automatically by the SDK
via environment variables (LANGGRAPH_API_KEY, LANGSMITH_API_KEY, or
LANGCHAIN_API_KEY). For self-hosted servers, pass custom auth via
headers.
A tracked async subagent task persisted in agent state.
State extension for async subagent task tracking.
Input schema for the start_async_task tool.
Input schema for the check_async_task tool.
Input schema for the update_async_task tool.
Input schema for the cancel_async_task tool.
Input schema for the list_async_tasks tool.
Middleware for async subagents running on remote Agent Protocol servers.
This middleware adds tools for launching, monitoring, and updating
background tasks on remote Agent Protocol servers. Unlike the synchronous
SubAgentMiddleware, async subagents return immediately with a task ID,
allowing the main agent to continue working while subagents execute.
Works with any Agent Protocol-compliant server ā LangGraph Platform (managed) or self-hosted (e.g. a FastAPI server implementing the Agent Protocol spec).
Task IDs are persisted in the agent state under async_tasks so they
survive context compaction/offloading and can be accessed programmatically.