Agentic Research

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

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

What Is a Three-Layer Agent Framework?

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)