文件最后提交记录最后更新时间
chore: self hosted async subagent example (#2375) Port of https://github.com/langchain-ai/deepagentsjs/pull/3992 个月前
chore: self hosted async subagent example (#2375) Port of https://github.com/langchain-ai/deepagentsjs/pull/3992 个月前
chore: self hosted async subagent example (#2375) Port of https://github.com/langchain-ai/deepagentsjs/pull/3992 个月前
chore: self hosted async subagent example (#2375) Port of https://github.com/langchain-ai/deepagentsjs/pull/3992 个月前
chore: self hosted async subagent example (#2375) Port of https://github.com/langchain-ai/deepagentsjs/pull/3992 个月前
chore: self hosted async subagent example (#2375) Port of https://github.com/langchain-ai/deepagentsjs/pull/3992 个月前
release(deepagents): 0.5.1 (#2520) > [!CAUTION] > Merging this PR will automatically publish to **PyPI** and create a **GitHub release**. For the full release process, see [.github/RELEASING.md](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md). --- _Everything below this line will be the GitHub release body._ --- ## [0.5.1](https://github.com/langchain-ai/deepagents/compare/deepagents==0.5.0...deepagents==0.5.1) (2026-04-07) ### Features * **sdk:** BASE_AGENT_PROMPT tweaks ([#2541](https://github.com/langchain-ai/deepagents/issues/2541)) ([812eef1](https://github.com/langchain-ai/deepagents/commit/812eef185ffda7bc9e6f11425eb5eddc3d3b32e8)) * **sdk:** add artifacts_root to CompositeBackend and middleware ([#2490](https://github.com/langchain-ai/deepagents/issues/2490)) ([753ee56](https://github.com/langchain-ai/deepagents/commit/753ee567f1cc4d544dc2afea7b414564fd07d37d)) ### Bug Fixes * **sdk:** updates for multimodal ([#2514](https://github.com/langchain-ai/deepagents/issues/2514)) ([a2edf3e](https://github.com/langchain-ai/deepagents/commit/a2edf3ed80e17a87027c41a46283387031ebd3e5)) --- _Everything above this line will be the GitHub release body._ --- > [!NOTE] > A **New Contributors** section is appended to the GitHub release notes automatically at publish time (see [Release Pipeline](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md#release-pipeline), step 2). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>1 个月前
README.md

Async Subagent Server

A self-hosted Agent Protocol server that exposes a DeepAgents researcher as an async subagent. Use this as a starting point for hosting your own agent on any infrastructure and connecting it to a DeepAgents supervisor.

The example includes both sides of the pattern:

  • server.py — the FastAPI server your subagent runs on
  • supervisor.py — an interactive REPL showing how to connect to it

Prerequisites

  • ANTHROPIC_API_KEY — required
  • TAVILY_API_KEY — optional; stub search is used if not set

Quickstart

1. Install dependencies:

cd examples/async-subagent-server
uv sync

2. Set up your environment:

cp .env.example .env
# fill in ANTHROPIC_API_KEY (and optionally TAVILY_API_KEY)

3. Start the server:

uv run uvicorn server:app --port 2024

4. In another terminal, start the supervisor:

cd examples/async-subagent-server
ANTHROPIC_API_KEY=... uv run python supervisor.py

Try these prompts:

> research the latest developments in quantum computing
> check status of <task-id>
> update <task-id> to focus on commercial applications only
> cancel <task-id>
> list all tasks

Implemented endpoints

These are the Agent Protocol endpoints the DeepAgents async subagent middleware calls (via the LangGraph SDK):

Endpoint Purpose
POST /threads Create a thread for a new task
POST /threads/{thread_id}/runs Start or interrupt+restart a run
GET /threads/{thread_id}/runs/{run_id} Poll run status
GET /threads/{thread_id} Fetch thread state (values.messages)
POST /threads/{thread_id}/runs/{run_id}/cancel Cancel a run
GET /ok Health check

Swap in your own agent

Replace the create_deep_agent call in server.py with your own agent. The Agent Protocol layer stays the same regardless of what the agent does.

_agent = create_deep_agent(
    model=ChatAnthropic(model="claude-sonnet-4-5"),
    system_prompt="You are a ...",
    tools=[your_tool],
)

⚠️ For demonstration purposes only

This example is intended to illustrate the self-hosted async subagent pattern. It does not feature authentication, rate limiting, or other features required for production use.