YouTip LogoYouTip

Openclaw How It Works

OpenClaw is not an ordinary chatbot, but a personal secretary living in your computer. It can receive instructions through chat apps like WeChat, WhatsApp, and Telegram, helping you send emails, check calendars, open browsers, run commands, and even do things automatically 24/7!\n\n!(#)\n\n### Core Concepts\n\n!(#)\n\n| Concept | Analogy | Role |\n| --- | --- | --- |\n| **Gateway** | Building's front desk receptionist | Receives all external messages and routes them to the correct workspace |\n| **Workspace** | Your private office | Handles specific tasks, manages conversation history and skills |\n| **LLM (Large Language Model)** | AI consultant's brain | Understands your intent and generates replies |\n| **Skills** | Tools in a toolbox | Executes specific functions (checking weather, writing code, managing schedules, etc.) |\n| **Channels** | Communication devices | Connects different messaging platforms |\n\n### What exactly is OpenClaw?\n\nOpenClaw is a **fully open-source AI assistant that runs on your own computer** (formerly called Clawdbot, later renamed).\n\nUnlike ChatGPT, which only chats, it actually takes action:\n\n* You say in WhatsApp: "Help me check tomorrow's flights", and it will automatically open the browser, log into the airline website, and take a screenshot for you.\n* It supports hundreds of Skills, and the community is constantly adding more.\n* It has long-term memory (remembers what you like) and can even generate new skills on its own.\n* Most importantly: **All data stays on your computer, nothing is uploaded to the cloud, ensuring privacy and security**.\n\nCore idea: **Connect the AI large model (brain) + local tools (hands and feet) + chat apps (mouth and ears)**, making AI truly become your computer butler.\n\n### Overall Architecture: Gateway is the Brain's Command Center\n\nThe most core part of OpenClaw is called the **Gateway**. It's like the master control panel in your home; everything revolves around it.\n\n!(#)\n\n**Brief explanation of each part:**\n\n* **Channel Bridge**: Responsible for "shaking hands" with chat apps like WhatsApp and Telegram. For example, using the Baileys library to connect to WhatsApp.\n* **Gateway**: The only running process (occupying one port, default 18789), acting like a switchboard operator, forwarding messages to the AI.\n* **AI Brain**: The actual thinking is done by the external large model (you provide the API Key); Gateway is only responsible for "calling it to work".\n* **Tools & Skills**: The AI's hands and feet, such as opening browsers, reading/writing files, sending emails.\n* **Memory System**: Like a notebook, so the AI won't forget what you said last time.\n\n* * *\n\n## How does a message turn into an action?\n\nLet's use a real example: "Saying in WhatsApp: Help me summarize today's emails and send them to me".\n\nThe flow chart is as follows:\n\n!(#)\n\n**Detailed breakdown:**\n\n1. **Receive instruction**: You send a message β†’ the chat app's Bridge pushes the message to the Gateway.\n2. **Retrieve memory**: Gateway opens your "personal profile" (Session + Memory), knowing you are a regular user and what tone you preferred last time.\n3. **AI thinking**: Packs the message + memory and sends it to the AI brain. The AI, like a smart secretary: "Hmm, I need to read the emails first, then summarize."\n4. **Call tool**: The AI says "I want to use the Gmail skill". Gateway executes it in a secure sandbox (preventing the AI from randomly modifying files).\n5. **Execute + Feedback**: The tool gives the result to the AI, and the AI writes the summary.\n6. **Reply to user**: Gateway sends the summary back to WhatsApp. And you receive it!\n\n* * *\n\n## Overall Architecture\n\n### Three-Layer Architecture Design\n\nOpenClaw adopts a classic three-layer architecture. Let's understand it layer by layer from the outside in:\n\n!(#)\n\n### Why design it this way?\n\n**Analogy**: Imagine a large company\n\n* **Outer layer (User Interface)** = Customers can contact the company via phone, email, WeChat, etc.\n* **Middle layer (Gateway)** = Front desk reception, uniformly receiving all customers, then assigning them to the appropriate departments\n* **Inner layer (Workspace)** = Different business departments, each responsible for different affairs\n* **Bottom layer (Capability layer)** = Company's resources (expert consultants, tools and equipment, etc.)\n\n* * *\n\n## Core Components Explained\n\n### Gateway: The Unified Portal\n\n**What is Gateway?**\n\nThe Gateway is the main entrance of OpenClaw; all external messages must pass through here first.\n\n!(#)\n\n**Gateway's three major responsibilities:**\n\n#### 1. Authentication\n\nEnsures only your authorized platforms can connect\n\n!(#)\n\n#### 2. Routing\n\nDelivers messages to the correct workspace\n\n!(#)\n\n#### 3. Logging\n\nRecords all interactions for easy debugging and auditing\n\n**Command to start the Gateway:**\n\n# Start the gateway, listening on port 18789 openclaw gateway --port 18789 --verbose\n### Workspace: Your Private Office\n\n**What is Workspace?**\n\nA Workspace is where tasks are actually processed. You can have multiple workspaces, each responsible for different things.\n\n!(#)\n\n**A typical Workspace configuration example:**\n\n# workspace-personal.yaml name: "Personal assistant" llm: provider: "anthropic" # Use Claude model: "claude-sonnet-4" apiKey: "sk-ant-xxx" skills: - weather # Check weather - calendar # Manage schedule - email # Process emails - web-search # Web search settings: language: "zh-CN" temperature: 0.7 max_tokens: 4000\n**Multiple workspace use cases:**\n\n!(#)\n\n### LLM: AI's Brain\n\n**What is LLM?**\n\nLLM (Large Language Model) is OpenClaw's intelligent brain, responsible for understanding your intent and generating replies.\n\n!(#)\n\n**LLMs supported by OpenClaw:**\n\n| Provider | Model Example | Features | Use Cases |\n| --- | --- | --- | --- |\n| Anthropic | Claude Sonnet 4 | Balanced, safe, good at multilingual | Daily conversation, writing |\n| OpenAI | GPT-4 | Professional, broad knowledge | Professional tasks, analysis |\n| DeepSeek | DeepSeek-V3 | Strong coding ability, cheap | Programming assistance |\n| Local Deployment | Ollama | Completely private, free | Privacy-sensitive scenarios |\n\n### Channels: Connecting to the Outside World\n\n**What are Channels?**\n\nChannels are "adapters" that connect various messaging platforms.\n\n!(#)\n\n**Each Channel's job:**\n\n1. **Receive messages**: Get user messages from the platform\n2. **Format conversion**: Uniformly convert to OpenClaw's internal format\n3. **Send replies**: Send OpenClaw's replies back to the platform\n\n**Example: Telegram Channel's workflow**\n\n!(#)\n\n* * *\n\n## Message Flow Process\n\nNow let's see how a complete message flows within OpenClaw:\n\n### Complete Message Flow Diagram\n\n!(#)\n\n### Detailed Step Breakdown\n\n**Steps 1-3: Message Reception and Standardization**\n\nAfter a user sends a message on Telegram, the Telegram Channel converts it into OpenClaw's standard format:\n\n{ "platform": "telegram", "channel_id": "telegram_123", "user": { "id": "user_456", "
← Skill Creator UsageCoding Plan β†’