Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计通过

deepagents-architecture深度 Agent 架构

Agent Skill

deepagents-architecture 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

3,133

周安装

128

GitHub Stars

55

下载量

1,014
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:deepagents-architecture(深度 Agent 架构)
来源仓库:https://github.com/existential-birds/beagle
仓库路径:skills/deepagents-architecture
安装命令:
npx skills add https://github.com/existential-birds/beagle --skill deepagents-architecture
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/existential-birds/beagle --skill deepagents-architecture

简介

deepagents-architecture 专注于长周期任务规划与子代理委派架构设计决策支持。

  • 适用于需任务分解、文件操作、子代理隔离执行或跨会话记忆持久化的复杂工作流场景。
  • 提供状态后端选择、上下文管理与人类介入审批等机制,支持替代纯 LLM 直接处理复杂任务。
  • 使用前需评估是否具备相应基础设施支持,并注意不同架构选择对资源消耗的影响差异。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Deep Agents Architecture Decisions

When to Use Deep Agents

Use Deep Agents When You Need:

  • Long-horizon tasks - Complex workflows spanning dozens of tool calls
  • Planning capabilities - Task decomposition before execution
  • Filesystem operations - Reading, writing, and editing files
  • Subagent delegation - Isolated task execution with separate context windows
  • Persistent memory - Long-term storage across conversations
  • Human-in-the-loop - Approval gates for sensitive operations
  • Context management - Auto-summarization for long conversations

Consider Alternatives When:

ScenarioAlternativeWhy
Single LLM callDirect API callDeep Agents overhead not justified
Simple RAG pipelineLangChain LCELSimpler abstraction
Custom graph control flowLangGraph directlyMore flexibility
No file operations neededcreate_react_agentLighter weight
Stateless tool useFunction callingNo middleware needed

Backend Selection

Backend Comparison

BackendPersistenceUse CaseRequires
StateBackendEphemeral (per-thread)Working files, temp dataNothing (default)
FilesystemBackendDiskLocal development, real filesroot_dir path
StoreBackendCross-threadUser preferences, knowledge basesLangGraph store
CompositeBackendMixedHybrid memory patternsMultiple backends

Backend Decision Tree

Need real disk access?
├─ Yes → FilesystemBackend(root_dir="/path")
└─ No
   └─ Need persistence across conversations?
      ├─ Yes → Need mixed ephemeral + persistent?
      │  ├─ Yes → CompositeBackend
      │  └─ No → StoreBackend
      └─ No → StateBackend (default)

CompositeBackend Routing

Route different paths to different storage backends:

from deepagents import create_deep_agent
from deepagents.backends import CompositeBackend, StateBackend, StoreBackend

agent = create_deep_agent(
    backend=CompositeBackend(
        default=StateBackend(),  # Working files (ephemeral)
        routes={
            "/memories/": StoreBackend(store=store),    # Persistent
            "/preferences/": StoreBackend(store=store), # Persistent
        },
    ),
)

Subagent Architecture

When to Use Subagents

Use subagents when:

  • Task is complex, multi-step, and can run independently
  • Task requires heavy context that would bloat the main thread
  • Multiple independent tasks can run in parallel
  • You need isolated execution (sandboxing)
  • You only care about the final result, not intermediate steps

Don't use subagents when:

  • Task is trivial (few tool calls)
  • You need to see intermediate reasoning
  • Splitting adds latency without benefit
  • Task depends on main thread state mid-execution

Subagent Patterns

Pattern 1: Parallel Research

         ┌─────────────┐
         │  Orchestrator│
         └──────┬──────┘
    ┌──────────┼──────────┐
    ▼          ▼          ▼
┌──────┐  ┌──────┐  ┌──────┐
│Task A│  │Task B│  │Task C│
└──┬───┘  └──┬───┘  └──┬───┘
   └──────────┼──────────┘
              ▼
      ┌─────────────┐
      │  Synthesize │
      └─────────────┘

Best for: Research on multiple topics, parallel analysis, batch processing.

Pattern 2: Specialized Agents

research_agent = {
    "name": "researcher",
    "description": "Deep research on complex topics",
    "system_prompt": "You are an expert researcher...",
    "tools": [web_search, document_reader],
}

coder_agent = {
    "name": "coder",
    "description": "Write and review code",
    "system_prompt": "You are an expert programmer...",
    "tools": [code_executor, linter],
}

agent = create_deep_agent(subagents=[research_agent, coder_agent])

Best for: Domain-specific expertise, different tool sets per task type.

Pattern 3: Pre-compiled Subagents

from deepagents import CompiledSubAgent, create_deep_agent

# Use existing LangGraph graph as subagent
custom_graph = create_react_agent(model=..., tools=...)

agent = create_deep_agent(
    subagents=[CompiledSubAgent(
        name="custom-workflow",
        description="Runs specialized workflow",
        runnable=custom_graph
    )]
)

Best for: Reusing existing LangGraph graphs, complex custom workflows.

Middleware Architecture

Built-in Middleware Stack

Deep Agents applies middleware in this order:

  1. TodoListMiddleware - Task planning with write_todos/read_todos
  2. FilesystemMiddleware - File ops: ls, read_file, write_file, edit_file, glob, grep, execute
  3. SubAgentMiddleware - Delegation via task tool
  4. SummarizationMiddleware - Auto-summarizes at ~85% context or 170k tokens
  5. AnthropicPromptCachingMiddleware - Caches system prompts (Anthropic only)
  6. PatchToolCallsMiddleware - Fixes dangling tool calls from interruptions
  7. HumanInTheLoopMiddleware - Pauses for approval (if interrupt_on configured)

Custom Middleware Placement

from langchain.agents.middleware import AgentMiddleware

class MyMiddleware(AgentMiddleware):
    tools = [my_custom_tool]

    def transform_request(self, request):
        # Modify system prompt, inject context
        return request

    def transform_response(self, response):
        # Post-process, log, filter
        return response

# Custom middleware added AFTER built-in stack
agent = create_deep_agent(middleware=[MyMiddleware()])

Middleware vs Tools Decision

NeedUse MiddlewareUse Tools
Inject system prompt content
Add tools dynamically
Transform requests/responses
Standalone capability
User-invokable action

Subagent Middleware Inheritance

Subagents receive their own middleware stack by default:

  • TodoListMiddleware
  • FilesystemMiddleware (shared backend)
  • SummarizationMiddleware
  • AnthropicPromptCachingMiddleware
  • PatchToolCallsMiddleware

Override with default_middleware=[] in SubAgentMiddleware or per-subagent middleware key.

Architecture Decision Checklist

Before implementing:

  1. Is Deep Agents the right tool? (vs LangGraph directly, vs simpler agent)
  2. Backend strategy chosen?

- Ephemeral only → StateBackend (default) - Need disk access → FilesystemBackend - Need cross-thread persistence → StoreBackend or CompositeBackend

  1. Subagent strategy defined?

- Which tasks benefit from isolation? - Custom subagents with specialized tools/prompts? - Parallel execution opportunities identified?

  1. Human-in-the-loop points defined?

- Which tools need approval? - Approval flow (approve/edit/reject)?

  1. Custom middleware needed?

- System prompt injection? - Request/response transformation?

  1. Context management considered?

- Long conversations → summarization triggers - Large file handling → use references

  1. Checkpointing strategy? (for persistence/resume)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

29.03%
按下载量换算294

Gemini CLI

25.21%
按下载量换算256

Antigravity

17.68%
按下载量换算179

OpenCode

14.43%
按下载量换算146

Cursor

8.19%
按下载量换算83

Codex

3.21%
按下载量换算33

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills