ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

deepagents-architecture

Guides architectural decisions for Deep Agents applications. Use when deciding between Deep Agents vs alternatives, choosing backend strategies, designing subagent systems, or selecting middleware approaches.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/anderskev/deepagents-architecture
Or

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

Metadata

Author@anderskev
Stars4473
Views0
Updated2026-05-01
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-anderskev-deepagents-architecture": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.