OpenClaw

Personal AI Assistant Platform

OpenClaw is a self-hosted, multi-channel AI assistant that runs on your own devices. It connects to 25+ messaging platforms (WhatsApp, Telegram, Slack, Discord, Signal, iMessage, and more), orchestrates LLM-powered conversations with tool use, and supports an extensible plugin ecosystem. The gateway is the control plane — the product is the assistant.

🐚 TypeScript / Node.js 💬 25+ Channels 🔌 70+ Extensions 🤖 Multi-Model LLM

📚 What is this & why does it exist?

OpenClaw is an open-source personal AI assistant that you run on your own hardware. Unlike cloud-only assistants, OpenClaw gives you full control over your data, model providers, and integrations. It acts as a gateway between the messaging platforms you already use and any LLM provider, turning every chat app into an intelligent assistant interface.

💡 Real-world analogy

Think of OpenClaw as a multilingual personal secretary who sits at a reception desk with 25 phone lines. Each phone line connects to a different communication channel (WhatsApp, Slack, Discord, etc.). When a message comes in on any line, the secretary understands the context, consults the right expert (LLM provider), uses available tools (web search, image generation, MCP servers), and responds in the caller's language and format. You control which experts the secretary consults and what tools are available.

9,000+
TypeScript Files
25+
Channels Supported
70+
Extensions
MIT
License

System Architecture

flowchart TD
  subgraph User["User Layer"]
    CLI["CLI / TUI"]
    WebUI["Web UI"]
    MobileApps["Mobile Apps"]
  end
  subgraph Gateway["Gateway Control Plane"]
    Boot["Boot / Init"]
    Auth["Auth & Rate Limiting"]
    Router["Message Router"]
    Sessions["Session Manager"]
  end
  subgraph Channels["Channel Layer"]
    WA["WhatsApp"]
    TG["Telegram"]
    Slack["Slack"]
    Discord["Discord"]
    More["25+ more..."]
  end
  subgraph Core["Core Engine"]
    Agents["Agent Orchestrator"]
    Commands["Command Processor"]
    AutoReply["Auto-Reply Engine"]
    CtxEngine["Context Engine"]
  end
  subgraph AI["AI / LLM Layer"]
    Providers["Provider Adapters"]
    Tools["Tool Execution"]
    MCP["MCP Bridge"]
    ImgGen["Image Generation"]
  end
  subgraph Plugins["Plugin Ecosystem"]
    PluginSDK["Plugin SDK"]
    Bundled["Bundled Plugins"]
    ExtDir["Extension Directory"]
  end
  subgraph Infra["Infrastructure"]
    Config["Configuration"]
    Store["Data Store"]
    Cron["Cron Scheduler"]
    Secrets["Secrets Vault"]
  end

  CLI --> Gateway
  WebUI --> Gateway
  MobileApps --> Gateway
  Gateway --> Channels
  Channels --> Core
  Core --> AI
  Core --> Plugins
  AI --> Providers
  Plugins --> MCP
  Gateway --> Infra
  Core --> Infra

Core Engine

Agents

LLM orchestration, streaming, tool use, and multi-model reasoning

The execution engine of OpenClaw. Manages agent lifecycles, streams LLM responses, handles tool calls (function calling, MCP), patches, sandboxed code execution, and provider-specific adapters for OpenAI, Anthropic, Google, and 15+ more.

1,083 TS filesMulti-providerStreaming

Gateway

Control plane: authentication, boot, routing, and session management

The central multiplexing server that handles client pairing, authentication, rate limiting, message routing, and Android/iOS node capability negotiation. Coordinates all other modules during startup.

441 TS filesAuth + Rate LimitBoot Orchestration

Commands

Slash commands, admin tools, and natural-language command processing

Parses and dispatches user commands (/model, /image, /search, /admin), manages command aliases, permission gating, and provider-switching workflows.

448 TS files50+ CommandsAdmin & User

Messaging & Channels

Channels

Unified multi-channel messaging abstraction layer

Provides the common interface for 25+ messaging platforms. Handles message normalization, allowlists, command gating, reaction acknowledgment, and channel-specific configuration (presence, chat types, media).

202 TS files25+ PlatformsUnified API

Extensions

70+ integrations: AI providers, channels, search, media, voice

Each extension implements the plugin contract to connect a specific service — from LLM providers (OpenAI, Anthropic, Ollama) to channels (WhatsApp, Telegram) to utilities (web search, image generation, voice calls).

70+ extensions1,927 TS filesPlugin Contract

Plugin & Extension System

Plugins

Plugin bundling, manifest parsing, MCP bridge, and SDK

Manages the lifecycle of bundled and user-installed plugins. Handles bundle discovery, manifest parsing, capability registration, LSP integration, MCP tool bridging, and the plugin SDK that extensions build against.

623 TS filesPlugin SDKMCP Bridge

Infrastructure

Infrastructure

Data store, caching, scheduling, process management, and runtime utilities

Core runtime services including the data store abstraction (SQLite/Postgres), caching layer, cron scheduler, process supervision, logging pipeline, and system-level utilities shared across all modules.

572 TS filesStore + CacheCron + Process

Message Flow: Channel to Agent

This sequence shows the complete lifecycle of an incoming user message, from arrival on a messaging channel through to the AI-generated response.

sequenceDiagram
    participant User as User (WhatsApp/Telegram/...)
    participant Ch as Channel Extension
    participant GW as Gateway Router
    participant Cmd as Command Processor
    participant Agent as Agent Orchestrator
    participant LLM as LLM Provider
    participant Tool as Tool / MCP Server

    User->>Ch: Send message
    Ch->>GW: Normalized message (ChatMeta)
    GW->>GW: Auth check + rate limit
    GW->>Cmd: Route to command processor
    Note over Cmd: Check for slash command prefix
    alt Slash command (e.g. /model)
        Cmd->>Cmd: Execute command handler
        Cmd-->>Ch: Command response
    else Natural language
        Cmd->>Agent: Forward to agent
        Agent->>Agent: Build context (history + system prompt)
        Agent->>LLM: Stream request (OpenAI/Anthropic/...)
        loop Streaming tokens
            LLM-->>Agent: Token chunk
            Agent-->>Ch: Forward chunk to user
        end
        opt Tool call requested
            Agent->>Tool: Execute tool (MCP/function)
            Tool-->>Agent: Tool result
            Agent->>LLM: Continue with tool result
            LLM-->>Agent: Final response
        end
        Agent-->>Ch: Complete response
    end
    Ch-->>User: Deliver response
Key insight: The Gateway owns authentication and routing. The Channel layer normalizes platform-specific messages into a unified format. The Agent orchestrator manages the LLM conversation lifecycle including streaming, tool use, and multi-turn context. Extensions implement the actual provider and channel connections.
LevelWhat You'll FindWhen to Use
0 — Project Hub (this page)Project overview, module map, architecture diagramsGetting started, finding the right module
1 — Module OverviewArchitecture diagram, key components, sub-module cards, walkthroughUnderstanding a module's purpose and structure
2 — Sub-Module Deep DiveSource-level types, algorithms, configs, code examplesImplementing, debugging, or extending code
Focus — Topic Deep DiveSingle mechanism or algorithm explained in detailDeep understanding of a specific feature

Directory Map

Project source tree
openclaw/
├── src/
│   ├── agents/                ← LLM orchestration, streaming, tool use
│   ├── gateway/               ← Control plane, auth, boot, routing
│   ├── channels/              ← Multi-channel messaging abstraction
│   ├── commands/              ← Slash command processing
│   ├── plugins/               ← Plugin bundling and lifecycle
│   ├── plugin-sdk/            ← SDK for building extensions
│   ├── infra/                 ← Data store, caching, scheduling
│   ├── config/                ← Configuration management
│   ├── cli/                   ← Command-line interface
│   ├── mcp/                   ← Model Context Protocol bridge
│   ├── auto-reply/            ← Auto-reply engine
│   ├── context-engine/        ← Context management
│   ├── flows/                 ← Setup wizards and flows
│   ├── shared/                ← Shared utilities
│   └── ...                    ← 20+ more sub-modules
├── extensions/                ← 70+ channel/provider extensions
│   ├── openai/                ← OpenAI provider adapter
│   ├── anthropic/             ← Anthropic provider adapter
│   ├── telegram/              ← Telegram channel
│   ├── whatsapp/              ← WhatsApp channel
│   ├── discord/               ← Discord channel
│   └── ...                    ← 65+ more extensions
├── packages/                  ← Standalone packages
│   ├── clawdbot/              ← CLI bot package
│   ├── moltbot/               ← Alternative bot
│   └── memory-host-sdk/       ← Memory hosting SDK
├── apps/                      ← Native applications
│   ├── android/               ← Android app (Kotlin)
│   ├── ios/                   ← iOS app (Swift)
│   ├── macos/                 ← macOS app (Swift)
│   └── shared/                ← Shared app logic (Swift)
├── ui/                        ← Web UI (Vite + TypeScript)
├── vendor/                    ← Vendored dependencies (a2ui)
├── skills/                    ← Copilot skills
├── test/                      ← Integration tests
├── scripts/                   ← Build and utility scripts
├── openclaw.mjs               ← CLI entry point
├── package.json               ← Project manifest
└── tsconfig.json              ← TypeScript configuration

Build & Tech Stack

Languages

TypeScript (primary), Swift (iOS/macOS), Kotlin (Android), Go (extensions)

Runtime

Node.js with ESM modules, pnpm workspace monorepo

Build System

tsdown (bundling), Vite (UI), Vitest (testing), pnpm workspaces

Key Dependencies

Mermaid, Highlight.js, SQLite (better-sqlite3), various LLM SDKs

Deployment

Docker, Fly.io, Render, self-hosted Node.js, Podman

Testing

Vitest with separate configs for unit, e2e, channels, contracts, extensions, gateway, live