跳转到内容

Architecture Overview

此内容尚不支持你的语言。

Clawdbot follows a modular architecture that separates concerns and enables extensibility.

┌─────────────────────────────────────────────────────────────┐
│ Clawdbot Core │
├─────────────────────────────────────────────────────────────┤
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ WhatsApp │ │ Telegram │ │ Discord │ │ Slack │ │
│ │ Channel │ │ Channel │ │ Channel │ │ Channel │ │
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘ │
│ │ │ │ │ │
│ └─────────────┼─────────────┼─────────────┘ │
│ ▼ │
│ ┌──────────────┐ │
│ │ Gateway │ │
│ │ (Router) │ │
│ └──────┬───────┘ │
│ │ │
│ ┌─────────────┼─────────────┐ │
│ ▼ ▼ ▼ │
│ ┌────────┐ ┌──────────┐ ┌────────┐ │
│ │ Hooks │ │ Plugins │ │ Tools │ │
│ └────────┘ └──────────┘ └────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────┐ │
│ │ Claude │ │
│ │ API │ │
│ └──────────────┘ │
└─────────────────────────────────────────────────────────────┘

Channels handle communication with external platforms:

  • WhatsApp: Via WhatsApp Web protocol
  • Telegram: Using Bot API
  • Discord: Discord.py integration
  • Slack: Bolt SDK
  • iMessage: macOS automation

The central router that:

  • Receives messages from all channels
  • Applies middleware and hooks
  • Routes to appropriate handlers
  • Manages conversation context

Extend functionality:

  • Plugins: Add new features
  • Tools: Provide capabilities to Claude
  • Hooks: Intercept and modify behavior

Handles communication with Anthropic:

  • Message formatting
  • Context management
  • Response processing
  1. Message Received: Channel receives user message
  2. Pre-processing: Hooks run, message normalized
  3. Context Loading: Conversation history retrieved
  4. API Call: Message sent to Claude
  5. Post-processing: Response processed by hooks
  6. Delivery: Response sent back via channel

Clawdbot uses layered configuration:

.env (secrets) → config.yaml (settings) → CLI args (overrides)