Agentic Research

Read these first

This article assumes the following earlier in its learning path.

Three-Layer Agent Collaboration Framework: Hermes → OpenClaw → Claude Code Architecture Explained

2026/05/096 min readBryan Chan閱讀中文原文
TopicsAgentArchitectureMulti-AgentHermesOpenClaw

What Is a Three-Layer Agent Framework?

The three-layer agent: communication, orchestration, executionAn agent system splits vertically into three layers, and the reason is not tidiness — it is that the three have different failure modes and different permission needs. The communication layer receives instructions and returns results; it owns WHO may talk to it, and its failure mode is strangers issuing commands, which is usually an unconfigured allowlist rather than a technical error. The orchestration layer understands, decomposes, schedules and dispatches; it owns WHO does the work, and its failure modes are two workers editing the same place with the later write silently winning, or the lead's context blowing up first. The execution layer actually acts — edits files, runs commands, calls APIs; it owns WHAT can be touched, and its failure mode is an irreversible action with no gate, the only layer whose mistakes really break things. Merged into one layer, any problem becomes every problem and you cannot tell which layer caused it; split, each layer gets its own gate: an allowlist at the top, disjoint write scopes in the middle, a permission mode at the bottom. What passes between layers should also be constrained: from communication to orchestration it is an authenticated request, and from orchestration to execution it is a scoped task.Three layers, because the three have different failure modes and different permissionsCommunicationReceives instructions, returns resultsIt owns WHO may talk to itInstances: Feishu/Lark, WhatsApp, WeChat, Telegram, Slack intake and pairingLAYER 1a vetted requestOrchestrationUnderstands the task, decomposes, schedules, dispatchesIt owns WHO does the workInstances: task boards, subagent dispatch, skill and tool selectionLAYER 2a scoped taskExecutionActually acts: edits files, runs commands, calls APIsIt owns WHAT can be touchedInstances: code generation and file edits, shell execution, Git operations, sandboxesLAYER 3CommunicationFailure mode: strangers can issue commands. The breach here is not a technical error but an unconfigured allowlist.1
1/5Communication
It owns who may talk to it
Step 1 of 5 Communication
Diagram: the three-layer Agent architecture. What the communication, orchestration and execution layers each handle, and how one message travels through all three.

When AI Agent tasks become complex, a single Agent often cannot handle them. The three-layer Agent framework vertically layers tasks, with each layer focusing on a different level of abstraction:

┌─────────────────────────────────────────┐
│  Layer 1: Hermes Agent (Communication Layer)│
│  ─ Manage all external communication channels                    │
│  ─ Feishu/Lark, WhatsApp, WeChat, etc.             │
│  ─ Receive instructions, distribute tasks, return results             │
├─────────────────────────────────────────┤
│  Layer 2: OpenClaw (Orchestration Layer)              │
│  ─ Task understanding, decomposition, scheduling                    │
│  ─ Manage Claude Code Bridge skills           │
│  ─ Skills and tool invocation                      │
├─────────────────────────────────────────┤
│  Layer 3: Claude Code (Execution Layer)           │
│  ─ Code generation, file editing, Shell execution           │
│  ─ Git operations, project management                     │
│  ─ Powered by ModelStudio / DeepSeek         │
└─────────────────────────────────────────┘

Layer 1: Hermes Agent (Communication Layer)

Responsibility: Acts as the system's "ears and mouth," managing all external communication.

  • Integrate with Feishu/Lark Bot to receive users' natural language instructions
  • Support multiple channels: WhatsApp, WeChat, Telegram, etc.
  • Parse user intent and pass it to OpenClaw
  • Format execution results and return them to the user

Why is a separate layer needed?

Communication logic (message formats, Webhooks, event push) and business logic (task execution) are two entirely different concerns. After separation:

  • Changing communication platforms does not affect the core business
  • Hermes can connect to multiple channels simultaneously
  • The user experience is unified: regardless of which entry point a command is sent from, behavior remains consistent

Layer 2: OpenClaw (Orchestration Layer)

Responsibility: The "brain" of the system, responsible for understanding tasks, breaking down steps, and coordinating resources.

  • Receive user intent from Hermes
  • Break complex tasks into executable subtasks
  • Manage Skills (reusable capability modules)
  • Call Claude Code via Claude Code Bridge to execute specific operations
  • Maintain contextual memory and cross-task associations

Key Skill: Claude Code Bridge

This is an OpenClaw plugin/Skill that enables OpenClaw to directly operate Claude Code:

User → Hermes → OpenClaw → [Claude Code Bridge] → Claude Code → Execute

The bridge encapsulates Claude Code's CLI interface, enabling OpenClaw to:

  • Start Claude Code sessions
  • Pass task descriptions
  • Read execution results
  • Manage multiple parallel Claude Code instances

Layer 3: Claude Code (Execution Layer)

Responsibilities: The system's "hands", actually operating the file system and executing code.

  • Read and edit codebases
  • Execute shell commands
  • Git operations (commit, branch, diff)
  • Driven by an LLM (ModelStudio / DeepSeek)

Dual-model configuration strategy:

ScenarioModelReason
Daily codingDeepSeek V3High cost-effectiveness, strong reasoning
Complex refactoringDeepSeek R1Deep reasoning
Long contextModelStudio (Qwen)Alibaba ecosystem integration
FallbackThe two serve as mutual backupsAutomatic switching on API failure

Communication Flow

A complete user request flow:

  1. The user sends a message in Feishu: "Help me check the latest commit in the OpenClaw project and see if there are any bugs"
  2. Hermes Agent receives the message and parses the intent → "code review request for OpenClaw"
  3. Hermes passes the task to OpenClaw.
  4. OpenClaw breaks it down into:
    • Step 1: Start Claude Code through Claude Code Bridge
    • Step 2: Use git log to view recent commits
    • Step 3: Use git diff to inspect changes
    • Step 4: Claude Code analyzes the code
    • Step 5: Generate a review report
  5. OpenClaw aggregates the results and passes them to Hermes.
  6. Hermes formats them into a Feishu message and returns it to the user.

Design Principles

  1. Single Responsibility: Each layer does only one thing, and does it well.
  2. Loose Coupling: Layers communicate through clearly defined interfaces and can be upgraded or replaced independently.
  3. Fault Tolerance and Isolation: A failure in one layer does not affect other layers. For example, when the Claude Code API is rate-limited, OpenClaw can queue and retry.
  4. Observability: Each layer has log output, making troubleshooting easier.

Applicable Scenarios

  • Personal development assistant (automating daily development tasks)
  • Team collaboration (multiple people interact with the Agent through Feishu groups)
  • CI/CD enhancement (the Agent participates in code review and deployment decisions)
  • Knowledge management (the Agent automatically organizes documents and generates reports)

Next on this path